Skip Menu |

This queue is for tickets about the Function-Parameters CPAN distribution.

Report information
The Basics
Id: 83439
Status: resolved
Priority: 0/
Queue: Function-Parameters

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.0101
Fixed in: 1.0101_01



Subject: 5 test files failing since ~perl 5.17.6

Not sure exactly which P5 commit introduces breakage, but here is the verbose test output of the tests that fail.

Also seen here: http://www.cpantesters.org/cpan/report/46ad8b34-70ed-11e2-a655-7466270fb964


prove -bvr t/eating_strict_error.t  t/foreign/Method-Signatures/error_interruption.t t/foreign/Method-Signatures/syntax_errors.t  t/foreign/MooseX-Method-Signatures/errors.t t/name.t
t/eating_strict_error.t ...........................
1..4
Failed 4/4 subtests
t/foreign/Method-Signatures/error_interruption.t .. No subtests run
t/foreign/Method-Signatures/syntax_errors.t ....... No subtests run
t/foreign/MooseX-Method-Signatures/errors.t .......
1..4
Failed 4/4 subtests
t/name.t ..........................................
1..12
ok 1
ok 2
ok 3
ok 4
ok 5 - faulty code doesn't load
ok 6
ok 7 - faulty code doesn't load
ok 8
ok 9 - faulty code doesn't load
ok 10
Failed 2/12 subtests

Test Summary Report
-------------------
t/eating_strict_error.t                         (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 4 tests but ran 0.
t/foreign/Method-Signatures/error_interruption.t (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: No plan found in TAP output
t/foreign/Method-Signatures/syntax_errors.t     (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: No plan found in TAP output
t/foreign/MooseX-Method-Signatures/errors.t     (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 4 tests but ran 0.
t/name.t                                        (Wstat: 11 Tests: 10 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 12 tests but ran 10.
Files=5, Tests=10,  1 wallclock secs ( 0.04 usr  0.01 sys +  0.21 cusr  0.04 csys =  0.30 CPU)
Result: FAIL

Did a git bisect and found the failures start at 9ffcdca1f504cb09088413c074b35af4b7f247e3

Hopefully this helps with diagnosis.


Author: Father Chrysostomos <sprout@cpan.org>  2012-11-13 20:04:16
Committer: Father Chrysostomos <sprout@cpan.org>  2012-11-13 21:01:37
Parent: 12d3c230bf3c96adcc0fd2c8d49888f2719d6781 (Stop anon subs with bad attributes from leaking)
Branches: many (44)
Follows: v5.17.5
Precedes: v5.17.6

    Don’t leak subs containing syntax errors
   
    I fixed this for BEGIN blocks earlier, but missed the fact that
    all subs are affected.
   
    When called without an o argument (from newANONATTRSUB), newATTRSUB
    is expected to return a CV with an unowned reference count of which
    the caller will take ownership.  We cannot have newATTRSUB returning
    a freed CV, so we have it return null instead.  But that means
    ck_anoncode and pm_runtime have to account for that.

------------------------------------- op.c -------------------------------------
index 3f71cff..b2801c7 100644
@@ -4650,7 +4650,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg, I32 floor)
 
         /* attach the anon CV to the pad so that
          * pad_fixup_inner_anons() can find it */
-        (void)pad_add_anon(cv, o->op_type);
+        if (cv) (void)pad_add_anon(cv, o->op_type);
         SvREFCNT_inc_simple_void(cv);
         }
         else {
@@ -7370,15 +7370,14 @@ Perl_newATTRSUB_flags(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
 
     if (ec) {
     op_free(block);
-    cv = PL_compcv;
+    SvREFCNT_dec(PL_compcv);
+    PL_compcv = 0;
     if (name && block) {
         const char *s = strrchr(name, ':');
         s = s ? s+1 : name;
         if (strEQ(s, "BEGIN")) {
         const char not_safe[] =
             "BEGIN not safe after errors--compilation aborted";
-        PL_compcv = 0;
-        SvREFCNT_dec(cv);
         if (PL_in_eval & EVAL_KEEPERR)
             Perl_croak(aTHX_ not_safe);
         else {
@@ -8176,6 +8175,9 @@ Perl_ck_anoncode(pTHX_ OP *o)
 {
     PERL_ARGS_ASSERT_CK_ANONCODE;
 
+    /* After errors, we won’t have any sub. */
+    if (!cSVOPo->op_sv) return o;
+
     cSVOPo->op_targ = pad_add_anon((CV*)cSVOPo->op_sv, o->op_type);
     if (!PL_madskills)
     cSVOPo->op_sv = NULL;


On Tue Feb 19 06:40:01 2013, KENTNL wrote: Show quoted text
> Did a git bisect and found the failures start at > 9ffcdca1f504cb09088413c074b35af4b7f247e3 > > Hopefully this helps with diagnosis.
Yes, thank you. I can reproduce this here. Sadly that's only half of the problem; there's another set of failures caused by interaction with OP slabs (which I don't understand yet). I'll take a look at this and hopefully I'll have a new release in the near future.