1

We are using Magento 1.8 on a cloud server that is running Linux 2.6.32-573.7.1.el6.x86_64 on 8 cores. We have PHP 5.4 with patch as advised for the version of Magento we are using.

We get the following error within PHP-FPM error log:

[11-Nov-2015 16:18:17] WARNING: [pool magento] child 7280 exited on signal 11 (SIGSEGV) after 1312.321185 seconds from start

And we get the following error in the httpd error log:

Wed Nov 11 16:18:17 2015] [error] [client 10.189.246.6] (104)Connection reset by peer: FastCGI: comm with server "/dev/shm/magento-php.fcgi" aborted: read failed, referer: http://www.heliguy.com/dji/spares/inspire-1-spares/inspire-1-fpv-upgrade.html

The referer is different on every error. This then gives a 503 to users, that I suspect are effected by that child process?

We have some recent core dump files that can be available for anyone to check, as this gives a dump on each signal 11. I have been able to backtrace these, here is one example:

(gdb) bt
    #0  match (eptr=0x117ac3c9 ")", ecode=0x2e8e8c7 "\200",
    mstart=0x117ac2ff "`cataloginventory_stock_status`.`product_id`,        `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (website_id"...,
    offset_top=2, md=0x7ffedb90c960, eptrb=0x0, rdepth=4)
    at /usr/src/debug/php-5.4.45/ext/pcre/pcrelib/pcre_exec.c:516
#1  0x0000000000475ce8 in match (eptr=0x117ac3c9 ")", ecode=0x2e8e8c2 "\205",
    mstart=0x117ac2ff "`cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (website_id"...,
    offset_top=5, md=0x7ffe117a3504, eptrb=0x0, rdepth=3)
    at /usr/src/debug/php-5.4.45/ext/pcre/pcrelib/pcre_exec.c:983
#2  0x0000000000475ce8 in match (eptr=0x117ac3c9 ")", ecode=0x2e8e8bd "\205",
    mstart=0x117ac2ff "`cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (website_id"...,
    offset_top=3, md=0x7ffe117a5ee4, eptrb=0x0, rdepth=2)
    at /usr/src/debug/php-5.4.45/ext/pcre/pcrelib/pcre_exec.c:983
#3  0x0000000000475baf in match (eptr=0x117ac3ca "", ecode=0x2e8e8b7 "\200",
    mstart=0x117ac2ff "`cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (website_id"...,
    offset_top=2, md=0x7ffedb90c960, eptrb=0x0, rdepth=1)
---Type <return> to continue, or q <return> to quit---
    at /usr/src/debug/php-5.4.45/ext/pcre/pcrelib/pcre_exec.c:1612
#4  0x0000000000479877 in match (eptr=0x117ac3ca "",
    ecode=<value optimized out>,
    mstart=0x117ac2ff "`cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (website_id"...,
    offset_top=2, md=0x7ffedb90c960, eptrb=0x0, rdepth=0)
    at /usr/src/debug/php-5.4.45/ext/pcre/pcrelib/pcre_exec.c:6178
#5  0x0000000000486980 in php_pcre_exec (argument_re=0x2e8e870,
    extra_data=<value optimized out>,
    subject=0x117ac2f8 "SELECT `cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (web"...,
    length=<value optimized out>, start_offset=0, options=0,
    offsets=0x117a5f20, offsetcount=12)
    at /usr/src/debug/php-5.4.45/ext/pcre/pcrelib/pcre_exec.c:6935
#6  0x00000000004af3f2 in php_pcre_replace_impl (pce=0x2e8de70,
    subject=0x117ac2f8 "SELECT `cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('8252', '8475')) AND (stock_id=1) AND (web"...,
    subject_len=210, replace_val=0x117b2350, is_callable_replace=0,
    result_len=<value optimized out>, limit=-1, replace_count=0x7ffedb90cdc8)
    at /usr/src/debug/php-5.4.45/ext/pcre/php_pcre.c:1087
---Type <return> to continue, or q <return> to quit---
#7  0x00000000004b0a0b in php_replace_in_subject (regex=0x117b2320,
    replace=0x117b2350, subject=0x11502978, result_len=0x7ffedb90cdcc,
    limit=-1, is_callable_replace=0, replace_count=0x7ffedb90cdc8)
    at /usr/src/debug/php-5.4.45/ext/pcre/php_pcre.c:1314
#8  0x00000000004b113a in preg_replace_impl (ht=3, return_value=0x117aade0,
    return_value_ptr=<value optimized out>, this_ptr=<value optimized out>,
    return_value_used=<value optimized out>, is_callable_replace=0,
    is_filter=0) at /usr/src/debug/php-5.4.45/ext/pcre/php_pcre.c:1412
#9  0x00000000004b14c3 in zif_preg_replace (ht=<value optimized out>,
    return_value=<value optimized out>,
    return_value_ptr=<value optimized out>, this_ptr=<value optimized out>,
    return_value_used=<value optimized out>)
    at /usr/src/debug/php-5.4.45/ext/pcre/php_pcre.c:1432
