-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion failure in Perl_regexec_flags (regexec.c:3806) #16876
Comments
From @dur-randirCreated by @dur-randirWhile fuzzing perl v5.29.8-21-gde59f38ed9 built with afl and run 00000000 73 2c 40 30 01 7c 40 30 28 3f 7b 73 00 00 01 00 |s,@0.|@0(?{s....| to cause an assertion failure: perl: regexec.c:3514: Perl_regexec_flags: Assertion `prog->intflags & GDB stack trace is following #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 Bisecting it was quite funny - it's present from 5.18 onwards, but commit 5585e75 rework perl #129903 - inf recursion from use of empty pattern in FC didn't like my previous patch for this issue, so here is the The basic problem is that code like this: /(?{ s!!! })/ can trigger Perl Info
|
From @hvdsFWIW, it doesn't need any funny characters, it reproduces just fine with eg: Without //g, we hit a different assert: The inner subst needs an empty match: The target SV needs to require upgrade to string: I _think_ we're hitting the inner subst, finding a match, then deciding "oops, needed to upgrade the target, let's do that and try again". I'm not quite sure why we do that, but it's possible that *both* substs are remembering the need to do that, and then tripping over each other. It's all confusing me mightily; I'll try to dig some more tomorrow, but hope that the details above might trigger a thought in someone. Hugo |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Wed, Mar 27, 2019 at 12:04:21PM -0700, Hugo van der Sanden via RT wrote:
The SV becomes SvPOKp() (and PVIV) from the SvPV_nomg() in the outer I thought it might be because the inner subst reallocates the PV (to The debugging output is confusing: EXECUTING... Matching REx " x | (?{ s{}{x} }) " against "0" Note that all of the inner replacements except for the first one Tony |
Migrated from rt.perl.org#133906 (status was 'open')
Searchable as RT133906$
The text was updated successfully, but these errors were encountered: