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
perls (including bleadperl) segfault/etc. with recursion+sub{}+map pure-Perl code. #14716
Comments
From @shlomifHi all, the following code: < CODE > #!perl < / CODE > Gives me this: < SHELL > This is perl 5, version 20, subversion 1 (v5.20.1) built for Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License or the Complete documentation for Perl, including FAQ lists, should be found on shlomif@telaviv1:~/Download/unpack/perl/p5/possible-perl-bug-segfault-on-nAF$ < / SHELL> This code can also be found here: https://github.com/shlomif/possible-perl-bug--sandglass-golf Some credits - a similar program was written as a solution for this shinh.org http://golf.shinh.org/p.rb?sandglass Regards, Shlomi Fish -- Shlomi Fish http://www.shlomifish.org/ I feel much better, now that I’ve given up hope. Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @jkeenanOn Sun May 24 06:12:50 2015, shlomif@shlomifish.org wrote:
The Perl documentation ('perldoc perlvar') describes @F as follows: ##### Although the docs don't explicitly state that @F is a read-only variable for use solely by the perl interpreter, it sure sounds to me like a variable which ought to be treated as read-only. So why are you trying to assign to it (other than playing golf)? And why shouldn't someone reply, "There's no bug in Perl here. You're simply doing something you shouldn't"?
Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @shlomifHi all! On Sun May 24 14:37:29 2015, jkeenan wrote:
That was the only reason - it just was convenient in the golf challenge. Anyway, I've now replaced @F with @g and got the same segfault or otherwise erroneous behaviour. <CODE> #!perl </CODE> So like I suspected - @F is not particularly special or magical.
But why does it result in a segfault? Programs in general should not segfault, and the code seems enough like one with only defined behaviour. Regards, -- Shlomi Fish |
From @tamiasOn Sun, May 24, 2015 at 02:37:30PM -0700, James E Keenan via RT wrote:
The docs don't state that because it's not the case. What in this code % perl -MO=Deparse -lane '' The whole point of @F is that you can operate on its contents, including
Because that someone would be wrong. Ronald |
From @iabynOn Sun, May 24, 2015 at 06:12:50AM -0700, shlomif@shlomifish.org wrote:
The code can be reduced to this: my @d; sub r { r(1); which on a debugging blead gives: n=1 Its a another "stack not refcounted" bug, or more specifically, its bad to I'll attach this ticket to -- |
Migrated from rt.perl.org#125244 (status was 'open')
Searchable as RT125244$
The text was updated successfully, but these errors were encountered: