develooper Front page | perl.perl5.porters | Postings from July 2005

Re: [perl #36667] Lengthy parameter passed to eval leads to bus error on FreeBSD 5.4

From:
Dominic Dunlop
Date:
July 27, 2005 23:51
Subject:
Re: [perl #36667] Lengthy parameter passed to eval leads to bus error on FreeBSD 5.4
Message ID:
2E9F8618-1460-45C2-98CA-1603FBE7FA47@mac.com
On 2005–07–27, at 20:31, John Narron wrote:

> perl -e 'my $x = q[if ($h->{ALPHA}->{BETA}->{q{stuff}}) {] . "\n" . q[
> stuff($h, @_);] . "\n}\n\n"; $x x= 7238; $x =~ s/stuff/"stuff" .
> ++$count/eg; eval $x'

Problem confirmed with the above script on Mac OS X. The tipping  
point for a debugging bleadperl@25218 with a stack limit of 8192k is  
$x x= 26197. For a 64-bit perl it's somewhat more than half that; for  
a production perl 5.8.6, it's much higher -- somewhere between 70 and  
80,000. I'd put that difference down to the lack of debugging  
overhead and to optimisation, but I don't have an optimised bleadperl  
handy to check.  The stack trace of a the crashed perl 5.8.6 looks like

Host Name:      Tullamore
Date/Time:      2005-07-28 08:42:07.312 +0200
OS Version:     10.4.2 (Build 8C46)
Report Version: 3

Command: perl
Path:    /sw/bin/perl
Parent:  bash [300]

Version: ??? (???)

PID:    2876
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xbf7ffff0

Thread 0 Crashed:
0   perl     0x0002ffd0 Perl_newSV + 16 (crt.c:300)
1   perl     0x00081164 Perl_av_fetch + 688 (crt.c:300)
2   perl     0x000b0268 Perl_pad_alloc + 236 (crt.c:300)
3   perl     0x000179d4 Perl_peep + 496 (crt.c:300)
4   perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
5   perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
... [you get the idea]
501 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
502 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
503 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
504 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
505 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
506 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
507 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)
508 perl     0x00017fe4 Perl_peep + 2048 (crt.c:300)

Thread 0 crashed with PPC Thread State 64:
   srr0: 0x000000000002ffd0 srr1:  
0x100000000000d030                        vrsave: 0x0000000000000000
     cr: 0x28004284          xer: 0x0000000000000000   lr:  
0x0000000000081164  ctr: 0x000000000003177c
     r0: 0x0000000000081164   r1: 0x00000000bf800040   r2:  
0x0000000000000000   r3: 0x0000000001800400
     r4: 0x0000000000000000   r5: 0x00000000000e69ad   r6:  
0x0000000000000001   r7: 0x0000000001a1d200
     r8: 0x000000000000006f   r9: 0x000000000b005000  r10:  
0x000000000000007f  r11: 0x00000000018028c0
    r12: 0x000000009000a770  r13: 0x0000000000000000  r14:  
0x0000000000000000  r15: 0x0000000000000000
    r16: 0x0000000000000000  r17: 0x0000000000000000  r18:  
0x0000000000000000  r19: 0x000000000000012c
    r20: 0x0000000000000002  r21: 0x0000000000305c50  r22:  
0x000000000180be00  r23: 0x000000000180ba00
    r24: 0x000000000dbaf6b0  r25: 0x0000000000000001  r26:  
0x0000000000000003  r27: 0x000000000180b60c
    r28: 0x0000000001800400  r29: 0x0000000001800400  r30:  
0x0000000001800400  r31: 0x0000000000080ec4

Binary Images Description:
     0x1000 -    0xd9fff perl     /sw/bin/perl
0x8fe00000 - 0x8fe51fff dyld 43.1    /usr/lib/dyld
0x90000000 - 0x901a6fff libSystem.B.dylib     /usr/lib/libSystem.B.dylib
0x901fe000 - 0x90202fff libmathCommon.A.dylib     /usr/lib/system/ 
libmathCommon.A.dylib

-- 
Dominic Dunlop




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