Opened 3 years ago

Closed 3 years ago

#13365 closed defect (not a bug)

tor make coverage-html: lcov --capture errors out on "reached unexpected end of file"

Reported by: teor Owned by:
Priority: Medium Milestone:
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords:
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When I run tor's make coverage-html on a recent git version, I get an error:

Found 114 data files in .
Processing common/src_common_libor_crypto_testing_a-aes.gcda
geninfo: ERROR: ~/tor/tor-target/src/common/src_common_libor_crypto_testing_a-aes.gcno: reached unexpected end of file
make: * [coverage-html] Error 255

The relevant files are:

$ ls -l src/common/src_common_libor_crypto_testing_a-aes.*
-rw-r--r-- 1 ~ ~ 520 9 Oct 01:57 src/common/src_common_libor_crypto_testing_a-aes.gcda
-rw-r--r-- 1 ~ ~ 1764 9 Oct 01:55 src/common/src_common_libor_crypto_testing_a-aes.gcno
-rw-r--r-- 1 ~ ~ 12828 9 Oct 01:55 src/common/src_common_libor_crypto_testing_a-aes.o

This worked around August 30 with approximately the same build settings (I've tried several variations, none work.)

I think I've updated my compiler (clang) since then, but I've tried both versions:
Apple LLVM version 6.0 (clang-600.0.53) (based on LLVM 3.5svn)
clang version 3.6.0 (trunk 216817)

Maybe I'll need to update lcov:
$ port list lcov
lcov @1.11 devel/lcov

Any hints for debugging this?
(Sorry, Nick, I'm not going to be much help with chutney coverage until I get this solved.)

The full output of the failed command is as follows:


$ make coverage-html
/*/usr/bin/make all-am

test -e "which lcov" test -d "./coverage_html"
(echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
mkdir -p "./coverage_html"

lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
Deleting all .da files in ./src and subdirectories
Done.
/*/usr/bin/make reset-gcov
rm -f src/*/*.gcda
/*/usr/bin/make check
/*/usr/bin/make check-TESTS check-local
PASS: src/test/test
/*/usr/bin/make all-am
============================================================================
Testsuite summary for tor 0.2.6.0-alpha-dev
============================================================================
# TOTAL: 1
# PASS: 1
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
python ./src/test/test_cmdline_args.py ./src/or/tor-cov "."
............


Ran 12 tests in 0.685s

OK
python ./src/test/ntor_ref.py test-tor
OK
python ./src/test/ntor_ref.py self-test
OK
./src/test/test-bt-cl assert | python ./src/test/bt_test.py
OK
./src/test/test-bt-cl crash | python ./src/test/bt_test.py
OK
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "./coverage_html/lcov.tmp"
Capturing coverage data from .
Found gcov version: 4.9.1
Scanning . for .gcda files ...
Found 114 data files in .
Processing common/src_common_libor_crypto_testing_a-aes.gcda
geninfo: ERROR: ~/tor/tor-target/src/common/src_common_libor_crypto_testing_a-aes.gcno: reached unexpected end of file
make: * [coverage-html] Error 255

Child Tickets

Change History (2)

comment:1 Changed 3 years ago by nickm

Hm. Searching for lcov "unexpected end of file" turns up some suggestions, but I don't know what's up for sure.

(I don't use coverage-html myself so much: I mainly use the "coverage" script in ./scripts/test .)

For what it's worth, I just tried it on osx with the lcov from homebrew, and it worked okay for me.

comment:2 Changed 3 years ago by teor

Resolution: not a bug
Status: newclosed

I've identified the issue as a gcov version incompatibility - I had "mp-gcc49" selected using macports, but needed "apple-gcc42" to use /usr/bin/gcov

This is an issue in my toolchain.

Summary coverage rate:

lines......: 33.2% (16210 of 48859 lines)
functions..: 48.5% (1666 of 3437 functions)
branches...: 24.4% (9835 of 40369 branches)

Note: See TracTickets for help on using tickets.