develooper Front page | perl.perl5.porters | Postings from November 2014

[perl #108276] C stack overflow in Perl_scalarvoid

Thread Next
From:
Tony Cook via RT
Date:
November 17, 2014 06:42
Subject:
[perl #108276] C stack overflow in Perl_scalarvoid
Message ID:
rt-4.0.18-28156-1416206539-6.108276-15-0@perl.org
On Mon Jan 16 03:51:55 2012, davem wrote:
> On Sun, Jan 15, 2012 at 10:35:14AM -0800, bulk 88 wrote:
> 
> The code can be simplified to the following:
> 
>     my $n = $ARGV[0];
>     die unless $n =~ /^\d+$/;
> 
>     my $code = 'my $i = 0; if ($i) { print }' . "\n";
>     $code .= 'elsif ($i) { print }' . "\n" for 1..$n;
>     eval $code;
> 
> segfaults for me on blead with n >= about 5000.
> 
> In blead, it's recursing in S_finalize_op rather than scalarvoid; not sure
> whether this is instead of or in addition to a scalarvoid problem.
> 

Here's a patch that fixes the S_finalize_op() recursion, whitespace changes minimal

Additionally another patch to re-indent the new loop, and another to use the new macros I added to declare and clean-up the DEFER_OP() stack.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=108276

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