Edit report at https://bugs.php.net/bug.php?id=55660&edit=1
ID: 55660 User updated by: rewilliams at crystaltech dot com Reported by: rewilliams at crystaltech dot com Summary: SplFixedArray::fromArray causing segmentation fault 11 -Status: Feedback +Status: Open Type: Bug Package: Reproducible crash Operating System: Mac OS X 10.7.1 PHP Version: 5.3.8 Block user comment: N Private report: N New Comment: Well, it doesn't seem to show itself under 5.3.8 on the Linux server, so maybe this was fixed and I just missed the report. Since my original report, I've had several similar cases that happened somewhat randomly under 5.3.6, so I'll just keep an eye out and if I get something that's reproducible under the latest version, I'll file another bug. In the mean time, you can close this bug. Thanks for your time. Previous Comments: ------------------------------------------------------------------------ [2011-09-13 02:37:45] larue...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Hi, I still can not reproduce with your data.csv, could you try with the 5.3-trunk? ------------------------------------------------------------------------ [2011-09-12 18:05:53] rewilliams at crystaltech dot com laruence@: I just caught that you stated your test file had 1005 lines. I'm not sure if you misread what I wrote or if you mistyped what you tested, but the test file I used was 10005 lines - you're off by an order of magnitude. I uploaded my file to Dropbox. You can grab it here: <http://dl.dropbox.com/u/9434155/data.csv> If you're able to grab it and attach it to the bug or make it available someplace more permanent, that would be great. ------------------------------------------------------------------------ [2011-09-12 18:00:42] rewilliams at crystaltech dot com FWIW, I just reproduced it on a Linux server running 5.3.4. I'm working on getting a backtrace, but I need to build a debug version of PHP first. ------------------------------------------------------------------------ [2011-09-10 03:59:47] larue...@php.net Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. I can not reproduce it with a test csv file(1005 line, 13 cloumns) with 5.3 trunk ------------------------------------------------------------------------ [2011-09-09 21:32:23] rewilliams at crystaltech dot com Hmm, I don't see how to upload reproduction scripts. The script is below; I'll leave the data file to the tester. I created a simple CSV file that had 10,005 lines of 13 columns each, where the value of every column is the alphabet. It included one trailing blank line and used CRLF line endings. Here's the script: <?php ini_set('display_errors', 1); ini_set('error_reporting', E_ALL | E_STRICT); class NmsObj { static public function ImportData($whichOption) { $fileObj = new SplFileObject('TestData.csv'); $fileObj->setFlags(SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE | SplFileObject::READ_CSV); $return = array(); foreach ($fileObj as $oneLine) { $return[] = new stdClass(); } //foreach switch ($whichOption) { case 1: $return = array_slice($return, 0, 9999); $result = SplFixedArray::fromArray($return); //we get here return $result; break; case 2: $return = array_slice($return, 0, 10000); $result = SplFixedArray::fromArray($return); //we won't get here - get "Segmentation fault: 11" return $result; break; } //switch } //ImportData } //NmsObj //$dataSet1 = NmsObj::ImportData(1); $dataSet1 = NmsObj::ImportData(2); echo "Done!\n"; ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55660 -- Edit this bug report at https://bugs.php.net/bug.php?id=55660&edit=1