LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 22436 - llvm-cov cannot open GCOV coverage generated by clang
Summary: llvm-cov cannot open GCOV coverage generated by clang
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: 3.6
Hardware: PC Linux
: P normal
Assignee: Vanderson M. Rosario
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-02 13:00 PST by Vanderson M. Rosario
Modified: 2015-03-18 12:59 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Testcase (90 bytes, application/x-shellscript)
2015-02-02 13:03 PST, Vanderson M. Rosario
Details
Test code (111 bytes, text/x-c++src)
2015-02-02 13:03 PST, Vanderson M. Rosario
Details
A solution for when GCDA has exit block edges. (833 bytes, patch)
2015-02-05 12:29 PST, Vanderson M. Rosario
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vanderson M. Rosario 2015-02-02 13:00:52 PST
When llvm-cov tries to open an .gcda file created by clang the following error is showed:

warning: Using the gcov compatible mode (this behaviour may be dropped in the future).
Unexpected number of edges (in _Z4testi).
Invalid .gcda File!

And when I tried to open with gcov (4.6.4) the following message appeared:

test.gcno:version '402*', prefer '406*'
test.gcda:version '402*', prefer version '406*'
test.gcno:'_Z4testi' has arcs from exit block
test.gcno:'main' has arcs from exit block
File 'test.cpp'
Lines executed:83.33% of 6
test.cpp:creating 'test.cpp.gcov'
Comment 1 Vanderson M. Rosario 2015-02-02 13:03:00 PST
Created attachment 13795 [details]
Testcase
Comment 2 Vanderson M. Rosario 2015-02-02 13:03:45 PST
Created attachment 13796 [details]
Test code
Comment 3 Vanderson M. Rosario 2015-02-05 12:29:55 PST
Created attachment 13812 [details]
A solution for when GCDA has exit block edges.
Comment 4 Justin Bogner 2015-03-16 17:29:14 PDT
So I am planning on applying something like the patch that's here, as it makes sense to warn instead of failing, but the real problem is that clang's generating bogus coverage data right now.

In r223193 we started emitting the exit block second instead of last, but this isn't compatible with how gcov worked before 4.7 or 4.8. Since we claim we're generating gcov 4.2 compatible output, the gcov data we're outputting is pretty bogus. Some discussion of this is ongoing on the r223193 review thread:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150309/265388.html
Comment 5 Justin Bogner 2015-03-16 18:55:38 PDT
This should be fixed by r232438 - clang emits the 4.2 compatible coverage that llvm-cov understands by default again.