|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-08-22 08:26 UTC] pierre at archlinux dot de
Description: ------------ Since PHP 5.4.5 starting php-fpm will either result in a segmentation fault or it will hang under certain conditions. It is a little hard to reproduce but it seems it is related to using modules. There more modules get loaded via php.ini the more likely this bug will get triggered (> 30%); with no modules loaded I was not able to trigger it. I started from 5.4.6 and reverted patches applied to sapi/fpm. Once I reverted commit c2f33fb1293cbcdc94daefb8583ca13e98b5c826, php would no longer crash or hang. See http://git.php.net/?p=php-src.git;a=commit;h=c2f33fb1293cbcdc94daefb8583ca13e98b5c826 Test script: --------------- Configure php with a bunch of modules and run something like this: for i in {1..100};do sudo php-fpm;sleep 0.5;sudo killall php-fpm;sleep 0.5;done watch dmesg for segfaults like php-fpm[32571]: segfault at 7f4eabe93cf8 ip 00007f4eae9b1ed6 sp 00007fff87d69310 error 4 in ld-2.16.so[7f4eae9a3000+21000] gdb will tell you 0x00007fe0412c1ed6 in _dl_fini () from /lib/ld-linux-x86-64.so.2 Sometimes php-fpm will hang and has to be killed with kill -9. Patchesbug62886.patch.txt (last revision 2012-09-26 19:28 UTC by fat@php.net)php-fpm.conf (last revision 2012-08-24 08:56 UTC by pierre at archlinux dot de) php.ini (last revision 2012-08-24 08:55 UTC by pierre at archlinux dot de) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
I am also noticing this issue with our 5.3.16 packages: # php-fpm -v PHP 5.3.16 (fpm-fcgi) (built: Aug 20 2012 10:39:20) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies # for i in {1..100}; do php-fpm ; killall php-fpm; done Segmentation fault Segmentation fault Segmentation fault # dmesg | grep php-fpm php-fpm[30800]: segfault at 7f7d199f4cd0 ip 00007f7d24a43b83 sp 00007fffdd48fb20 error 4 in ld- 2.12.so[7f7d24a35000+20000] php-fpm[31599]: segfault at 7f50f17c3cd0 ip 00007f50fc812b83 sp 00007fff09f13120 error 4 in ld- 2.12.so[7f50fc804000+20000] php-fpm[32009]: segfault at 7f3005f59cc0 ip 00007f3010938b83 sp 00007fffb291c3a0 error 4 in ld- 2.12.so[7f301092a000+20000] php-fpm[32313]: segfault at 7f17094a4cc0 ip 00007f1713e83b83 sp 00007fffaab94e20 error 4 in ld- 2.12.so[7f1713e75000+20000] php-fpm[32585]: segfault at 7f60ad427cc0 ip 00007f60b7e06b83 sp 00007ffff44e06a0 error 4 in ld- 2.12.so[7f60b7df8000+20000][19-Mar-2013 08:22:54] NOTICE: Reloading in progress ... [19-Mar-2013 08:22:54] ERROR: unable to read what child say: Bad file descriptor (9) [19-Mar-2013 08:22:54] ERROR: unable to read what child say: Bad file descriptor (9) [19-Mar-2013 08:22:54] ERROR: unable to read what child say: Bad file descriptor (9) [19-Mar-2013 08:22:54] ERROR: unable to read what child say: Bad file descriptor (9) [19-Mar-2013 08:22:54] ERROR: unable to read what child say: Bad file descriptor (9) [19-Mar-2013 08:22:54] ERROR: unable to read what child say: Bad file descriptor (9) [19-Mar-2013 08:22:54] NOTICE: reloading: execvp("php-fpm", {"php-fpm", "-- daemonize"}) [19-Mar-2013 08:22:55] NOTICE: using inherited socket fd=7, "127.0.0.1:9000" [19-Mar-2013 08:22:55] NOTICE: using inherited socket fd=7, "127.0.0.1:9000" [19-Mar-2013 08:22:55] NOTICE: fpm is running, pid 25134 [19-Mar-2013 08:22:55] NOTICE: ready to handle connections [root@ID11878 php-fpm]# [root@ID11878 php-fpm]# php -v PHP 5.4.13 (cli) (built: Mar 14 2013 08:57:49) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend TechnologiesSame to me: [04-Apr-2013 22:38:37] ERROR: unable to read what child say: Bad file descriptor (9) [04-Apr-2013 22:38:55] ERROR: unable to read what child say: Bad file descriptor (9) [04-Apr-2013 22:38:55] ERROR: unable to read what child say: Bad file descriptor (9) [04-Apr-2013 22:38:55] ERROR: unable to read what child say: Bad file descriptor (9) [04-Apr-2013 22:38:55] ERROR: unable to read what child say: Bad file descriptor (9) [04-Apr-2013 22:38:55] ERROR: unable to read what child say: Bad file descriptor (9) [04-Apr-2013 22:38:55] ERROR: unable to read what child say: Bad file descriptor (9) php-fpm[19644]: segfault at 7fff30199fe0 ip 0000000000574e30 sp 00007fff30199fb0 error 6 in php-fpm[400000+32a000] php-fpm[18003]: segfault at 7fff30199fe0 ip 0000000000574e30 sp 00007fff30199fb0 error 6 in php-fpm[400000+32a000] php-fpm[9699]: segfault at 7fff30199fe0 ip 0000000000574e30 sp 00007fff30199fb0 error 6 in php-fpm[400000+32a000] php-fpm[17649]: segfault at 7fff30199fe0 ip 0000000000574e30 sp 00007fff30199fb0 error 6 in php-fpm[400000+32a000] php-fpm[13203]: segfault at 7fff30199fe0 ip 0000000000574e30 sp 00007fff30199fb0 error 6 in php-fpm[400000+32a000] php-fpm[21313]: segfault at 7ffeff931fa0 ip 0000000000574e30 sp 00007ffeff931f70 error 6 in php-fpm[400000+32a000] php-fpm[4705]: segfault at 7fff84be5fa0 ip 0000000000574e30 sp 00007fff84be5f70 error 6 in php-fpm[400000+32a000] php-fpm[24508]: segfault at 7fff84be5fa0 ip 0000000000574e30 sp 00007fff84be5f70 error 6 in php-fpm[400000+32a000] [root@onlinecity /]# php -v PHP 5.4.13 (cli) (built: Mar 14 2013 09:15:29) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and with SourceGuardian v9.0.4, Copyright (c) 2000-2012, by Inovica Ltd. rpm -qi php Name : php Relocations: (not relocatable) Version : 5.4.13 Vendor: Remi Collet Release : 1.el5.remi Build Date: czw 14 mar 2013 09:27:38 CET Install Date: sob 16 mar 2013 18:44:01 CET Build Host: dixsept.famillecollet.com Group : Development/Languages Source RPM: php-5.4.13-1.el5.remi.src.rpm Size : 9294225 License: PHP and Zend and BSD Signature : DSA/SHA1, czw 14 mar 2013 09:45:45 CET, Key ID 004e6f4700f97f56 Packager : http://blog.famillecollet.com/ URL : http://www.php.net/ Summary : Osadzany w HTML-u język skryptowy PHP (PHP: preprocesor hipertekstu). Description : PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated webpages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts. The php package contains the module which adds support for the PHP language to Apache HTTP Server.Me three. Happens on SmartOS joyent_20120614T184600Z with PHP 5.3.10. # php -v PHP 5.3.10 (cli) (built: Mar 25 2012 13:30:23) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH # php-fpm -v PHP 5.3.10 (fpm-fcgi) (built: Mar 25 2012 15:17:24) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH php-fpm.log: [06-May-2013 11:12:40] NOTICE: fpm is running, pid 12244 [06-May-2013 11:12:41] NOTICE: ready to handle connections [06-May-2013 11:16:11] NOTICE: Reloading in progress ... [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) [06-May-2013 11:16:11] ERROR: unable to read what child say: Bad file number (9) PHP-FPM dies then and Apache returns a "Internal Server error" page.Same me on high load. Software version: FreeBSD 8.3 PHP 5.4.19 (fpm-fcgi) [28-Sep-2013 20:19:31] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:19:31] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:19:31] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:20:51] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:20:51] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:25:05] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:25:05] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:25:05] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:25:05] ERROR: unable to read what child say: Bad file descriptor (9) [28-Sep-2013 20:25:52] ERROR: unable to read what child say: Bad file descriptor (9) /var/log/messages for that period Sep 28 20:00:20 <kern.info> ex11 kernel: pid 34096 (php-fpm), uid 80: exited on signal 11 (core dumped) Sep 28 20:06:54 <kern.info> ex11 kernel: pid 34998 (php-fpm), uid 80: exited on signal 10 (core dumped) Sep 28 20:08:15 <kern.info> ex11 kernel: pid 35009 (php-fpm), uid 80: exited on signal 10 (core dumped) Sep 28 20:19:10 <kern.info> ex11 kernel: pid 36656 (php-fpm), uid 80: exited on signal 10 (core dumped) Backtrace: #0 0x0000000000696070 in ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER (execute_data=0x801826cb0) at zend_vm_execute.h:13709 #1 0x0000000000671970 in execute (op_array=0x80e205240) at zend_vm_execute.h:410 #2 0x0000000000627c9e in zend_call_function (fci=0x7fffffffbe70, fci_cache=0x7fffffffbe00) at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_execute_API.c:956 #3 0x00000000006599ff in zend_call_method (object_pp=0x80e23a130, obj_ce=0x80e204630, fn_proxy=0x80e23a128, function_name=0x80e2088b0 "zend_loader_standardautoloader::autoload\001", function_name_len=45, retval_ptr_ptr=0x7fffffffbf88, param_count=1, arg1=0x80e4f63b8, arg2=0x0) at /usr/ports/lang/php5/work/php- 5.4.19/Zend/zend_interfaces.c:97 #4 0x0000000000483a98 in zif_spl_autoload_call (ht=1, return_value=0x80e4f61e0, return_value_ptr=0x7fffffffc270, this_ptr=0x0, return_value_used=1) at /usr/ports/lang/php5/work/php-5.4.19/ext/spl/php_spl.c:436 #5 0x0000000000627e5f in zend_call_function (fci=0x7fffffffc220, fci_cache=0x7fffffffc1f0) at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_execute_API.c:978 #6 0x0000000000628829 in zend_lookup_class_ex (name=0x804fd11f0 "Zend_Cache", name_length=10, key=0x80e4b7388, use_autoload=1, ce=0x7fffffffc360) at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_execute_API.c:1125 #7 0x0000000000629713 in zend_fetch_class_by_name (class_name=0x804fd11f0 "Zend_Cache", class_name_len=10, key=0x80e4b7388, fetch_type=0) at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_execute_API.c:1605 #8 0x000000000067af1e in ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER (execute_data=0x801826150) at zend_vm_execute.h:3600 #9 0x0000000000671970 in execute (op_array=0x80e4bef80) at zend_vm_execute.h:410 #10 0x0000000000627c9e in zend_call_function (fci=0x7fffffffc640, fci_cache=0x7fffffffc4b0) at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_execute_API.c:956 #11 0x000000000062706a in call_user_function_ex (function_table=0x80185e060, object_pp=0x0, function_name=0x80e6ec0b0, retval_ptr_ptr=0x7fffffffc6e8, param_count=2, params=0x80e4f6d68, no_separation=1, symbol_table=0x0) at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_execute_API.c:748 #12 0x0000000000626ecd in call_user_function (function_table=0x80185e060, object_pp=0x0, function_name=0x80e6ec0b0, retval_ptr=0x80e4f7278, param_count=2, params=0x7fffffffc780) at /usr/ports/lang/php5/work/php- 5.4.19/Zend/zend_execute_API.c:721 #13 0x000000080443768f in ps_call_handler () from /usr/local/lib/php/20100525- debug/session.so #14 0x0000000804437d64 in ps_write_user () from /usr/local/lib/php/20100525- debug/session.so #15 0x000000080442d5f1 in php_session_save_current_state () from /usr/local/lib/php/20100525-debug/session.so #16 0x00000008044323d6 in php_session_flush () from /usr/local/lib/php/20100525- debug/session.so #17 0x00000008044342a9 in zm_deactivate_session () from /usr/local/lib/php/20100525-debug/session.so #18 0x0000000000644211 in zend_deactivate_modules () at /usr/ports/lang/php5/work/php-5.4.19/Zend/zend_API.c:2370 #19 0x00000000005b1b5a in php_request_shutdown (dummy=0x0) at /usr/ports/lang/php5/work/php-5.4.19/main/main.c:1772 #20 0x00000000006e8156 in main (argc=1, argv=0x7fffffffed30) at /usr/ports/lang/php5/work/php-5.4.19/sapi/fpm/fpm/fpm_main.c:1961