-
Notifications
You must be signed in to change notification settings - Fork 235
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
gcov error:std::bad_alloc #295
Comments
You didn't say what compiler and version(s) you used, your platform, or even the source language of your example. Sounds a lot like out of memory. How do you know that your system's memory is sufficient? In any event: you have not provided enough information for anyone to be able to help you. |
When using gcov version 8.3.0 paired with lcov 1.13 or gcov 9.4.0 paired with lcov 2.0 to process main.cpp, an error is encountered:
When using gcov version 4.8.0 to process main.cpp, a different error is encountered: After using gcov 4.8.0 to execute: using gcov8.3 or gcov9.4 to execute:
The same compilation process and generation coverage process are fine in the func.cpp file |
Current gcc version is 13. This isn't an lcov bug - but the same observation applies. Current 'release' version is 2.1. lcov/1.13 predates move to github - and is really, really old. |
Is it possible that there is an error in the content of my gcda and gcno? |
Anything is possible. Not sure your affiliation or interests - but if you happen to be a computer science or software engineering student somewhere, then this could be a really excellent learning experience: track down a fix a real bug in a nontrivial framework. |
I upgraded the version and the current environment is gcc12.2, lcov2.2-beta, Recompiled gcda and gcno, but there are still errors:
Execution: |
Looks like gcov has a bug (or the compiler has a bug and is producing something that crashes gcov). I seriously doubt that anyone is going to be able to identify or fix the issue without a testcase. It is also probably worth trying your example with llvm to see if it fails with an entirely different toolchain. The other thing you can do is suggested by the lcov error message above: ignore the gcov error and generate data for the rest of your project. This particular compilation unit won't have any data, but you might not care. |
I have used different versions of gcov and lcov to perform coverage analysis on two .cpp files. Both gcda and gcno files are generated correctly, and the file paths are accurate with no damage to the files. When generating the coverage of one file, it is normal, but when attempting to generate coverage for another file, I always encounter an error:
I have checked my system's memory, and it is sufficient. The file is not large
The text was updated successfully, but these errors were encountered: