Skip Menu |

This queue is for tickets about the Object-Pad CPAN distribution.

Report information
The Basics
Id: 132911
Status: resolved
Priority: 0/
Queue: Object-Pad

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.30
Fixed in: 0.31



Subject: debugperl "panic: pad_sv po"
When running on 5.20.3 -DDEBUGGING, even when using the fixed newSVOP_CUSTOM() from hax/perl-additions.c.inc, every unit test still fails with: t/01method.t .................... 1/? panic: pad_sv po at lib/Object/Pad.xs line 597. This puts it somewhere within the generated INITSLOTS method. By using gdb + `break Perl_vcroak` (thanks ilmari for the hint), I get: Breakpoint 1, Perl_vcroak (pat=0x55555576e538 "panic: pad_sv po", args=args@entry=0x7fffffffdd58) at util.c:1639 1639 SV *ex = with_queued_errors(pat ? vmess(pat, args) : mess_sv(ERRSV, 0)); (gdb) bt #0 Perl_vcroak (pat=0x55555576e538 "panic: pad_sv po", args=args@entry=0x7fffffffdd58) at util.c:1639 #1 0x000055555562f7bc in Perl_croak (pat=pat@entry=0x55555576e538 "panic: pad_sv po") at util.c:1686 #2 0x00005555555f01e4 in Perl_pad_sv (po=0) at pad.c:1444 #3 0x00005555556adef0 in Perl_pp_push () at pp.c:5199 #4 0x000055555562db0a in Perl_runops_debug () at dump.c:2426 #5 0x00005555555a35dd in Perl_call_sv (sv=0x5555560464e8, flags=<optimized out>) at perl.c:2760 #6 0x00005555555a408c in Perl_call_method (methname=methname@entry=0x7ffff76112e8 "INITSLOTS", flags=flags@entry=1) at perl.c:2675 #7 0x00007ffff76077a8 in injected_constructor (cv=<optimized out>) at lib/Object/Pad.xs:880 #8 0x0000555555660ab4 in Perl_pp_entersub () at pp_hot.c:2794 #9 0x000055555562db0a in Perl_runops_debug () at dump.c:2426 #10 0x00005555555ace67 in S_run_body (oldscope=1) at perl.c:2460 #11 perl_run (my_perl=<optimized out>) at perl.c:2376 #12 0x0000555555581ff2 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at perlmain.c:114 -- Paul Evans
Turns out: OP_PUSH generally requires a TARG, but chooses not to use it when in G_VOID context. Since we always invoke our custom one in G_VOID here we never saw it complain, but debugperl is more sensitive. Fixed in source; will be in next release. -- Paul Evans
Subject: rt132911.patch
=== modified file 'lib/Object/Pad.xs' --- old/lib/Object/Pad.xs 2020-06-27 23:24:37 +0000 +++ new/lib/Object/Pad.xs 2020-06-30 12:49:41 +0000 @@ -640,6 +640,14 @@ ops = op_append_list(OP_LINESEQ, ops, op_convert_list(OP_PUSH, OPf_WANT_VOID, itemops)); + + if(!itemops->op_targ) { + /* op_convert_list ought to have allocated a pad temporary for push, but + * it didn't. Technically only -DDEBUGGING perls will notice this, + * because OP_PUSH in G_VOID doesn't use its targ, but it's polite to + * provide one all the same. */ + itemops->op_targ = pad_alloc(itemops->op_type, SVs_PADTMP); + } } SvREFCNT_inc(PL_compcv);
Fixed in 0.31 -- Paul Evans