Skip to content

geninfo generates corrupted files #427

@matttbe

Description

@matttbe

Hello,

First, thank you for developing and maintaining this great tool!

I'm using it (v2.3.1) to generate code coverage for a part of the kernel.

The capture looks OK:

# lcov --capture --keep-going -j "${INPUT_CPUS}" \
     --rc geninfo_unexecuted_blocks=1 \
     --include '/net/mptcp/' \
     --function-coverage --branch-coverage \
     -b "${VIRTME_BUILD_DIR}" -o "${LCOV_FILE}"
  Auto-detecting gcov kernel support.
  Found upstream gcov kernel support at /sys/kernel/debug/gcov
  Copying data to temporary directory /tmp/zQjTEFYYXK
  Capturing coverage data from /tmp/zQjTEFYYXK
  geninfo cmd: '/usr/bin/geninfo /tmp/zQjTEFYYXK --toolname lcov --output-filename /home/runner/work/mptcp_net-next/mptcp_net-next/kernel.lcov --keep-going --base-directory /home/runner/work/mptcp_net-next/mptcp_net-next/.virtme/build --parallel 4 --branch-coverage --rc geninfo_unexecuted_blocks=1 --include /net/mptcp/'
  Found gcov version: 14.2.0
  Using intermediate gcov format
  Recording 'internal' directories:
  	/tmp/zQjTEFYYXK
  	/home/runner/work/mptcp_net-next/mptcp_net-next/.virtme/build
  Writing temporary data to /tmp/geninfo_datrewd
  Scanning /tmp/zQjTEFYYXK for .gcda files ...
  Found 20 data files in /tmp/zQjTEFYYXK
  using: chunkSize: 4, nchunks:5, intervalLength:1
  elapsed:0.0m: remaining:16 files 0.0m: 5.89 files/s 0.16 s/file (interval:5.89 f/s 0.16 s/f)
  elapsed:0.0m: remaining:12 files 0.0m: 11.60 files/s 0.16 s/file (interval:366.27 f/s 0.16 s/f)
  elapsed:0.0m: remaining:8 files 0.0m: 16.24 files/s 0.17 s/file (interval:81.78 f/s 0.17 s/f)
  elapsed:0.0m: remaining:4 files 0.0m: 17.03 files/s 0.18 s/file (interval:19.92 f/s 0.22 s/f)
  lcov: ERROR: (mismatch) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.h":600: mismatched exception tag for id 0, 0: '1' -> '0'
  lcov: ERROR: (mismatch) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.h":600: mismatched exception tag for id 0, 0: '1' -> '0'
  lcov: ERROR: (mismatch) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.h":659: mismatched exception tag for id 0, 0: '0' -> '1'
  lcov: ERROR: (mismatch) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.h":594: mismatched exception tag for id 4, 4: '0' -> '1'
  lcov: ERROR: (mismatch) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.h":594: mismatched exception tag for id 4, 4: '0' -> '1'
  lcov: ERROR: (mismatch) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.h":659: mismatched exception tag for id 0, 0: '0' -> '1'
  elapsed:0.0m: remaining:0 files 0.0m: 15.30 files/s 0.17 s/file (interval:10.89 f/s 0.14 s/f)
  Finished processing 20 GCDA files
  Apply filtering..
  Finished filter file processing
  Finished .info-file creation
  Summary coverage rate:
    source files: 22
    lines.......: 88.1% (7275 of 8260 lines)
    functions...: 92.4% (500 of 541 functions)
    branches....: 63.7% (3808 of 5975 branches)
  Message summary:
    6 error messages:
      mismatch: 6

Showing the stats no longer works:

$ lcov --branch-coverage --summary "${LCOV_FILE}"
 lcov: ERROR: (corrupt) unable to read trace file '/home/runner/work/mptcp_net-next/mptcp_net-next/kernel.lcov': lcov: ERROR: (inconsistent) "/home/runner/work/mptcp_net-next/mptcp_net-next/net/mptcp/protocol.c":2382: line is hit but no branches on line have been evaluated.
Reading tracefile /home/runner/work/mptcp_net-next/mptcp_net-next/kernel.lcov.
	To skip consistency checks, see the 'check_data_consistency' section in man lcovrc(5).
	(use "lcov --ignore-errors inconsistent ..." to bypass this error)
	(use "lcov --ignore-errors corrupt ..." to bypass this error)

Are these errors expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions