linux-test-project / lcov

LCOV
GNU General Public License v2.0
866 stars 234 forks source link

lcov on x86 #292

Closed kush930 closed 3 weeks ago

kush930 commented 1 month ago

Hi all.

I cloned successfully from link: https://github.com/linux-test-project/lcov.git

I want to build on x86 machine, I followed all required steps.

kush@enlite:~/enlite/lcov$ sudo make install

make[3]: Leaving directory '/home/kush/enlite/lcov/tests/gendiffcov/errs'
make[2]: Leaving directory '/home/kush/enlite/lcov/tests/gendiffcov'
make[2]: Entering directory '/home/kush/enlite/lcov/tests/py2lcov'
  CLEAN   lcov/tests/py2lcov
make[2]: Leaving directory '/home/kush/enlite/lcov/tests/py2lcov'
make[2]: Entering directory '/home/kush/enlite/lcov/tests/perl2lcov'
  CLEAN   lcov/tests/perl2lcov
make[2]: Leaving directory '/home/kush/enlite/lcov/tests/perl2lcov'
make[2]: Entering directory '/home/kush/enlite/lcov/tests/xml2lcov'
  CLEAN   lcov/tests/xml2lcov
make[2]: Leaving directory '/home/kush/enlite/lcov/tests/xml2lcov'
make[1]: Leaving directory '/home/kush/enlite/lcov/tests'
  INSTALL /usr/local/etc/lcovrc
  done INSTALL

kush@enlite:~/enlite/lcov$ lcov

Can't locate Capture/Tiny.pm in @INC (you may need to install the Capture::Tiny module) (@INC contains: /usr/local/lib/lcov /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at /usr/local/lib/lcov/lcovutil.pm line 16.
BEGIN failed--compilation aborted at /usr/local/lib/lcov/lcovutil.pm line 16I want to build on my ubuntu os, I followed all required steps..
Compilation failed in require at /usr/local/bin/lcov line 102.
BEGIN failed--compilation aborted at /usr/local/bin/lcov line 102.

Can anyone help me to resolve this issue.

T&R lavkhush

henry2cox commented 1 month ago

Looks like your system is missing at least one perl module. README has some suggestions for how to install them.

lozanopo commented 1 month ago

Looks like your system is missing at least one perl module. README has some suggestions for how to install them.

2024-05-07 06-22-48

kush930 commented 1 month ago

Hi all,

Can anyone please help me to resolve this issue:-

kush@enlite:~/enlite/lcov$ sudo make test [sudo] password for kush:

