develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133131] Blead Breaks CPAN: Devel::Cover

Thread Previous | Thread Next
James E Keenan via RT
April 21, 2018 01:59
[perl #133131] Blead Breaks CPAN: Devel::Cover
Message ID:
On Fri, 20 Apr 2018 16:19:31 GMT, arc wrote:
> This is a bug report for perl from,
> generated with the help of perlbug 1.41 running under perl 5.27.11.
> -----------------------------------------------------------------
> [Please describe your issue here]
> Commit 7c114860c0fa8ade5e00a4b609d2fbd11d5a494c introduced an
> optimisation in pp_iter(). Before the optimisation, pp_iter() pushed
> either &PL_SV_yes or &PL_sv_no to the stack, and returned the op_next
> in the obvious way.
> The optimisation takes advantage of the fact that the op_next of an
> OP_ITER always points to an OP_AND node, so pp_iter() now directly
> jumps to either the op_next or the op_other of the OP_AND as
> appropriate. The commit message also says this:
> It's possible that some weird optree-munging XS module may break this
> assumption. For now I've just added asserts that the next op is OP_AND
> with an op_ppaddr of Perl_pp_and; if that assertion fails, it may be
> necessary to convert pp_iter()s' asserts into conditional statements.
> However, Devel::Cover does change the op_ppaddr of the ops it can see,
> so the assertions on op_ppaddr were being tripped when Devel::Cover
> was run under a -DDEBUGGING Perl. But even if the asserts didn't trip,
> skipping the OP_AND nodes would prevent Devel::Cover from determining
> branch coverage in the way that it wants.
> The attached patch converts the asserts into conditional statements,
> as outlined in the commit message above, and undoes the optimisation
> when the op_ppaddr doesn't match.
> With this change, tests pass for me on a DEBUGGING Perl (and allow the
> Devel::Cover tests to pass also). Tests also pass when the
> optimisation is fully disabled (so I have some confidence that my
> deoptimisation is working correctly). However, I'd be grateful for
> further review of the change — Dave, I'm hoping you're well placed to
> do that.
> I believe a fix for this issue should be applied despite the state of
> the freeze, so I will add this ticket to the 5.28 blockers.

I can confirm that Devel::Cover fails many tests when tested on a -DDEBUGGING build of blead.  Output like this:

t/e2e/aeval_merge_0.t .......
Dubious, test returned 134 (wstat 34304, 0x8600)
Failed 110/110 subtests
Cannot close ... blead/bin/perl -I./ -I./blib/lib -I./blib/arch -MDevel::Cover=-db,./t/e2e/cover_db_eval_merge_1/,-select,/tests/eval_merge_1\b,-ignore,blib,Devel/Cover,-merge,0,-coverage,statement,branch,condition,subroutine ./tests/eval_merge_1 :  at blib/lib/Devel/Cover/ line 185.
# Looks like your test exited with 134 before it could output anything.

A couple of weeks back I gave a talk at  In the discussion period, I remarked that, because Devel::Cover (along with Devel::NYTProf) digs deep into the Perl guts, we expect it to break at least once during each dev cycle.

Surprisingly, at least when built on non-DEBUGGING builds on Linux, Devel::Cover was graded PASS at each monthly dev release up thru 5.27.10.  (I hope to have 5.27.11 results within 2 days.)  But of course I don't do that testing on DEBUGGING builds.

Do you know whether any other major CPAN libraries break on DEBUGGING builds?

Thank you very much.

James E Keenan (

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About