question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C++ Coverage on Linux is broken

See original GitHub issue

ATTENTION! Please read and follow:

  • if this is a question about how to build / test / query / deploy using Bazel, or a discussion starter, send it to bazel-discuss@googlegroups.com
  • if this is a bug or feature request, fill the form below as best as you can.

Description of the problem / feature request:

When I execute the bazel coverage command with version 0.24.1, I can generate a valid coverage.dat file, but when using a version higher than 0.24.1, the coverage.dat file is empty. This problem exists only when generating coverage for the C++ language.

$ ll bazel-testlogs/id_test/ total 3136 drwxr-xr-x 2 admin admin 4096 Sep 19 15:29 ./ drwxr-xr-x 3 admin admin 4096 Sep 19 15:07 …/ -r-xr-xr-x 1 admin admin 581600 Sep 19 15:07 baseline_coverage.dat* -r-xr-xr-x 1 admin admin 68477 Sep 19 15:29 coverage.dat* -r-xr-xr-x 1 admin admin 179 Sep 19 15:29 test.cache_status* -r-xr-xr-x 1 admin admin 2539566 Sep 19 15:29 test.log* -rw-r–r-- 1 admin admin 904 Sep 19 15:28 test.xml $ bazel version Build label: 0.24.1 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Tue Apr 2 16:29:26 2019 (1554222566) Build timestamp: 1554222566 Build timestamp as int: 1554222566

$ ll bazel-testlogs/id_test/ total 4108 drwxr-xr-x 2 admin admin 4096 Sep 19 15:25 ./ drwxr-xr-x 3 admin admin 4096 Sep 19 15:07 …/ -r-xr-xr-x 1 admin admin 581600 Sep 19 15:07 baseline_coverage.dat* -r-xr-xr-x 1 admin admin 0 Sep 19 15:25 coverage.dat* -r-xr-xr-x 1 admin admin 176 Sep 19 15:25 test.cache_status* -r-xr-xr-x 1 admin admin 3600923 Sep 19 15:25 test.log* -rw-r–r-- 1 admin admin 904 Sep 19 15:25 test.xml $ bazel version Build label: 0.25.0 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Wed May 1 21:45:01 2019 (1556747101) Build timestamp: 1556747101 Build timestamp as int: 1556747101

Replace this line with your answer.

Feature requests: what underlying problem are you trying to solve with this feature?

Replace this line with your answer.

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Replace this line with your answer.

What operating system are you running Bazel on?

Replace this line with your answer.

What’s the output of bazel info release?

Replace this line with your answer.

If bazel info release returns “development version” or “(@non-git)”, tell us how you built Bazel.

Replace this line with your answer.

What’s the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Replace this line with your answer.

Have you found anything relevant by searching the web?

Replace these lines with your answer.

Places to look:

Any other information, logs, or outputs that you want to share?

Replace these lines with your answer.

If the files are large, upload as attachment or provide link.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:46 (15 by maintainers)

github_iconTop GitHub Comments

5reactions
mfourieshieldaicommented, Mar 31, 2020

Really appreciate a fix here.

2reactions
iphydfcommented, Apr 18, 2020

Not working on either Linux or Mac with Bazel 3.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

lcov not working properly for coverage - gcov - Stack Overflow
Firstly I would suggest to check if gcov returns correct coverage data. Means need to run gcov tool and check *.gcov file for...
Read more >
Bug#989862: gcc-mingw-w64: coverage is completely broken
Package: gcc-mingw-w64. Version: 22~exp1. Severity: important. Dear Maintainer, Ever since gcc-mingw-w64 was updated to use GCC 8, ...
Read more >
GCOV Coverage analysis for C/C++ code on Linux - SonarQube
Try to clone GitHub - peter-toft-greve/democode_sonarqube on a normal Linux machine - where gcov is installed. With “make” I make code coverage ......
Read more >
Chapter 2. Creating C or C++ Applications Red Hat Enterprise ...
Support coverage: Most static libraries provided by Red Hat are in the CodeReady Linux Builder channel and not supported by Red Hat. Functionality....
Read more >
gcov - Unix, Linux Command - Tutorialspoint
gcov - Unix, Linux Command, Profiling tools help you analyze your code's ... gcc -fprofile-arcs -ftest-coverage tmp.c $ a.out $ gcov tmp.c 90.00%...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found