Starting tests
genhtml/full.sh ................... [pass] (time 1.0s, mem 47.5MB)
genhtml/part1.sh .................. [pass] (time 0.4s, mem 47.3MB)
genhtml/part2.sh .................. [pass] (time 0.5s, mem 47.5MB)
genhtml/target.sh ................. [pass] (time 0.5s, mem 47.5MB)
genhtml/zero.sh ................... [pass] (time 0.5s, mem 47.1MB)
genhtml/demangle.sh ............... [pass] (time 1.3s, mem 38.7MB)
genhtml/relative/relative.sh ...... [pass] (time 0.6s, mem 38.8MB)
genhtml/lambda/lambda.sh .......... [pass] (time 5.7s, mem 121.9MB)
lcov/add/zero.sh .................. [pass] (time 0.3s, mem 38.7MB)
lcov/add/zero2.sh ................. [pass] (time 0.5s, mem 43.8MB)
lcov/add/full.sh .................. [pass] (time 0.3s, mem 39.0MB)
lcov/add/full2.sh ................. [pass] (time 0.5s, mem 43.8MB)
lcov/add/part.sh .................. [pass] (time 0.3s, mem 39.0MB)
lcov/add/part2.sh ................. [pass] (time 0.5s, mem 43.7MB)
lcov/add/concatenated4.sh ......... [pass] (time 0.6s, mem 38.8MB)
lcov/add/prune.sh ................. [pass] (time 0.7s, mem 35.1MB)
lcov/add/track.sh ................. [pass] (time 0.2s, mem 34.5MB)
lcov/diff/test.sh ................. [pass] (time 0.3s, mem 34.0MB)
lcov/misc/help.sh ................. [pass] (time 0.2s, mem 34.0MB)
lcov/misc/version.sh .............. [pass] (time 0.1s, mem 33.7MB)
lcov/summary/zero.sh .............. [pass] (time 0.3s, mem 39.0MB)
lcov/summary/full.sh .............. [pass] (time 0.3s, mem 38.8MB)
lcov/summary/target.sh ............ [pass] (time 0.3s, mem 38.6MB)
lcov/summary/part1.sh ............. [pass] (time 0.3s, mem 38.6MB)
lcov/summary/part2.sh ............. [pass] (time 0.3s, mem 39.1MB)
lcov/summary/concatenated.sh ...... [pass] (time 0.4s, mem 38.8MB)
lcov/summary/concatenated2.sh ..... [pass] (time 0.4s, mem 38.8MB)
lcov/extract/extract.sh ........... [fail] (time 9.5s, mem 49.10MB)
    Skipping 792 previous lines (see /home/kush/enlite/lcov/tests//test.log)
    ...
    Writing temporary data to /tmp/geninfo_datf2v0
    Scanning separate/run/my/test for .gcda files ...
    Found 1 data files in separate/run/my/test
    Message summary:
      1 error message:
        path: 1
    geninfo: ERROR: (path) cannot process .gcda file separate/run/my/test/a-extract.gcda because corresponding .gcno file 'separate/copy/extract.gcno' is missing (see the '--build-directory' entry in 'man geninfo' for suggestions).
        (use "geninfo --ignore-errors path ..." to bypass this error)
    Error:  extract with resolve-script failed
  EXITCODE ...: 1
lcov/demangle/demangle.sh ......... [pass] (time 2.8s, mem 49.9MB)
lcov/exception/exception.sh ....... [pass] (time 2.1s, mem 40.9MB)
lcov/gcov-tool/path.sh ............ [pass] (time 4.7s, mem 34.8MB)
lcov/branch/branch.sh ............. [pass] (time 1.3s, mem 48.7MB)
lcov/merge/merge.sh ............... [pass] (time 1.4s, mem 34.3MB)
lcov/format/format.sh ............. [pass] (time 1.8s, mem 34.3MB)
lcov/errs/errs.sh ................. [pass] (time 6.5s, mem 34.3MB)
gendiffcov/simple/script.sh ....... [pass] (time 35.6s, mem 54.8MB)
gendiffcov/filter/filter.pl ....... [pass] (time 0.5s, mem 32.8MB)
gendiffcov/function/function.sh ... [pass] (time 9.7s, mem 55.2MB)
...fcov/insensitive/insensitive.sh  [pass] (time 4.5s, mem 54.9MB)
...iffcov/synthesize/synthesize.sh  [pass] (time 3.5s, mem 54.9MB)
gendiffcov/errs/msgtest.sh ........ [pass] (time 18.7s, mem 55.0MB)
py2lcov/py2lcov.sh ................ [pass] (time 5.9s, mem 34.3MB)
perl2lcov/perltest1.sh ............ [pass] (time 10.8s, mem 69.5MB)
xml2lcov/xml2lcov.sh .............. [pass] (time 1.1s, mem 35.2MB)
44 tests executed, 43 passed, 1 failed, 0 skipped (time 139.7s, mem 1941.6MB)
Result log stored in /home/kush/enlite/lcov/tests/test.log

I am not getting exact idea to resolve this issue, whatever previous package related issue, I was getting those are resolved.

T&R lavkhush

henry2cox commented 1 month ago

Which platform and version? Which compiler and version? Which perl version? Which lcov version?

The easiest way to debug is likely to be:

$ cd ..../tests/lcov/extract
$ ./extract.sh -v  # run test with verbose printing

And see what command failed and what it was trying to do

kush930 commented 1 month ago

Hi henry2cox and all,

As per your suggestion, I executed command and got one issue, can you suggest me where i am doing wrong.

kush@enlite:~/enlite/lcov/tests/lcov/extract$ lcov --version
lcov: LCOV version 2.1-5.g6f8c8f2
kush@enlite:~/enlite/lcov/tests/lcov/extract$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
kush@enlite:~/enlite/lcov/tests/lcov/extract$ uname -a
Linux enlite 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
kush@enlite:~/enlite/lcov/tests/lcov/extract$ perl --version

This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi

kush@enlite:~/enlite/lcov/tests/lcov/extract$ sudo ./extract.sh -v
[sudo] password for kush: 
+ '[' 0 -gt 0 ']'
+ [[ x == x ]]
+ '[' -f ../../../bin/lcov ']'
+ LCOV_HOME=../../..
++ cd ../../..
++ pwd
+ LCOV_HOME=/home/kush/enlite/lcov
Message summary:
  no messages were reported
+ '[' 0 '!=' 0 ']'
+ /home/kush/enlite/lcov/bin/geninfo separate/run/my/test --branch-coverage --parallel 0 --profile --resolve-script ./fakeResolve.sh --resolve-script separate/copy/extract.gcno -o resolve.info
Found 8 cores.
Found gcov version: 11.4.0
Using intermediate gcov format
Recording 'internal' directories:
    /home/kush/enlite/lcov/tests/lcov/extract/separate/run/my/test
Writing temporary data to /tmp/geninfo_datT7bA
Scanning separate/run/my/test for .gcda files ...
Found 1 data files in separate/run/my/test
geninfo: ERROR: (path) cannot process .gcda file separate/run/my/test/a-extract.gcda because corresponding .gcno file 'separate/copy/extract.gcno' is missing (see the '--build-directory' entry in 'man geninfo' for suggestions).
    (use "geninfo --ignore-errors path ..." to bypass this error)
Message summary:
  1 error message:
    path: 1
+ '[' 0 '!=' 1 ']'
+ echo 'Error:  extract with resolve-script failed'
Error:  extract with resolve-script failed
+ '[' 0 == 0 ']'
+ exit 1

Can anyone help me to resolve this issue.

T&R lavkhush

henry2cox commented 1 month ago

Not sure why you are running as root. That seems...unwise.

The tool is looking for a file whose name is 'a-extract.gcno' (to match the file 'a-extract.gcda' which it found in your run directory. It was unable to find that file. You might want to run find . -name '*.gc*' from your run directory, to see where things are and whether your compiler generated the compile-time data file or not.

Note that when I run this test, the basename of the .o and the gcno/gcda is 'extract' (extract.o, extract.gcno, extract.gcda). From the data you provide: I cannot see where your apparent 'a-' prefix came from.

Should you want to debug issues with this tool - or any other tool - by yourself: consider that the test is mimicking your flow - in this case, compile/run tests/generate coverage. Think about what each step is trying to do. Check that each step did what it was supposed to do (e.g., by running it separately in your shell). If it didn't do what was expected - or you are unsure what it was supposed to do: look at error messages, read man pages, do some internet searches - and then ask for help when you really are stuck.

kush930 commented 1 month ago

Not sure why you are running as root. That seems...unwise.

The tool is looking for a file whose name is 'a-extract.gcno' (to match the file 'a-extract.gcda' which it found in your run directory. It was unable to find that file. You might want to run find . -name '*.gc*' from your run directory, to see where things are and whether your compiler generated the compile-time data file or not.

Note that when I run this test, the basename of the .o and the gcno/gcda is 'extract' (extract.o, extract.gcno, extract.gcda). From the data you provide: I cannot see where your apparent 'a-' prefix came from.

Should you want to debug issues with this tool - or any other tool - by yourself: consider that the test is mimicking your flow - in this case, compile/run tests/generate coverage. Think about what each step is trying to do. Check that each step did what it was supposed to do (e.g., by running it separately in your shell). If it didn't do what was expected - or you are unsure what it was supposed to do: look at error messages, read man pages, do some internet searches - and then ask for help when you really are stuck.

Hi henry2cox,

It was giving permission denied error, so I was running as root. Thanks for your suggestion, I will work on this.

T&R lavkhush

henry2cox commented 1 month ago

I'm attempting to clean up the issue list. There have been no updates in a while - so I guess that the issue is resolved or you no longer care about it. If it is resolved: then it would be good to update this issue so that anyone else who hits a similar issue can benefit.

I will go ahead and close this issue in a couple of days - unless there is something that still needs to be done here.

henry2cox commented 3 weeks ago

Closing this issue now. If there is still a problem, please feel free to reopen this issue or file a new one. Please describe the problem in detail and provide a testcase which illustrates the issue, if possible.