Subject: | "malformed JSON string" errors when gcov2perl is ran for XS distributions |
When trying to run "cover -test" from any distribution that contains XS
code, gcov2perl fails with a "malformed JSON string", and the reports
aren't generated. The first version of Devel::Cover that shows this
issue is 0.75.
I've attached a simple XS distribution that replicates the problem.
Thanks.
Vincent Pit.
============================================================
$ cover5.14.1-64 --version
/home/vince/perl/builds/bin/cover5.14.1-64 version 0.79
$ perl5.14.1-64 Makefile.PL
...
$ make
...
$ cover5.14.1-64 -test
Deleting database /home/vince/perl/Wut/cover_db
Use of uninitialized value $ENV{"DEVEL_COVER_TEST_OPTS"} in
concatenation (.) or string at
/home/vince/perl/builds/bin/cover5.14.1-64 line 209.
cover: running make test "OPTIMIZE=-O0 -fprofile-arcs -ftest-coverage"
"OTHERLDFLAGS=-fprofile-arcs -ftest-coverage"
cc -c -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O0 -fprofile-arcs -ftest-coverage
-DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC
"-I/home/vince/perl/builds/64/5.14.1/lib/5.14.1/x86_64-linux/CORE" Wut.c
rm -f blib/arch/auto/Wut/Wut.so
cc -shared -march=core2 -O3 -fomit-frame-pointer -ftree-vectorize
-ftree-vectorizer-verbose=1 -pipe -DNDEBUG -L/usr/local/lib
-fstack-protector Wut.o -fprofile-arcs -ftest-coverage -o
blib/arch/auto/Wut/Wut.so \
\
chmod 755 blib/arch/auto/Wut/Wut.so
PERL_DL_NONLAZY=1 /home/vince/perl/builds/64/5.14.1/bin/perl5.14.1
"-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib',
'blib/arch')" t/*.t
t/try.t .. ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.20 cusr
0.01 csys = 0.23 CPU)
Result: PASS
cover: running gcov -abc -o . Wut.c
File 'Wut.c'
Lines executed:93.33% of 15
Branches executed:100.00% of 3
Taken at least once:33.33% of 3
No calls
Wut.c:creating 'Wut.c.gcov'
File 'Wut.xs'
Lines executed:100.00% of 2
Branches executed:100.00% of 3
Taken at least once:66.67% of 3
No calls
Wut.xs:creating 'Wut.xs.gcov'
cover: running gcov -abc -o . Wut.xs
File 'Wut.c'
Lines executed:93.33% of 15
Branches executed:100.00% of 3
Taken at least once:33.33% of 3
No calls
Wut.c:creating 'Wut.c.gcov'
File 'Wut.xs'
Lines executed:100.00% of 2
Branches executed:100.00% of 3
Taken at least once:66.67% of 3
No calls
Wut.xs:creating 'Wut.xs.gcov'
cover: running gcov2perl -db /home/vince/perl/Wut/cover_db Wut.xs.gcov
gcov2perl: Writing coverage database to
/home/vince/perl/Wut/cover_db/runs/1312720103.12867.12875
Reading database from /home/vince/perl/Wut/cover_db
found cover.12 in
/home/vince/perl/Wut/cover_db/runs/1312720103.12867.12875 at
/home/vince/perl/builds/64/5.14.1/lib/site_perl/5.14.1/x86_64-linux/Devel/Cover/DB.pm
line 192.
Devel::Cover: /home/vince/perl/Wut/cover_db/runs/1312720103.12867.12875
is an invalid database
malformed JSON string, neither array, object, number, string or atom, at
character offset 0 (before "pst0\x{5}\a\x{3}\x{0}...") at
/home/vince/perl/builds/64/5.14.1/lib/site_perl/5.14.1/x86_64-linux/Devel/Cover/DB/IO/JSON.pm
line 33
============================================================
Subject: | Wut-0.01.tar.gz |
Message body not shown because it is not plain text.