From:             
Operating system: Mac OS 10.6.5
PHP version:      5.3SVN-2011-01-01 (SVN)
Package:          PCRE related
Bug Type:         Bug
Bug description:Long strings causes PCRE to seg fault

Description:
------------
Given certain regexs and large strings, preg_match() will recurse around
9200 

times and then seg fault. The shortest length for the string to match that
I 

managed to get that reproduce the crash each time was 4596 characters.
Different 

versions of the PCRE library can handle longer strings, but all versions I
tested 

crashed at 7000.



I ran this solely through the CLI.



The configure command I used was: ./configure --without-pear
"--prefix=$PWD" --

enable-debug for both SVN revision 306937 and PHP 5.3.4. The version of PHP


(5.3.3) that is included in Mac OS 10.6.5 and is linked against external
PCRE 

libraries also seg faulted.



The regex I was using is #^"((\\"|[^"])+)#. Removing \\"| prevents the seg
fault 

from occurring.

Test script:
---------------
http://simon.geek.nz/assets/text/a

Expected result:
----------------
Either a 0 or a 1 to be returned.

Actual result:
--------------
PHP segfaulted with a rather large (6.1 MB) backtrace.



http://simon.geek.nz/assets/text/9

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53635&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53635&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53635&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53635&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53635&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53635&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53635&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53635&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53635&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53635&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53635&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53635&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53635&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53635&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53635&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53635&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53635&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53635&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53635&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53635&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53635&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53635&r=mysqlcfg

Reply via email to