develooper Front page | perl.perl5.porters | Postings from January 2017

Re: [perl #130561] Coredump in Perl_re_op_compile

Thread Previous | Thread Next
From:
demerphq
Date:
January 27, 2017 18:32
Subject:
Re: [perl #130561] Coredump in Perl_re_op_compile
Message ID:
CANgJU+XBxN_k5mMy0_c+Re2z9DTpJK1yvFExXfOpxwAsdGExaQ@mail.gmail.com
On 27 January 2017 at 19:04, Hugo van der Sanden via RT
<perlbug-followup@perl.org> wrote:
> On Fri, 27 Jan 2017 08:02:14 -0800, demerphq wrote:
>> On 27 January 2017 at 16:15, Hugo van der Sanden wrote:
>> > I'm not entirely sure that I have a use case, but what I had in mind
>> > was to modify the fixup loop as in your "this GOSUB may have been
>> > optimized away" change, but combine it with a regexec-time check &
>> > panic should we see a GOSUB that hasn't had its target set (which
>> > requires inventing a way to flag that). Failing that, we should at
>> > least have an assert at the point of fixup, for a clea[nr]er failure
>> > mode.
>>
>> If we do this in debug mode only then I see no harm.
>
> I had planned to make it a mandatory panic (not only under DEBUGGING), instead of the SEGV or worse you would otherwise get.
>
>> Can I leave that part to you?
>
> For now yes - I had already had a go at it (assuming I could set arg2=0 and test that for "not set") but got a bunch of test failures, which I haven't tried to dig into yet. If I can't use arg2, I might want to use flags - but as far as I can see we don't ever actually use those as flags, so some caution will be needed.

Wait wait. Are we talking about the same thing? I thought you were
talking about guarding the code that produced the SEGV with logic like
i posted in my GOSUB patch which I did not apply.

I think the bulk of that patch is fine to apply. I just don't see the
need to do those check except under debugging as we no longer optimise
away parens.

And really, the core idea of optimising a capturing paren is broken in
the face of recursion. You simply cannot do it. So basically we are
talking about adding guard code for a problem that should never occur.
IMO that means a DEBUGGING only feature.

Maybe I should just post the patch  I am thinking of then you can do
whatever you like on top, and then we get out of the game of broken
telephone. (Will that term ever be modernized I wonder?)

:-)

cheers,
Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About