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

lcov: ERROR: no valid records found in tracefile #36

Open
numairmansur opened this issue Jul 6, 2018 · 11 comments
Open

lcov: ERROR: no valid records found in tracefile #36

numairmansur opened this issue Jul 6, 2018 · 11 comments
Assignees

Comments

@numairmansur
Copy link

I followed the instructions given in the workflow section. Running afl-cov gives me following error:

$ afl-cov -d /home/numair/Documents/faultlocalization/evaluation/RealWorld/AFL-FUZZING/findings --live --coverage-cmd "cat AFL_FILE | LD_LIBRARY_PATH=./lib/.libs ./bin/.libs/somebin -a -b -c" --code-dir .
[-] Sleep for 60 seconds for AFL fuzzing directory to be created...
    
*** Imported 2 new test cases from: /home/numair/Documents/faultlocalization/evaluation/RealWorld/AFL-FUZZING/findings/queue

    [+] AFL test case: id:000000,orig:test1.txt (0 / 2), cycle: 0
lcov: ERROR: no valid records found in tracefile /home/numair/Documents/faultlocalization/evaluation/RealWorld/AFL-FUZZING/findings/cov/lcov/id:000000,orig:test1.txt.lcov_info
Traceback (most recent call last):
  File "/usr/bin/afl-cov", line 724, in <module>
    sys.exit(main())
  File "/usr/bin/afl-cov", line 72, in main
    return not process_afl_test_cases(gpaths, cargs)
  File "/usr/bin/afl-cov", line 140, in process_afl_test_cases
    gen_coverage(gpaths, cov_paths, f, cargs)
  File "/usr/bin/afl-cov", line 447, in gen_coverage
    + cov_paths['lcov_info_final'], cargs, WANT_OUTPUT)
  File "/usr/bin/afl-cov", line 536, in run_cmd
    out = subprocess.check_output(cmd.split())
  File "/usr/lib/python2.7/dist-packages/subprocess32.py", line 635, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess32.CalledProcessError: Command '['lcov', '--rc', 'lcov_branch_coverage=1', '--no-checksum', '-r', '/home/numair/Documents/faultlocalization/evaluation/RealWorld/AFL-FUZZING/findings/cov/lcov/id:000000,orig:test1.txt.lcov_info', '/usr/include/*', '--output-file', '/home/numair/Documents/faultlocalization/evaluation/RealWorld/AFL-FUZZING/findings/cov/lcov/id:000000,orig:test1.txt.lcov_info_final']' returned non-zero exit status 255

What am I doing wrong ?

@mrash mrash self-assigned this Aug 18, 2018
@mrash
Copy link
Owner

mrash commented Dec 29, 2018

I’ve just released 0.6.2 - any chance you could try to reproduce this with that version? Thanks.

@saahil
Copy link

saahil commented Jan 15, 2019

I can confirm that this problem still exists with 0.6.2, albeit in a slightly different way.
Unlike the older versions, the lcov errors are also spit out with afl-cov so one doesn't need to run the culprit lcov command to see what the problem was.

Anyway, the problem seems to be still the same - for some reason trace.lcov_info is always empty while trace.lcov_base has at least some of the coverage information. As a result of lcov not being able to read trace.lcov_info it also cannot generate trace.lcov_info_final which is what afl-cov is trying to read.

I can't understand or solve why lcov_info is not being populated with any of the afl-cov versions :( Any hints would be really appreciated.

Thanks @mrash !

@zhangysh1995
Copy link

Hi guys, you need to change arguments in this part "cat AFL_FILE | LD_LIBRARY_PATH=./lib/.libs ./bin/.libs/somebin -a -b -c". This refers to the binary with coverage, which you want to test.

@NikParam42
Copy link

Hi guys, you need to change arguments in this part "cat AFL_FILE | LD_LIBRARY_PATH=./lib/.libs ./bin/.libs/somebin -a -b -c". This refers to the binary with coverage, which you want to test.

how exactly, I do not understand what this argument is ( even after reading the readme)

@zhangysh1995
Copy link

cat AFL_FILE should not be changed,
LD_LIBRARY_PATH=xxx is the library path (you may don't need it),
./bin/xxx/your_binary -a -b -c is the arguments that you use on AFL after the --.

@jdwoolc
Copy link

jdwoolc commented Mar 6, 2020

I am having the same problem. My program is successfully being fuzzed, afl-cov is running and I'm getting this message amongst the errors:

lcov: ERROR: no valid records found in tracefile ../fuzzgoat/out/cov/lcov/trace.lcov_info

It appears that the trace.lcov_info file is not getting populated correctly (the trace.lcov_base file is though, so somethings working).

Ideas?

@zhangysh1995
Copy link

@jdwoolc How is the result with the hints I gave earlier in this thread? Make sure you pass the binary with coverage support only (you don't need the one instrumented with AFL). Should you also check the binary itself runs normally. Hope this help!

@shafiuzzaman-md
Copy link

@zhangysh1995 Thanks. It works.

@ssen95
Copy link

ssen95 commented Aug 4, 2022

I still seem to be getting the errors below. Any guidance would be appreciated.
lcov: ERROR: no valid records found in tracefile /tmp/fuzzgoat/out//cov/lcov/trace.lcov_base
Non-zero exit status '255' for CMD: /usr/bin/lcov --no-checksum -r /tmp/tmp0a25Nx /usr/include/* --output-file /tmp/fuzzgoat/out//cov/lcov/trace.lcov_info_final

gcc version: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
lcov: LCOV version 1.13
afl-cov version: afl-cov-0.6.2
Using afl-gcc from afl++ github repo to compile to run with afl-fuzz

cmd to run afl-cov: ./afl-cov -d /tmp/fuzzgoat/out/ --live --coverage-cmd "./dir/fuzzgoat_inst -f AFL_FILE @@" --code-dir ./dir
cmd to run fuzzer: afl-fuzz -i in -o out ./out/fuzzgoat_inst @@

@kramer1985
Copy link

Hi,
I installed the version 1.15 and I still have this issue:
lcov: ERROR: no valid records found in tracefile /home/xxxx/workspace/smp-tfs/.build-ws/lcov/data/init/smp-tfs-lib.info.raw
Any help ?

@vasudev-kini-wdc
Copy link

This is happening for flutter as well with flutter test --coverage && lcov --ignore-errors empty -r coverage/lcov.info -o coverage/lcov_cleaned.info Any help?

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

10 participants