8000 UnknownLineType thrown when parsing coverage data from 10K+ line file · Issue #882 · gcovr/gcovr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

UnknownLineType thrown when parsing coverage data from 10K+ line file #882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zidel opened this issue Feb 7, 2024 · 3 comments · Fixed by #883
Closed

UnknownLineType thrown when parsing coverage data from 10K+ line file #882

zidel opened this issue Feb 7, 2024 · 3 comments · Fixed by #883

Comments

@zidel
Copy link
zidel commented Feb 7, 2024

Describe the bug
When the source code file is larger than 10K lines the .gcov format appears to drop the space between %%%%%: and the line number. This causes _RE_BLOCK_LINE to not match since it requires the space to be present.

Slightly redacted .gcov extract:

    %%%%%: 9998-block  1
call    6 never executed
    #####: 9999:    child_->set_access([...]);
call    0 never executed
branch  1 never executed (fallthrough)
branch  2 never executed (throw)
    #####:10000:    setReadAccess(*child_);
    %%%%%:10000-block  0
call    0 never executed
branch  1 never executed (fallthrough)
branch  2 never executed (throw)
    #####:10001:    child_ = child_->add_child([...]);
    %%%%%:10001-block  0

To Reproduce
Steps to reproduce the behavior:

  1. Generate coverage data for a file with at least 10000 lines of code
  2. gcovr -r . --html-details -o coverage/index.html (or similar)
  3. gcovr dumps all -block lines with line number 10000 or higher, then fails with gcovr.formats.gcov.parser.UnknownLineType: %%%%%:10000-block 0

Expected behavior
_RE_BLOCK_LINE should matches lines 10000 and later

Desktop (please complete the following information):

  • OS: Debian testing
  • GCC version: Debian 13.2.0-13
  • GCOVR version 7.0

Additional context
When I deleted the .gcno file for the large .cpp file the report for the other files was generated successfully

@zidel zidel added the Type: Bug label Feb 7, 2024
@Spacetown
Copy link
Member

Thanks for reporting this. I try to check on this today.

@zidel
Copy link
Author
zidel commented Feb 7, 2024

I have a small patch for this at work, but I don't know how long it will take to get approval to upstream it. I'll leave it up to you whether you want to fix it yourself or wait for a PR.

@Spacetown
Copy link
Member

I have a small patch for this at work, but I don't know how long it will take to get approval to upstream it. I'll leave it up to you whether you want to fix it yourself or wait for a PR.

I know this. The first contribution to glove I did in my spare time 😆, now you see the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0