-
Notifications
You must be signed in to change notification settings - Fork 575
Perl intepreter exception on expression substitution #17146
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
Comments
From ccrook@linz.govt.nzCreated by ccrook@linz.govt.nzPerl raises exception on search and replace: panic: sv_pos_b2u: bad byte offset, blen=20, byte=27 at lib/GDSearchSQLite.pm line 81 75 sub SubstituteSql Note: this is old code buried fairly deeply in CGI web source. I was able dump the inputs I was able to work around this by replacing line 81 with the following lines (which 80 while( my($k1,$v1)=each(%$lookup) ) Below: test code with offending input doesn't reproduces issue: use Data::Dumper; $sql = { sub SubstituteSql print Dumper(SubstituteSql($sql,$lookup)),"\n"; Perl Info
|
From @jkeenanOn Thu, 05 Sep 2019 20:37:32 GMT, ccrook@linz.govt.nz wrote:
As you probably can guess, this is going to make it difficult for us to diagnose your problem. In addition, your ticket suggests that you were using perl 5.22.1. That's out of support. Can you reproduce this problem using either perl-5.30 or a git checkout of the Perl 5 core distribution?
-- |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Fri, 06 Sep 2019 00:04:13 GMT, jkeenan wrote:
Also, I searched for 'GDSearchSQLite' in both DDG and the big internet search thing -- and came up with nothing significant. Is this code publicly available?
-- |
From @iabynOn Thu, Sep 05, 2019 at 05:04:14PM -0700, James E Keenan via RT wrote:
Can you replace the substitution line with something like the following? eval { $v =~ s/\{(\w+)\}/$lookup->{$1}/eg; }; if ($@) { Then if the panic is triggered, it should produce a low-level dump to -- |
From ccrook@linz.govt.nzHi 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 On Thu, Sep 05, 2019 at 05:04:14PM -0700, James E Keenan via RT wrote:
Can you replace the substitution line with something like the following? eval { $v =~ s/\{(\w+)\}/$lookup->{$1}/eg; }; if ($@) { Then if the panic is triggered, it should produce a low-level dump to -- ________________________________ 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. |
From ccrook@linz.govt.nzHi James Thanks for your quick response - always amazes me how well supported these tools are. I couldn't spot current supported perl versions on the website. I am using 5.22.1 whcih is current default on ubuntu 16.04. The problem originally showed on ubuntu 18.04, perl version info below. This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi I'm not surprised you couldn't find the GDSearchSQLite anywhere (would have been surprised if you could). I'll try and build a smaller test case/data set and then see if I can still reproduce it. Next week I expect. Thanks -----Original Message----- On Fri, 06 Sep 2019 00:04:13 GMT, jkeenan wrote:
Also, I searched for 'GDSearchSQLite' in both DDG and the big internet search thing -- and came up with nothing significant. Is this code publicly available?
-- ________________________________ 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. |
From @iabynOn Sat, Sep 07, 2019 at 07:14:51PM +0000, Chris Crook wrote:
Can you give me the output with he following updated instrumentation: use Devel::Peek; if ($@) { or even better, if the loop isn't hit too many times: use Devel::Peek; if ($@) { So I can get an accurate picture of the contents of $v *before* the Thanks. -- |
From ccrook@linz.govt.nzThanks Dave First - apologies again for this very painful process of tracking the problem. Good news - the loop is only hit once or twice before it errors (depending on the order of retrieval from hash). I put a bit more code in ... results below. sub SubstituteSql However the possibly the most useful thing is that when I included the Dumper($lookup) it died due to the taint checking. $lookup is $VAR1 = { and $lookup->{word} is tainted. I did try a simple test script (attached), which puts a bit more context around this error. I had hoped that perl -T test.pl ANYTHING would trigger the error - but it didn't :-( Output from dump is below (followed by output without -T). ================================= SV = PVMG(0x1bf9f60) at 0x1dc7c58
|
From @iabynOn Mon, Sep 09, 2019 at 08:37:48PM +0000, Chris Crook wrote:
More good news: with the help of the extra feedback, I've managed to -- |
From @iabynOn Thu, Sep 12, 2019 at 11:07:13AM +0100, Dave Mitchell wrote:
Now fixed in blead with the following commit: commit 4a69216 Avoid panic when last s///g is tainted and utf8 -- |
Is this then closable? |
One of the ticket examples where we need an indication from the author but, while their email is available, it doesn't automatically send them an update. |
I emailed the OP privately, and their response was that it is ok to close |
Migrated from rt.perl.org#134409 (status was 'open')
Searchable as RT134409$
The text was updated successfully, but these errors were encountered: