#41306 [NEW]: PHP Segfaults on certain regexp

From: Date: Sun, 06 May 2007 19:12:58 +0000
Subject: #41306 [NEW]: PHP Segfaults on certain regexp
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112323@lists.php.net to get a copy of this message
From: Sjon at hortensius dot net Operating system: Linux 2.6.20 PHP version: 4.4.7 PHP Bug Type: PCRE related Bug description: PHP Segfaults on certain regexp Description: ------------ Although other regexps work fine; this one crashes since 4.4.7 is installed Reproduce code: --------------- <?PHP $x = new x(); class x { function y($matches){ echo 'no problem!'; } function x(){ preg_replace_callback('~\{([a-zA-Z\-_]{0,50})@([a-zA-Z_\d]{1,50})\}((?:(?:\{[a-zA-Z.\-_\d]{1,50}\}|[^\{\}]*)(\{,\})?)*)\{\1/\}~sU', array(&$this, 'y'), '{@function}argument{/}'); } } ?> Expected result: ---------------- I would expect the x::y function to be ran by preg_replace_callback Actual result: -------------- [Sun May 06 20:47:49 2007] [notice] child pid 26044 exit signal Segmentation fault (11) -- Edit bug report at http://bugs.php.net/?id=41306&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41306&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41306&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41306&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41306&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41306&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41306&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41306&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41306&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41306&r=support Expected behavior: http://bugs.php.net/fix.php?id=41306&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41306&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41306&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41306&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41306&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41306&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41306&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41306&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41306&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41306&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41306&r=mysqlcfg

« previous php.bugs (#112323) next »