#33640 [NEW]: preg_match will cause a segmentation fault on pattern

From: Date: Mon, 11 Jul 2005 06:53:18 +0000
Subject: #33640 [NEW]: preg_match will cause a segmentation fault on pattern
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81655@lists.php.net to get a copy of this message
From: david dot tulloh at infaze dot com dot au Operating system: debian linux PHP version: 5CVS-2005-07-11 (dev) PHP Bug Type: PCRE related Bug description: preg_match will cause a segmentation fault on pattern Description: ------------ While trying to craft a relatively complex regex string I caused php to consistently segfault. I then tracked it down to a smaller simpler pattern. PHP 5.1.0-dev (cli) (built: Jul 6 2005 10:55:39) Copyright (c) 1997-2005 The PHP Group Zend Engine v2.1.0-dev, Copyright (c) 1998-2004 Zend Technologies Reproduce code: --------------- <?php preg_match('/(?(?=a) (?R) )/x', 'a', $arr); preg_match_all('/(?(?=a) (?R) )/x', 'a', $arr); echo 'fin', "\n"; # will never print ?> Either preg line will cause the fault. Expected result: ---------------- Anything but a segmentation fault, some kind of error would be nice. Actual result: -------------- Segmentation fault gdb: Starting program: /usr/bin/php -f pcrash.php [Thread debugging using libthread_db enabled] [New Thread -1211468032 (LWP 22573)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1211468032 (LWP 22573)] 0xb7f58362 in pcre_compile () from /usr/lib/libpcre.so.3 -- Edit bug report at http://bugs.php.net/?id=33640&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33640&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33640&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33640&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33640&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33640&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33640&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33640&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33640&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33640&r=support Expected behavior: http://bugs.php.net/fix.php?id=33640&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33640&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33640&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33640&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33640&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33640&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33640&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33640&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33640&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33640&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33640&r=mysqlcfg

« previous php.bugs (#81655) next »