On 18/07/2005, at 2:05 AM, Michael G Schwern via RT wrote:
[EMAIL PROTECTED] - Sat Aug 30 14:33:01 2003]:
perl -wle '("1"x5683)=~ /^(11+)\1+$/'
works ok
perl -wle '("1"x 9973)=~ /^(11+)\1+$/'
Segmentation fault (core dumped)
ulimit -a
...
stack size (kbytes) 1048576
...
I can't reproduce with 5.8.0, 5.8.6 or bleadperl on OS X. I can
reproduce on Debian 5.8.4 but I need to crank up the size a bit.
$ perl -wle '("1"x 19973)=~ /^(11+)\1+$/'
Segmentation fault
I don't have a newer Perl on Linux to try out.
Neither do I. However, I'll jump in anyway:
Yet another case to be linked to the #24274 deep-regex-recursion-
causes-stack-overflow metabug:
$ perl -v
This is perl, v5.8.6 built for darwin-thread-multi-2level
...
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) 6144
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 256
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 100
virtual memory (kbytes, -v) unlimited
$ ulimit -s 2048
$ perl -wle '("1"x5683)=~ /^(11+)\1+$/'
$ ulimit -s 1024
$ perl -wle '("1"x5683)=~ /^(11+)\1+$/'
Segmentation fault
From the crash log:
Host Name: Tullamore
Date/Time: 2005-07-18 09:45:49.115 +0200
OS Version: 10.4.2 (Build 8C46)
Report Version: 3
Command: perl
Path: /sw/bin/perl
Parent: bash [22803]
Version: ??? (???)
PID: 22826
Thread: 0
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xbfeffff0
Thread 0 Crashed:
0 libSystem.B.dylib 0x90005e28 szone_size + 28
1 libSystem.B.dylib 0x9001793c realloc + 1500
2 perl 0x00003bec Perl_safesysrealloc + 120 (crt.c:
300)
3 perl 0x00089020 Perl_savestack_grow_cnt + 80
(crt.c:300)
4 perl 0x000b7664 S_regcppush + 92 (crt.c:300)
5 perl 0x000bdcc4 S_regmatch + 8076 (crt.c:300)
6 perl 0x000bdce0 S_regmatch + 8104 (crt.c:300)
...
507 perl 0x000bdce0 S_regmatch + 8104 (crt.c:300)
508 perl 0x000bdce0 S_regmatch + 8104 (crt.c:300)
Thread 0 crashed with PPC Thread State 64:
srr0: 0x0000000090005e28 srr1:
0x100000000000d030 vrsave: 0x0000000000000000
cr: 0x48042224 xer: 0x0000000020000000 lr:
0x0000000090005e1c ctr: 0x0000000090005e0c
r0: 0x000000009001793c r1: 0x00000000bff00040 r2:
0x00000000a0007374 r3: 0x0000000001800000
r4: 0x0000000000205000 r5: 0x0000000000000054 r6:
0x0000000000000000 r7: 0x0000000000000031
r8: 0x0000000000000031 r9: 0x0000000000000011 r10:
0x0000000000305e30 r11: 0x00000000000e2828
r12: 0x0000000090005e0c r13: 0x0000000000000000 r14:
0x0000000000000000 r15: 0x0000000000000000
r16: 0x0000000000000000 r17: 0x0000000000000000 r18:
0x0000000000000000 r19: 0x0000000000000000
r20: 0x0000000000000002 r21: 0x0000000000000000 r22:
0x0000000000305be0 r23: 0x00000000000109a4
r24: 0x0000000000205000 r25: 0x000000000180e222 r26:
0x000000000180e224 r27: 0x0000000000004263
r28: 0x0000000001800000 r29: 0x0000000001800000 r30:
0x0000000000205000 r31: 0x0000000090005e1c
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
Behaviour is the same with [EMAIL PROTECTED]
--
Dominic Dunlop