geninfo confused by gcov output with multi-line statements: "unexecuted block on non-branch line with non-zero hit count."
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with geninfo and the gcov JSON handling; the issue does not identify a specific source file or test. Run the provided reproducer with GCC 15 and compare its gcov output with GCC 14, focusing on the multi-line statement and the unexecuted_block, branches, and count fields. Done means geninfo handles the GCC 15 output without the spurious warning while preserving correct coverage counts.
Written by the indexing model from the issue text.
Description
Hi,
gcc's coverage output starting with gcc-15 leads to complaints about "unexecuted block on non-branch line with non-zero hit count.".
I simplified the real-world case to this reproducer:
int main(int argc, char **argv)
{
/* triggers spurious complaints unless newline is removed */
char *foo =
argc > 0 ? argv[0] : 0;
}
export GCC_VER=15 PATH="/home/andres/src/lcov/bin/:$PATH"
rm -f *.gcno *.gcda *.gcov *.info.* *.json.gz
gcc-${GCC_VER} --coverage coverage_bug_a.c -o coverage_bug_a
./coverage_bug_a || true
geninfo --gcov-tool gcov-${GCC_VER} .
results in this warning, unless using geninfo_unexecuted_blocks=1 is used:
...
using: chunkSize: 1, nchunks:1, intervalLength:0
geninfo: WARNING: (inconsistent) /home/andres/tmp/coverage_bugs/coverage_bug_a.c:4: unexecuted block on non-branch line with non-zero hit count. Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
(use "geninfo --ignore-errors inconsistent,inconsistent ..." to suppress this warning)
...
With <= gcc-14 this does not happen.
The complaint seems to be triggered by the fact that starting with gcc 15, line 4 "unexecuted_block": true is reported, while having "branches": [], and "count": 1,; line 5 is reported as "unexecuted_block": false,, while having branches, including one with "count": 0,
Whereas before that, "unexecuted_block": false, was reported for line 4 and "unexecuted_block": true.
I'm not sure gcc > 15 behavior is clearly better, but it's also not really wrong, given that the block really starts in line 4, not line 5.
FWIW, this triggers complaints with lcov going at least back to 2.0.
Greetings,
Andres
- Dominant language
- Shell
- Stars
- 1.1k
- Forks
- 272
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linux-test-project/lcov
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linux-test-project/lcov#546 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
linux-test-project/lcov#557 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
linux-test-project/lcov#555 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 63/100
linux-test-project/lcov#536 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
linux-test-project/lcov#469 · 2 comments ·
Maintainers usually reply within 1 day
All issues in linux-test-project/lcov
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
glossyio/traffic-monitor#256 ·
Maintainers usually reply within 1 day
-
source:reader type:content-error
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
stephrobert/blog-roadmap#121 ·
-
lesson-submission pending-review
Difficulty 1/5 Under an hour Newbie friendliness 74/100
Ikalus1988/MisakaNet#3899 ·
Maintainers usually reply within 1 day
-
sync with NCO's changes
Difficulty 1/5 Under an hour Newbie friendliness 82/100