Comments (7)
You didn't say what compiler and version(s) you used, your platform, or even the source language of your example.
If it fails with the newest GCC - maybe you can try LLVM (either gcov or profdata path).
You can execute gcov with different flags to see what makes it unhappy.
Similarly, you can modify your source code (e.g., by stubbing our some functions) - to possibly narrow down the issue.
Sounds a lot like out of memory. How do you know that your system's memory is sufficient?
Could also be a bug in gcov - trying to allocate an unreasonably large buffer.
In any event: you have not provided enough information for anyone to be able to help you.
from lcov.
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:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
When using gcov version 4.8.0 to process main.cpp, a different error is encountered:
main.gcno no functions found
After using gcov 4.8.0 to execute: gcov main.cpp
, there will be some prompts for main. cpp: no lines for
, but the main. cpp.gcov file can still be generated normally,
using gcov8.3 or gcov9.4 to execute: gcov main.cpp
, the error is encountered:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
The same compilation process and generation coverage process are fine in the func.cpp file
from lcov.
Current gcc version is 13.
gcc/4.8 is about 10 years old and 8.3 is more than 5.
I suggest to upgrade.
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.
Pretty sure that lcov/2.1 and 2.0 both support gcc/4.X (but not older than 4) - so you may be able to use that, if you really cannot upgrade. Sounds like the gcov-extracted data is not completely correct, though.
You could also just exclude the offending file from processing (losing that compilation unit from the coverage report).
from lcov.
Is it possible that there is an error in the content of my gcda and gcno?
from lcov.
Anything is possible.
An error in the compile-time data (gcno) would be a compiler bug.
An error in the runtime data (gcda) would either be a compiler or C/C++ runtime bug.
Or this could be a bug in gcov.
If you really want to diagnose it: then you will need to do some experiments - and probably need the source code for the toolchain components so you can see what they are doing.
Or you could upgrade and hope it goes away.
Or you could upgrade - discover that there is still an issue - and then debug more recent toolchain code.
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 guarantee you that you would learn a lot. (I guarantee you that I would learn a lot.)
from lcov.
Related Issues (20)
- geninfo: ERROR: (negative) Unexpected negative hit count '-88' HOT 7
- static function is not included in the coverage. HOT 2
- Support cobertura format as input HOT 10
- genhtml: ERROR: unexpected .info file record 'BFH:0' HOT 7
- What do these symbols for branch coverage mean? HOT 3
- `use "genhtml --ignore-errors source,source ..." to suppress this warning` HOT 6
- line coverage looks strange, with cross compilation and remote collection HOT 5
- Lcov2.0 filters normal branched when --filter branch and no_exception_branch=1 both works HOT 11
- function coverage not hit, then line coverage hit HOT 6
- geninfo settings don't work in config files in v2.1-beta1 or v2.1-beta2 HOT 3
- test_differential in the example now gives error HOT 1
- genhtml is too slow compared to old version HOT 10
- genhtml: --keep-going doesn't work for ERROR: <file> is not readable or doesn't exist. HOT 8
- how to see the verbose error msg? HOT 11
- LCOV 2.1 not compatible with Codecov HOT 9
- LCOV coverage.dat file has "DA:0:0" HOT 3
- lcov on x86 HOT 9
- genhtml: ERROR: Can't call method "branchElem" on an undefined value HOT 2
- Duplicate folder structure (--prefix does not help) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lcov.