On Wed Apr 29 12:07:25 2015, hv wrote: > On Wed Apr 29 04:14:52 2015, davem wrote: > > I can't reproduce the failure with the original code (no assertion > > failure; valgrind and ASan ok). > > I can, with a plain build of blead. Most of the original code is red > herrings, I was able to reduce it to this: > > % ./miniperl -e '@a = qw{x y}; for (@a) { s{.}{}go =~ @b }' > miniperl: sv.c:2964: Perl_sv_2pv_flags: Assertion `((svtype)((sv)- > >sv_flags & 0xff)) != SVt_PVAV && ((svtype)((sv)->sv_flags & 0xff)) != > SVt_PVHV && ((svtype)((sv)->sv_flags & 0xff)) != SVt_PVFM' failed. > Aborted (core dumped) > % > > Are you able to reproduce it that way? If not I may be able to make > some time to dig more over the weekend. The problem seems to be this code in pp_regcomp: /* can't change the optree at runtime either */ /* PMf_KEEP is handled differently under threads to avoid these problems */ if (!RX_PRELEN(PM_GETRE(pm)) && PL_curpm) pm = PL_curpm; if (pm->op_pmflags & PMf_KEEP) { pm->op_private &= ~OPpRUNTIME; /* no point compiling again */ cLOGOP->op_first->op_next = PL_op->op_next; } before this starts pm point at the match op and PL_curpm points at the subst op. RX_PRELEN() is zero for rx, so pm is updated, and since the subst has the /o flag (PMf_KEEP) the op tree is rewritten to skip the regcomp for the second time around the loop, leaving the raw AV on the stack as the regexp for pp_match. Hugo's example doesn't need the /g flag: $ ./miniperl -e '@a = qw{x y}; for (@a) { s{.}{}o =~ @b }' miniperl: sv.c:2964: Perl_sv_2pv_flags: Assertion `((svtype)((sv)->sv_flags & 0xff)) != SVt_PVAV && ((svtype)((sv)->sv_flags & 0xff)) != SVt_PVHV && ((svtype)((sv)->sv_flags & 0xff)) != SVt_PVFM' failed. Aborted Tested on a non-threaded perl. Tony --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=124368Thread Previous | Thread Next