Skip to content
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

Count overflow warning #613

Open
damienrg opened this issue May 4, 2021 · 7 comments
Open

Count overflow warning #613

damienrg opened this issue May 4, 2021 · 7 comments

Comments

@damienrg
Copy link

damienrg commented May 4, 2021

Following #555 (comment), you can find a project that triggers the problem:
https://gitlab.com/damienrg/grcov-count-overflow

/cc @calixteman

@calixteman
Copy link
Collaborator

Cool thx, I'll have a look on that.

@calixteman
Copy link
Collaborator

And I can reproduce with:

RUSTFLAGS="-Zinstrument-coverage" LLVM_PROFILE_FILE="test-%p-%m.profraw" cargo +nightly test
grcov --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "/*" -o ./coverage/ .

@calixteman
Copy link
Collaborator

calixteman commented May 4, 2021

Interestingly, faulty counters are not same from a run to an other, so I'd say that some counters are concurrently accessed from the different threads.
So I ran tests in adding -- --test-threads 1 and no more underflow \o/.
With clang it's possible to have atomic counters when profiling:
https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-update
so we need to figure out how to pass this option to rustc.
By the way, it very likely means that no one should trust in these counters...

@dnaka91
Copy link
Contributor

dnaka91 commented May 10, 2021

I wanted to run grcov on one of my older crates and got a Execution count overflow detected. error as well. That's the same thing as described in this issue right?

In the hope that this might help in further investigating the issue. The repo is https://github.com/dnaka91/chronver and I ran the following commands on it:

RUSTFLAGS="-Zinstrument-coverage" LLVM_PROFILE_FILE="coverage-%p-%m.profraw" cargo +nightly test --all-features
rustup run nightly grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage

@DanielJoyce
Copy link

-- --test-threads 1 didn't fix it for me.

@DanielJoyce
Copy link

Looks like reports ARE generated, it's just a warning it seems.

@marco-c
Copy link
Collaborator

marco-c commented Jun 29, 2021

Yes, it is just a warning and doesn't affect the line level coverage, just the number of times a line is hit.

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

No branches or pull requests

5 participants