Skip Menu |

This queue is for tickets about the Devel-CallParser CPAN distribution.

Report information
The Basics
Id: 88341
Status: resolved
Priority: 0/
Queue: Devel-CallParser

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

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



Subject: Pad corruption under threaded 5.18
Pad corruption under threaded 5.18.1 The following snippet shows a bad interaction between Devel::CallParser and the padrange optimisation: use Devel::CallParser; sub string { my ($i, $s, $t, $u); my $utf16; my $is_utf8; use Devel::Peek; Dump $utf16; Dump $is_utf8; } string(); (Snippet based on JSON::PP.) The output I get is SV = NULL(0x0) at 0x7fbdd98eaa48 REFCNT = 1 FLAGS = (PADMY) SV = NULL(0x0) at 0x7fbdd991d048 REFCNT = 1 FLAGS = (PADSTALE,PADMY) showing that the $is_utf8 variable is still stale. Perl commit 7601007 fixes this. The padrange optimisation assumed that the pad offsets for $u and $utf16 were contiguous. Devel::CallParser, in creating an rv2cv op, (which gets a gvop kid in ck_rvconst, which is a padop under threads) extends the pad. Named pad entries are always added at the end. So there is a hole in between $u and $utf16. You might want to consider working around this by using av_fill() on the pad to shrink it back to its former size when declining to handle the keyword. I don’t know whether that will cause other problems. I don’t *think* so. This workaround will only be necessary for 5.18.0 (or whichever dev release introduced padrange) to 5.19.3.
Worked around in Devel-CallParser-0.002, now on CPAN.