public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/101773] New: errors when writing to .gcda file are not checked
@ 2021-08-04 10:20 vincent-gcc at vinc17 dot net
  2021-08-04 10:35 ` [Bug gcov-profile/101773] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: vincent-gcc at vinc17 dot net @ 2021-08-04 10:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101773

            Bug ID: 101773
           Summary: errors when writing to .gcda file are not checked
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincent-gcc at vinc17 dot net
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

When I run a program compiled with -fprofile-generate, this program creates a
.gcda file, but write/close errors are not checked. With GCC 12.0.0 20210729
built from master and an almost full file system for the .gcda file:

$ gcc-test -O -fprofile-generate=dir tst.c
$ strace ./a.out
[...]
openat(AT_FDCWD, "dir/#home#vlefevre#a-tst.gcda", O_RDWR|O_CREAT, 0666) = 3
fcntl(3, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
read(3, "", 1024)                       = 0
lseek(3, 0, SEEK_SET)                   = 0
write(3, "adcg 02B\21\20\217\20\0\0\0\241\10\0\0\0\1\0\0\0\1\0\0\0\0\0\0\1"...,
84) = -1 ENOSPC (No space left on device)
close(3)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

Note that with gcc (Debian 10.2.1-6) 10.2.1 20210110, I get an error message:

$ ./a.out
libgcov profiling error:dir/#home#vlefevre#tst.gcda:Error writing

but the exit status is also 0, so that the error cannot be detected in scripts.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-04 15:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 10:20 [Bug gcov-profile/101773] New: errors when writing to .gcda file are not checked vincent-gcc at vinc17 dot net
2021-08-04 10:35 ` [Bug gcov-profile/101773] " rguenth at gcc dot gnu.org
2021-08-04 11:39 ` vincent-gcc at vinc17 dot net
2021-08-04 12:39 ` marxin at gcc dot gnu.org
2021-08-04 12:50 ` vincent-gcc at vinc17 dot net
2021-08-04 14:09 ` marxin at gcc dot gnu.org
2021-08-04 14:35 ` vincent-gcc at vinc17 dot net
2021-08-04 15:12 ` marxin at gcc dot gnu.org
2021-08-04 15:15 ` vincent-gcc at vinc17 dot net
2021-08-04 15:27 ` cvs-commit at gcc dot gnu.org
2021-08-04 15:28 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).