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
perl -e "open m" crashes Perl with "Out of memory!" message #7247
Comments
From DanVDascalescu@yahoo.comCreated by DanVDascalescu@yahoo.comCrashed Perl on every version and OS I tried this on. Hope this helps, -- Perl Info
|
From guest@guest.guest.xxxxxxxxI can confirm this with perl5.8.{0,1,3,4} and perl5.005 on i686-linux. You can replace "m" with s, tr, y, q, qq, qr or qw - same results. ' (that's 5 literal newlines): You get "Out of memory" because S_scan_str calls SvGROW with a negative HTH, Lukas |
The RT System itself - Status changed from 'new' to 'open' |
From stasis@arcor.deNow, the story goes like this: "m" (in "open m") is interpreted, 1. This behavior is indeed identical for all search modifiers 2. The above assumption (about PL_bufend) seems to hold true for Just in case though, here is a patch: Inline Patch--- toke.c Sun Oct 19 20:36:32 2003
+++ C:\MyTemp\Perl_SourceCode\perl-5.8.3\toke.c Mon Apr 26 19:01:57 2004
@@ -7026,7 +7026,8 @@
break;
}
- /* extend sv if need be */
+ /* extend sv if need be */
+ if (PL_bufend > s)
SvGROW(sv, SvCUR(sv) + (PL_bufend - s) + 1);
/* set 'to' to the next character in the sv's string */
to = SvPVX(sv)+SvCUR(sv);
Best regards,
Radu Sulita |
From @TuxOn Tue 20 Apr 2004 10:09, Dan Dascalescu (via RT) <perlbug-followup@perl.org> wrote:
Confirm, only I get a Bus error on HP-UX 11.00 The parser is obviously trying to complete the 'm' operator (match): l1:/pro/3gl/CPAN 124 > perl -le '$| = 1' it /did/ change in blead, but grew even less informative: l1:/pro/3gl/CPAN 129 > perl5.9.2 -le '$| = 1' -- |
From @iabynThis is caused by the C<case KEY_open:> code in toke.c, which is scanning I'm not sure where to add a test for this: it needs a fresh perl (eval Dave. -- Change 22776 by davem@davem-percy on 2004/05/03 20:26:22 [perl #28986] perl -e "open m" crashes Perl Affected files ... ... //depot/perl/toke.c#498 edit Differences ... ==== //depot/perl/toke.c#498 (text) ==== @@ -4681,8 +4681,8 @@ |
From @nwc10On Mon, May 03, 2004 at 09:54:28PM +0100, Dave Mitchell wrote:
Nice catch
t/io/open.t ? Nicholas Clark |
From @iabynOn Mon, May 03, 2004 at 09:52:26PM +0100, Nicholas Clark wrote:
Yeah, I realised I was looking in the wrong directory shortly after I -- Change 22777 by davem@davem-percy on 2004/05/03 20:48:53 add test for change #22776 ("open m" crashes Perl) Affected files ... ... //depot/perl/t/io/open.t#39 edit Differences ... ==== //depot/perl/t/io/open.t#39 (xtext) ==== @@ -12,7 +12,7 @@ -plan tests => 105; my $Perl = which_perl(); @@ -306,3 +306,8 @@ +# [perl #28986] "open m" crashes Perl |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#28986 (status was 'resolved')
Searchable as RT28986$
The text was updated successfully, but these errors were encountered: