Search code examples
segmentation-faultphpexcelhhvmboxmemory-limit

Spout by Box with HHVM 3.11


I use Ubuntu prebuilt hhvm at a 2gb ram 1vcpu vps. I need to read some csv file so i found Spout from box claiming lowest memory usasge than phpexcel. but HHVM got segmentation fault . i checked it with php-fpm 5.6 on the same server but that worked.

My csv contains 6k rows with 15 columns. and it will increase in my application.

I tried to reduce the memory limit of hhvm and running from command line but none worked.

Message is

Core dumped: Segmentation fault
Stack trace in /tmp/stacktrace.12516.log
Segmentation fault

and stack trace contains

#0  feof(Resource id #4) called at [/home/<user>/public_html/grievance/Spout/Common/Helper/GlobalFunctionsHelper.php:215]
#1  Box\Spout\Common\Helper\GlobalFunctionsHelper->feof(Resource id #4) called at [/home/<user>/public_html/grievance/Spout/Reader/CSV/RowIterator.php:132]
#2  Box\Spout\Reader\CSV\RowIterator->next() called at [/home/<user>/public_html/grievance/test.php:47]

Solution

  • This was a problem with GC . The file pointer was collected by Garbage collector of HHVM and so it is creating a segmentation fault.