Package: lcov
Version: 1.11-1
Severity: important

Dear Maintainer,


The new version of lcov broke the coverage builds in our C++ projects with 
errors related to destructors mapping to different lines.

Here is a small test case:

% cat foo.h
struct base
{
  virtual ~base();
};

struct sub: base
{
  virtual ~sub();
};
% cat foo.cc
#include <iostream>
#include "foo.h"

base::~base() { std::cerr << "base\n"; }
sub::~sub()   { std::cerr << "sub\n"; }
% cat main.cc
#include "foo.h"

int main()
{
   sub* s = new sub();
   delete s;
}
% g++ -O2 --coverage -Wall foo.cc main.cc -o main
% ./main
sub
base
% lcov --capture --directory . --output foo.info
Capturing coverage data from .
Found gcov version: 4.9.0
Scanning . for .gcda files ...
Found 2 data files in .
Processing foo.gcda
Processing main.gcda
Finished .info-file creation
% genhtml --legend --demangle-cpp --output-directory html foo.info
Reading data file foo.info
Found 4 entries.
Demangling 5 function names
genhtml: ERROR: Demangled function name _ZN3subD2Ev  maps to different lines (5 
vs 4)



I can see a couple of problems here, the first two being cosmetic:
1) the error message shows a mangled function name, but call it "Demangled"
2) the error message makes references to line number without giving the 
relevant file name
3) the actual error is that
     _ZN3subD2Ev, the base object version of sub::~sub() maps to foo.cc:4, while
     _ZN3subD0Ev, the deleting version of sub::~sub() maps to foo.cc:5.
   both symbols are demangled to sub::~sub().

The check that ensures that two demangled symbols map to the same line is new in
lcov 1.11.   On this example it's not clear to me whether the check is simply
wrong, or whether it is correct but something else has to be fixed to point
to the right line.  Anyway because this is reported as a hard error and no
html output is generated, it actually renders lcov unusable on our C++ projects.


Note that removing compiling with -O1 instead of -O2 makes the problem go away
in this simple case, but not in our actual projects.


Here is foo.info for reference.  Note the 'FN:4,_ZN3subD2Ev' and
'FN:5,_ZN3subD0Ev' lines.

TN:
SF:/usr/include/c++/4.9/iostream
DA:74,1
LF:1
LH:1
end_of_record
SF:/home/adl/t/foo.cc
FN:4,_ZN4baseD2Ev
FN:4,_ZN3subD2Ev
FN:4,_ZN4baseD0Ev
FN:5,_GLOBAL__sub_I__ZN4baseD2Ev
FN:5,_ZN3subD0Ev
FN:5,_Z41__static_initialization_and_destruction_0ii
FNDA:0,_ZN4baseD0Ev
FNDA:0,_ZN4baseD2Ev
FNDA:1,_GLOBAL__sub_I__ZN4baseD2Ev
FNDA:1,_Z41__static_initialization_and_destruction_0ii
FNDA:1,_ZN3subD0Ev
FNDA:1,_ZN3subD2Ev
FNF:6
FNH:4
DA:4,1
DA:5,6
LF:2
LH:2
end_of_record
TN:
SF:/home/adl/t/foo.h
DA:1,1
DA:6,1
LF:2
LH:2
end_of_record
SF:/home/adl/t/main.cc
FNDA:1,main
FNF:1
FNH:1
DA:3,1
DA:5,1
DA:7,1
LF:3
LH:3
end_of_record


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lcov depends on:
ii  gcc   4:4.9.0-3
ii  perl  5.18.2-4

Versions of packages lcov recommends:
ii  libgd-gd2-perl  1:2.46-3.1+b1

lcov suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to