#10 0x000000000067fd6c in zend_do_fcall_common_helper_SPEC (
    execute_data=<value optimized out>)
    at /usr/src/debug/php-5.4.45/Zend/zend_vm_execute.h:643
#11 0x000000000066d6a8 in execute (op_array=0x31ce798)
    at /usr/src/debug/php-5.4.45/Zend/zend_vm_execute.h:410
#12 0x00007f16d30710e9 in nr_laravel5_exception_report ()
   from /usr/lib64/php/modules/newrelic.so
#13 0x0005241db364a189 in ?? ()
#14 0x000000005640c341 in ?? ()
#15 0x00000000000e0f49 in ?? ()
---Type <return> to continue, or q <return> to quit---
#16 0x0000000000000073 in ?? ()
#17 0x000000000066fd62 in _zval_dtor (prop_dim=<value optimized out>,
    execute_data=0x66de19)
    at /usr/src/debug/php-5.4.45/Zend/zend_variables.h:35
#18 zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP (
    prop_dim=<value optimized out>, execute_data=0x66de19)
    at /usr/src/debug/php-5.4.45/Zend/zend_vm_execute.h:16213
#19 0x000000000066d6a8 in execute (op_array=0x31d1890)
    at /usr/src/debug/php-5.4.45/Zend/zend_vm_execute.h:410
#20 0x00007f16d307110c in nr_laravel5_exception_report ()
   from /usr/lib64/php/modules/newrelic.so
#21 0x000000000066d6a8 in execute (op_array=0x7f16d32d0f00)
    at /usr/src/debug/php-5.4.45/Zend/zend_vm_execute.h:410
#22 0x00007f16d30710e9 in nr_laravel5_exception_report ()
   from /usr/lib64/php/modules/newrelic.so
#23 0x0005241db364a189 in ?? ()
#24 0x000000005640c341 in ?? ()
#25 0x00000000000e0f49 in ?? ()
#26 0x00000000031700b8 in ?? ()
#27 0x00000000117ac2c8 in ?? ()
#28 0x0000000000000020 in ?? ()
#29 0x00000000005ddf62 in _zend_mm_free_int (heap=0x115024d8, p=0x16ce1d7)
    at /usr/src/debug/php-5.4.45/Zend/zend_alloc.c:2114
---Type <return> to continue, or q <return> to quit---
#30 0x00007f16d32d0f00 in ?? ()
#31 0x00007f16c90f9250 in ?? ()
#32 0x00000000114f07a0 in ?? ()
#33 0x0000000000000001 in ?? ()
#34 0x00007f16d30718a2 in nr_laravel_router_method_with_request ()
   from /usr/lib64/php/modules/newrelic.so
#35 0x0000000000000000 in ?? ()

What problem will be causing this? We have tried many things such as different PHP versions and have suffered with it for many months.

  • I've had a similar issue recently, tracing a segfault using `gdb` and core dumps and found [this post](http://stackoverflow.com/questions/5115613/core-dump-file-analysis) helpful. Couldn't get Apache to produce core dumps, though; I traced it to a bug in PHP 5.4 regarding infinite recursion: `php -r "function f() { f(); } f();"`. – Kenney Nov 11 '15 at 16:58
  • Thank you Kenney, I have managed to get a backtrace and updated the question. Are you available for hire to fix this at all? – Andrew Rogers Nov 12 '15 at 13:04
  • I would be, but I'm not the best suited as I'm not really familiar with most of the source code so it would take me a while to orient myself. I think you'll have results faster if you file a bug with PHP or newrelic. There's some things you could try: [disable PDO persistent option](http://stackoverflow.com/questions/20598860/php-apache-crashing-on-script-segmentation-fault-11) (if used), disable APC, run PHP without the patch, and disable the newrelic agent (this is my best guess - no monitoring is better than an unstable site). – Kenney Nov 12 '15 at 14:35
  • Thank you Kenney, NewRelic is actually something very recent and this problem has been going on for around 10 months at different levels of annoyance. I will have a go at any PDO and APC and see if that makes any difference at all. Thank you. – Andrew Rogers Nov 13 '15 at 13:57
  • Okay, thanks! I found another bug that it might be: [segmentation fault in pcre library](https://bugs.php.net/bug.php?id=64046). I don't see the regular expression in the trace above; do all the core dumps mention `pcre_...`? – Kenney Nov 13 '15 at 14:56
  • 1
    Did you ever find a solution to this problem? – robgt Mar 07 '17 at 17:41
  • I am facing the exact same problem, except for running magento on php 5.6.38 with the integrated fpm server. The error occures only when the post request is send to the user. Have you ever found a solution? – Sebastian Schmidt Sep 26 '18 at 15:09
  • I can confirm this behaviour with Magento 1.9.2 and PHP 5.6. I'm looking for a fix, will post it as an aswer if something comes up. Please do the same. – Dr. Gianluigi Zane Zanettini Oct 13 '18 at 22:48

0 Answers0