-
Notifications
You must be signed in to change notification settings - Fork 283
gcovr 5.2 crashes with UnknownLineType and "Cannot open source file" #736
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
Comments
Duplicate of #583. This is a gcov bug and not related to gcovr. |
In the linked issue this bug of gcov was discussed and the other issue is our workaround to ignore this bug. The workaround is only available on mater and will be released soon. |
For the record, this is still broken with gcovr 6.0, see https://bugzilla.redhat.com/show_bug.cgi?id=2166960#c7 |
And as for the workaround: taking the gcovr call that meson produces and appending:
|
Oh, in the PR comment the option was wrong. Please use |
I tried both options, makes no difference:
|
It makes a difference. The option is accepted but GCOV itself exits with 6. This is becuase the tool is executed in |
Ack, with
and with the new option it looks exactly the same:
Why would the tool run in (Note: I don't know what I am doing here -- meson is calling all of this behind the scenes normally) |
Ah, with
Why would it do that!? |
Because files are not found or can't be written by gov. Can you check the main branch? |
It even crashes that way with just I experimented a bit with |
Sure! I did
When I add the suggested |
FTR: this one gets close, but the source file is in |
In which directory was the compiler executed to build the object file? Can you try to run gcov on your own in this directory? |
Not sure if I understood your question correctly: But the reproducer (as in the issue description) runs in the |
Can you execute the gcov command from the verbose output in this working directory and check the output? |
I'm not 100% sure that you meant this, hence the full reproducer (in an F39 container or toolbox) from scratch:
fails with said
and /tmp/trace shows a bunch of successful calls, like
and the failed call which exits with 6:
calling this manually fails differently, though:
So, TBH I'm lost here.. |
The reproducer still fails, but oh well -- for now I can cling to only running gcovr on Ubuntu 22.04 LTS (gcovr version 5.0). |
Can you check the main branch? |
@martinpitt Any updates with the latest version? |
Sorry about the delay! Running this again from thin air, in
and inside:
that still fails with
and lots of similar errors. I again tried to run it directly with teh suggested option:
but that just fails again with the same "no working dir" error:
```
(INFO) Reading coverage data...
(ERROR) GCOV produced the following errors processing /tmp/umockdev/b/umockdev-record.p/meson-generated_src_umockdev-record.c.gcda:
In directory /tmp/umockdev:
Cannot open source file umockdev-record.c
Cannot open source file ../src/umockdev-record.vala
Cannot open source file glib-2.0.vapi
Cannot open source file umockdev-record.p/src/umockdev-record.c
Cannot open source file umockdev-record.c
Cannot open source file umockdev-record.c
Cannot open source file umockdev-record.c
Cannot open source file umockdev-record.c
Cannot open source file umockdev-record.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file ../src/libumockdev-preload.c
Stdout of gcov was >>File '/usr/include/unistd.h' File '../src/libumockdev-preload.c' File '/usr/include/sys/ioctl.h' File '/usr/include/stdio.h' File '/usr/include/sys/socket.h' File '/usr/include/stdlib.h' File '/usr/include/sys/inotify.h' File '/usr/include/fcntl.h' File '/usr/include/sys/statfs.h' File '/usr/include/bits/statx-generic.h' File '/usr/include/sys/xattr.h' File '/usr/include/sys/stat.h' File '/usr/include/dirent.h' Lines executed:77.79% of 770
Cannot open source file ../src/libumockdev-preload.c
Cannot open source file ../src/libumockdev-preload.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-utils.c
Cannot open source file umockdev-utils.c
Cannot open source file umockdev-utils.c
Cannot open source file umockdev-utils.c
Cannot open source file umockdev-utils.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file test-umockdev-record.c
Cannot open source file test-umockdev-record.c
Cannot open source file test-umockdev-record.c
Cannot open source file test-umockdev-record.c
Cannot open source file test-umockdev-record.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
./meson-generated_tests_test-umockdev-vala.c.gcda:cannot open data file, assuming not executed
test-umockdev-vala.p/meson-generated_tests_test-umockdev-vala.c.gcda:cannot op
9E88
en data file, assuming not executed
b/test-umockdev-vala.p/meson-generated_tests_test-umockdev-vala.c.gcda:cannot open data file, assuming not executed
umockdev/b/test-umockdev-vala.p/meson-generated_tests_test-umockdev-vala.c.gcda:cannot open data file, assuming not executed
tmp/umockdev/b/test-umockdev-vala.p/meson-generated_tests_test-umockdev-vala.c.gcda:cannot open data file, assuming not executed
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
Cannot open source file umockdev-ioctl.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
Cannot open source file umockdev-pcap.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-run.c
Cannot open source file umockdev-run.c
Cannot open source file umockdev-run.c
Cannot open source file umockdev-run.c
Cannot open source file umockdev-run.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev.c
Cannot open source file umockdev.c
Cannot open source file umockdev.c
Cannot open source file umockdev.c
Cannot open source file umockdev.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
./meson-generated_tests_test-umockdev-run.c.gcda:cannot open data file, assuming not executed
test-umockdev-run.p/meson-generated_tests_test-umockdev-run.c.gcda:cannot open data file, assuming not executed
b/test-umockdev-run.p/meson-generated_tests_test-umockdev-run.c.gcda:cannot open data file, assuming not executed
umockdev/b/test-umockdev-run.p/meson-generated_tests_test-umockdev-run.c.gcda:cannot open data file, assuming not executed
tmp/umockdev/b/test-umockdev-run.p/meson-generated_tests_test-umockdev-run.c.gcda:cannot open data file, assuming not executed
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
Cannot open source file umockdev-spi.c
To ignore this error use option --gcov-ignore-errors=no_working_dir_found.
|
I can reproduce it but I don't get how meson is working. I found out that the compiler is executed in the directory
The file In my opinion the file created by the compiler is wrong, the source file is given as Can you add the option |
I tried that: diff --git meson.build meson.build
index f77f7ea..a263aae 100644
--- meson.build
+++ meson.build
@@ -8,6 +8,7 @@ lib_version = '0.3.0'
add_project_arguments(
'-std=gnu11',
+ '-fprofile-abs-path',
'-Werror=missing-prototypes',
'-Werror=strict-prototypes',
'-Werror=nested-externs',
and with
but it doesn't make a difference 😢 , it still fails the same way. |
I see here that ccache is used. Can you try to build and run without using ccache? |
Sorry, I thought I sent that reply last week, but apparently it didn't come through -- |
This seems to be a gcov bug which can't be solved by gcovr. Even if the gcov tool is called in the correct directory the wrong path is written to the result file. Can you check the content of |
Closing because of no response. |
Describe the bug
The recent Fedora gcovr 5.2 update breaks with current meson. I noticed that in my umockdev project, which started to fail its tests a month ago. E.g. in this run there are now hundreds of errors:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Coverage report should work, like with 5.1 and earlier.
Desktop (please complete the following information):
Additional context
I originally reported this to Fedora in https://bugzilla.redhat.com/show_bug.cgi?id=2166960 , but was asked to report it upstream as well.
The text was updated successfully, but these errors were encountered: