develooper Front page | perl.perl5.porters | Postings from September 2019

RE: [perl #134409] Perl intepreter exception on expressionsubstitution

Thread Previous | Thread Next
From:
Chris Crook
Date:
September 7, 2019 22:18
Subject:
RE: [perl #134409] Perl intepreter exception on expressionsubstitution
Message ID:
A87E66F06E86F14B857F2EB047CDF9323139A251@prdassexch01.ad.linz.govt.nz
Hi

Here is the log resulting from adding the logging and exception handler.  This is still on perl 5.22.1. Also with this exception handler in place the program continued to run after hitting the panic condition and appeared to complete correctly.

In the process of trying to create a useful test case I did notice that the panic is not triggered if I turn off taint checking.

I am trying to set up a useful test that I can provide you with on perl 5.30 but taking a while.

Regards
Chris
________________________________________
From: Dave Mitchell via RT [perlbug-followup@perl.org]
Sent: Friday, 6 September 2019 8:55 p.m.
To: Chris Crook
Subject: Re: [perl #134409] Perl intepreter exception on expression substitution

On Thu, Sep 05, 2019 at 05:04:14PM -0700, James E Keenan via RT wrote:
> > Perl raises exception on search and replace:
> >
> > panic: sv_pos_b2u: bad byte offset, blen=20, byte=27 at
> > lib/GDSearchSQLite.pm line 81

> > 81         $v =~ s/\{(\w+)\}/$lookup->{$1}/eg;
> > I am not able to provide a useful reproducible test case.

Can you replace the substitution line with something like the following?

    eval { $v =~ s/\{(\w+)\}/$lookup->{$1}/eg; };

    if ($@) {
        require Devel::Peek;
        Devel::Peek::Dump($v);
        Devel::Peek::Dump($1);
        Devel::Peek::Dump($lookup->{$1});
    }

Then if the panic is triggered, it should produce a low-level dump to
STDERR of the likely bad values.


--
"Procrastination grows to fill the available time"
    -- Mitchell's corollary to Parkinson's Law


________________________________

This message contains information, which may be in confidence and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.

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