From: poltorak at alsenet dot com
Operating system: Ubuntu Linux
PHP version: 5.2.9
PHP Bug Type: *Regular Expressions
Bug description: preg_split cause Segmentation Fault
Description:
------------
This code cause segmentation fault in PHP Version 5.2.6-2ubuntu4.1
I can't check it on 5.2.9 for now. Please check.
If I reduce 200 (in for cycle) to 100, everything works.
If I delete ",'1'" at the end of $t string, everything works.
Reproduce code:
---------------
<?
$t = "'1','8','10','1','5','3','0','0','0','4','2','9','0','1';";
$a = "";
for ($i=0; $i<200; $i++)
$a .= $t;
print
preg_split("/;+(?=([^'|^\\\']*['|\\\'][^'|^\\\']*['|\\\'])*[^'|^\\\']*[^'|^\\\']$)/",
$a);
?>
Expected result:
----------------
Array
Actual result:
--------------
Segmentation Fault in error_log and empty page in browser.
--
Edit bug report at http://bugs.php.net/?id=47962&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47962&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47962&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47962&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47962&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47962&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47962&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47962&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47962&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47962&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47962&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47962&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47962&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47962&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47962&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47962&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47962&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47962&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47962&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47962&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47962&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47962&r=mysqlcfg