public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/58602] New: .gcno files not truncated at gcov_close
@ 2013-10-03 10:11 laurent.alfonsi at st dot com
  2013-10-24 18:56 ` [Bug gcov-profile/58602] " gbanks at sgi dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: laurent.alfonsi at st dot com @ 2013-10-03 10:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58602

            Bug ID: 58602
           Summary: .gcno files not truncated at gcov_close
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: laurent.alfonsi at st dot com

Created attachment 30950
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30950&action=edit
script to reproduce

Gcc doesnot clean the .gcno file before writing in. Thus, it might contain
garbage at the end.

At one point, it was truncated, but this has been removed.
  http://gcc.gnu.org/ml/gcc-patches/2004-07/msg02541.html

Test case : 
 $ rm test.gcno 
 $ gcc -ftest-coverage -fprofile-arcs test.c -O3
 $ ls -la test.gcno 
 -rw-r--r-- 1 alfonsi gnbcomp 688 Oct  3 11:57 test.gcno

 $ gcc -ftest-coverage -fprofile-arcs test.c -O0
 $ ls -la test.gcno 
 -rw-r--r-- 1 alfonsi gnbcomp 908 Oct  3 11:57 test.gcno

 $ gcc -ftest-coverage -fprofile-arcs test.c -O3
 $ ls -la test.gcno 
 -rw-r--r-- 1 alfonsi gnbcomp 908 Oct  3 11:58 test.gcno

As you may see, the last 220 bytes are garbage from the preceding O0
compilation.

I enclosed a small script that expose the problem.

This has been trackeddown from a kernel issue on lcov:
  http://sourceforge.net/p/ltp/mailman/message/31141937/


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

end of thread, other threads:[~2014-02-03 21:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-03 10:11 [Bug gcov-profile/58602] New: .gcno files not truncated at gcov_close laurent.alfonsi at st dot com
2013-10-24 18:56 ` [Bug gcov-profile/58602] " gbanks at sgi dot com
2013-10-24 19:01 ` gbanks at sgi dot com
2013-10-25  6:48 ` laurent.alfonsi at st dot com
2013-10-25  6:58 ` laurent.alfonsi at st dot com
2014-01-16 10:37 ` laurent.alfonsi at st dot com
2014-01-16 10:44 ` mpolacek at gcc dot gnu.org
2014-01-16 17:24 ` law at redhat dot com
2014-01-27 13:50 ` laurent.alfonsi at st dot com
2014-02-03 21:56 ` law at gcc dot gnu.org
2014-02-03 21:56 ` law at redhat dot com

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).