drcov2lcov output empty coverage.info

47 views
Skip to first unread message

kf c

unread,
Mar 21, 2023, 10:28:36 PM3/21/23
to DynamoRIO Users
I just built latest dynamorio(commit 32cfe87d92c699875b5b735fc1f163b0cc168f86) in Linux with configure command `cmake -B build -DDEBUG=ON -DCMAKE_INSTALL_PREFIX=/my/custom/path`.

However, I get empty coverage.info with following example when following https://dynamorio.org/page_drcov.html.
```c++
// test.cpp
#include <iostream>
using namespace std;

int foo(int x){
  return x + 1;
}

int bar(int y){
  return y - 1;
}

int main(int argc){
  cout << "hello " << foo(argc) << endl;
  if(argc > 2){
    cout << "arg num " << bar(argc + 1) << endl;
  }
  return 0;
}
```
Then I run these commands in the shell
```shell
$ clang++ -g test.cpp -o test
$ bin64/drrun  -t drcov -- ./test # generate non-empty drcov.test.84979.0000.proc.log
$ tools/bin64/drcov2lcov -input drcov.test.84979.0000.proc.log -verbose 3
# generate empty coverage.info file, why?
```
And here is output log of `drcov2lcov`
```
[DRCOV2LCOV] INFO(2):    Input file: /home/ckf104/install/dynamorio/drcov.test.84979.0000.proc.log
[DRCOV2LCOV] WARNING(1): No output file name specified: using default coverage.info
[DRCOV2LCOV] INFO(2):    Output file: /home/ckf104/install/dynamorio/coverage.info
[DRCOV2LCOV] INFO(1):    Reading input files...
[DRCOV2LCOV] INFO(2):    Reading drcov log file: /home/ckf104/install/dynamorio/drcov.test.84979.0000.proc.log
[DRCOV2LCOV] INFO(3):    Reading file header...
[DRCOV2LCOV] INFO(3):    Reading module table...
[DRCOV2LCOV] INFO(3):    module table 0x175bcc0, 4096
[DRCOV2LCOV] INFO(3):    module table 0x175bf60, 4096
[DRCOV2LCOV] INFO(3):    module table 0x175c200, 4096
[DRCOV2LCOV] INFO(3):    module table 0x175c4a0, 8192
[DRCOV2LCOV] INFO(3):    module table 0x175c940, 4096
[DRCOV2LCOV] INFO(3):    module table 0x175cca0, 122880
[DRCOV2LCOV] INFO(3):    module table 0x1760970, 32768
[DRCOV2LCOV] INFO(3):    module table 0x1761a40, 12288
[DRCOV2LCOV] INFO(3):    module table 0x1762110, 8192
[DRCOV2LCOV] INFO(3):    module table 0x17626c0, 139264
[DRCOV2LCOV] INFO(3):    module table 0x1766b90, 1343488
[DRCOV2LCOV] INFO(3):    module table 0x1766c50, 311296
[DRCOV2LCOV] INFO(3):    module table 0x1770520, 40960
[DRCOV2LCOV] INFO(3):    module table 0x17719f0, 53248
[DRCOV2LCOV] INFO(3):    module table 0x17734c0, 651264
[DRCOV2LCOV] INFO(3):    module table 0x1787390, 872448
[DRCOV2LCOV] INFO(3):    module table 0x17a1e60, 8192
[DRCOV2LCOV] INFO(3):    module table 0x17a2330, 12288
[DRCOV2LCOV] INFO(3):    module table 0x17a2a00, 69632
[DRCOV2LCOV] INFO(3):    module table 0x17a4cd0, 12288
[DRCOV2LCOV] INFO(3):    module table 0x17a53a0, 8192
[DRCOV2LCOV] INFO(3):    module table 0x17a5870, 561152
[DRCOV2LCOV] INFO(3):    module table 0x17b6b10, 704512
[DRCOV2LCOV] INFO(3):    module table 0x17cc3b0, 253952
[DRCOV2LCOV] INFO(3):    module table 0x17d4090, 65536
[DRCOV2LCOV] INFO(1):    Enumerating line info...
[DRCOV2LCOV] INFO(3):    Enumerate line info for /home/ckf104/install/dynamorio/test
[DRCOV2LCOV] INFO(3):    Enumerate line info for /home/ckf104/install/dynamorio/test
[DRCOV2LCOV] INFO(3):    Enumerate line info for /home/ckf104/install/dynamorio/test
[DRCOV2LCOV] INFO(3):    Enumerate line info for /home/ckf104/install/dynamorio/test
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/ld-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/ld-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/ld-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/ld-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for [vdso]
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for [vdso]
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libc-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libc-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libc-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libc-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libm-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libm-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libm-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libm-2.28.so
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] INFO(3):    Enumerate line info for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] WARNING(1): Failed to enumerate lines for /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
[DRCOV2LCOV] INFO(1):    Writing output file...
[DRCOV2LCOV] INFO(2):    Writing output lcov file: /home/ckf104/install/dynamorio/coverage.info
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0x175bcc0
[DRCOV2LCOV] INFO(3):    Delete module table 0x175bf60
[DRCOV2LCOV] INFO(3):    Delete module table 0x175c200
[DRCOV2LCOV] INFO(3):    Delete module table 0x175c4a0
[DRCOV2LCOV] INFO(3):    Delete module table 0x175c940
[DRCOV2LCOV] INFO(3):    Delete module table 0x175cca0
[DRCOV2LCOV] INFO(3):    Delete module table 0x1760970
[DRCOV2LCOV] INFO(3):    Delete module table 0x1761a40
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0xffffffffffffffff
[DRCOV2LCOV] INFO(3):    Delete module table 0x1762110
[DRCOV2LCOV] INFO(3):    Delete module table 0x17626c0
[DRCOV2LCOV] INFO(3):    Delete module table 0x1766b90
[DRCOV2LCOV] INFO(3):    Delete module table 0x1766c50
[DRCOV2LCOV] INFO(3):    Delete module table 0x1770520
[DRCOV2LCOV] INFO(3):    Delete module table 0x17719f0
[DRCOV2LCOV] INFO(3):    Delete module table 0x17734c0
[DRCOV2LCOV] INFO(3):    Delete module table 0x1787390
[DRCOV2LCOV] INFO(3):    Delete module table 0x17a1e60
[DRCOV2LCOV] INFO(3):    Delete module table 0x17a2330
[DRCOV2LCOV] INFO(3):    Delete module table 0x17a2a00
[DRCOV2LCOV] INFO(3):    Delete module table 0x17a4cd0
[DRCOV2LCOV] INFO(3):    Delete module table 0x17a53a0
[DRCOV2LCOV] INFO(3):    Delete module table 0x17a5870
[DRCOV2LCOV] INFO(3):    Delete module table 0x17b6b10
[DRCOV2LCOV] INFO(3):    Delete module table 0x17cc3b0
[DRCOV2LCOV] INFO(3):    Delete module table 0x17d4090
```

sharma...@google.com

unread,
Mar 23, 2023, 10:41:30 AM3/23/23
to DynamoRIO Users
Hi,
I was able to reproduce this issue on  my workstation too. Could you please file an issue at https://github.com/DynamoRIO/dynamorio/issues and someone will take a look.

Thanks,
Abhinav

sharma...@google.com

unread,
Mar 23, 2023, 11:05:55 AM3/23/23
to DynamoRIO Users
I created https://github.com/DynamoRIO/dynamorio/issues/5926 with some more details.

sharma...@google.com

unread,
Apr 18, 2023, 3:28:45 PM4/18/23
to DynamoRIO Users
We found that this is because g++-11+ produces DWARFv5 output which is not yet supported in elftoolchain. So our https://github.com/DynamoRIO/dynamorio/issues/5926 is blocked on  https://sourceforge.net/p/elftoolchain/tickets/611/.

A possible workaround is to use g++ older than v11, or specify "-gdwarf-4" to g++/gcc when compiling the target executable.

Abhinav

Reply all
Reply to author
Forward
0 new messages