This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix PR58602 (.gcno files not truncated at gcov_close)


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

As a reminder, that prevent running lcov on kernel side.
    http://sourceforge.net/p/ltp/mailman/message/31141937/

Thanks
Laurent

On 10/03/13 17:01, Laurent Alfonsi wrote:
Hi All,

We have discovered a bug on gcno file generation registred as PR58602.

When the .gcno graph file is opened for generating the coverage graph information, the mode used is w+ as this code is shared with updating tools such as libgcov. Thus, when GCC outputs .gcno files, it may leave garbage at the end of the file if the file already exists when opening it.

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

This following patch fixes the function gcov_open() such that the .gcno file is opened with truncation when gcc asks for creating a new file (mode<0).

Regression test x86-64 are ok with this patch.
Is it ok to commit in trunk ?

Thanks
Laurent



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]