From:             
Operating system: Mac OS X 10.7.1
PHP version:      5.3.8
Package:          Reproducible crash
Bug Type:         Bug
Bug description:SplFixedArray::fromArray causing segmentation fault 11

Description:
------------
I created a script that uses SplFileObject to iterate over a CSV file. As
it 
goes, it creates a new object with each line's data and adds the object to
an 
array. Running it with 10k or more lines crashes with a "Segmentation
fault: 11" 
error message, while anything up to 9,999 lines works well. Adjusting PHP's

memory limit had no effect.

I've attached a partial reduction to this bug. It seems like I really need
the 
elements of the SplFileObject and the class for each line, as skipping
either 
one of those (even when the resulting array is much larger than 10k items)

causes the failure to disappear. I'm not sure exactly what the trigger is,

however. My reduction includes a sample CSV file of just over 10k lines,
and 
though it still uses SplFileObject and a per-line object, the class for the

latter is just an stdClass, and the data from the file is essentially
ignored.

The script has two lines near the bottom that are method calls to
ImportData(). 
Comment out one or the other to see the script run successfully or to see
it 
fail. Option 1 works; option 2 fails.

Note that I tested this under 5.3.6, not the 5.3.8 that's indicated on the
bug. 
I do not have access to the latter.

Expected result:
----------------
I'd expect the script to run to completion in all cases, assuming there is

sufficient memory.

Actual result:
--------------
The script fails in the case of >= 10000 items in the array being
converted.

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

Reply via email to