Error parsing gcov branch information with negative count
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at src/parser.rs:411 and compare the failing branch-count parsing with the approach discussed in #803. Reproduce the error using the shown gcov JSON containing a count of -1, then verify that grcov no longer panics and handles the input with an appropriate result or diagnostic.
Written by the indexing model from the issue text.
Description
I think this is similar to #570. When running grcov on a fairly large codebase I see the following error:
$ grcov --branch ./main
17:46:15 [ERROR] A panic occurred at src/parser.rs:411: called `Result::unwrap()` on an `Err` value: Error("Unable to parse u64 from -1", line: 1, column: 12387510)
Running gcov manually and inspecting the *gcov.json.gz files the offending entry is:
{
"branches": [
{
"fallthrough": true,
"count": 783,
"throw": false
},
{
"fallthrough": false,
"count": -1,
"throw": false
}
],
"count": 782,
"line_number": 83,
"unexecuted_block": false,
"function_name": "_ZN15_CORBA_SequenceIN5Tango8DevErrorEE8allocbufEj"
}
I am using gcov/gcc version 11.3.0 and grcov 0.8.12 (also 0.8.11). Probably this is also a bug in gcov but would a fix like #803 be desired here?
On another note, running grcov with --log-level DEBUG or similar options didn't seem to produce any useful output in this case. I had to do some manual searching to find what file was actually causing the issue.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 170
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
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 mozilla/grcov
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
`grcov` can panic on several malformed coverage inputs instead of reporting parse/output errors Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100