develooper Front page | perl.perl5.porters | Postings from March 2011

Re: segmentation fault with $dbline[0]

Thread Previous
From:
Father Chrysostomos
Date:
March 6, 2011 12:52
Subject:
Re: segmentation fault with $dbline[0]
Message ID:
5EFF080B-0687-45BE-AE7D-0336BE3F09D0@cpan.org

On Feb 26, 2011, at 10:32 AM, vadrer wrote:

> On Sat, 2011-02-26 at 18:23 +0000, vadrer wrote:
>> On Sat, 2011-02-26 at 06:41 -0800, Father Chrysostomos wrote:
>>> vadrer wrote:
>>>> perl -wle '$r=q/print __FILE__;local *dbline =
>>>> $main::{"_<".__FILE__};print $dbline[0]/;eval $r;'
>>>> 
>>>> gives me a segmentation fault for 5.10.1, 5.12.1 but not 5.8.8
>>>> OS is linux.
>> 
>>> See <http://perl5.git.perl.org/perl.git/commitdiff/8f87837>.
>>> 
>> 
>> cool! thank you, very much!
>> 
> 
> after reading commit message once again, I wonder, why threaded perl do
> not crash?
> 
> is it because in code 
> *d = *a;  print $d[0];
> 
> $d[0] is *not* optimized into aelemfast for threaded perls?


My commit message is a little misleading.

Your original test case does not crash in threaded perls, so I just tracked down the bug in non-threaded perls, without investigating why threaded perls were fine.

I turns out that my reduced case *does* crash threaded builds.

Your test case does not crash because @{"_<".__FILE__} exists in threaded, but not non-threaded perls. I’m not sure why that is, but I don’t think it’s a problem.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About