Bug #67320 [NEW]: Ignored sigpipes in php-fpm cause php to become unresponsive

From: Date: Wed, 21 May 2014 19:36:56 +0000
Subject: Bug #67320 [NEW]: Ignored sigpipes in php-fpm cause php to become unresponsive
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185887@lists.php.net to get a copy of this message
From: ryan at rmauger dot co dot uk Operating system: Linux / Debian 6/7 PHP version: 5.5.12 Package: FPM related Bug Type: Bug Bug description:Ignored sigpipes in php-fpm cause php to become unresponsive Description: ------------ As sigpipe appears to be ignored (http://lxr.php.net/xref/PHP_TRUNK/sapi/fpm/fpm/fpm_main.c#1584) when a sigpipe is recieved, the fcgi_request here https://github.com/php/php-src/blob/master/sapi/fpm/fpm/fastcgi.c#L316 appears to always be null, and so all subsiquent requests to all workers via nginx are treated as bad gateway errors. Below is a backtrace from a worker where this has occured. Core was generated by `/opt/php/sbin/php-fpm'. Program terminated with signal 13, Broken pipe. #0 0x00007ff6eb0160d0 in __write_nocancel () from /lib/libpthread.so.0 (gdb) bt #0 0x00007ff6eb0160d0 in __write_nocancel () from /lib/libpthread.so.0 #1 0x0000000000b5e00a in safe_write (req=0x7fffcc4715e0, buf=0x58a8158, count=33520) at /usr/local/src/php-5.4.28/sapi/fpm/fpm/fastcgi.c:316 #2 0x0000000000b5fb4c in fcgi_write (req=0x7fffcc4715e0, type=FCGI_STDOUT, str=0x58a8158 "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8"..., len=33522) at /usr/local/src/php-5.4.28/sapi/fpm/fpm/fastcgi.c:1023 #3 0x0000000000b68d3b in sapi_cgibin_single_write ( str=0x58a8158 "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8"..., str_length=33522, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/sapi/fpm/fpm/fpm_main.c:279 #4 0x0000000000b68db7 in sapi_cgibin_ub_write ( str=0x58a8158 "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8"..., str_length=33522, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/sapi/fpm/fpm/fpm_main.c:305 #5 0x0000000000a0a698 in php_output_op (op=0, str=0x589fd88 "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8"..., len=33522, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/main/output.c:1093 #6 0x0000000000a080b5 in php_output_write ( str=0x589fd88 "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8"..., len=33522, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/main/output.c:269 #7 0x00000000009ed1f0 in php_output_wrapper ( str=0x589fd88 "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8"..., str_length=33522) at /usr/local/src/php-5.4.28/main/main.c:1868 #8 0x0000000000aa1426 in zend_print_zval_ex (write_func=0x9ed1b8 <php_output_wrapper>, expr=0x5815b18, indent=0) at /usr/local/src/php-5.4.28/Zend/zend.c:330 #9 0x0000000000aa13a1 in zend_print_zval (expr=0x5815b18, indent=0) at /usr/local/src/php-5.4.28/Zend/zend.c:311 #10 0x0000000000aa0170 in zend_print_variable (var=0x5815b18) at /usr/local/src/php-5.4.28/Zend/zend_variables.c:154 #11 0x0000000000b3db7d in ZEND_ECHO_SPEC_CV_HANDLER (execute_data=0x7ff6f03f6710, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/Zend/zend_vm_execute.h:26793 #12 0x0000000000ae818b in execute (op_array=0x426d618, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/Zend/zend_vm_execute.h:410 #13 0x0000000000aa5438 in zend_execute_scripts (type=8, tsrm_ls=0x2463510, retval=0x0, file_count=3) at /usr/local/src/php-5.4.28/Zend/zend.c:1315 #14 0x00000000009eea06 in php_execute_script (primary_file=0x7fffcc473630, tsrm_ls=0x2463510) at /usr/local/src/php-5.4.28/main/main.c:2502 #15 0x0000000000b6d2bb in main (argc=3, argv=0x7fffcc473868) at /usr/local/src/php-5.4.28/sapi/fpm/fpm/fpm_main.c:1933 (gdb) x 0x7fffcc4715e0 0x7fffcc4715e0: 0x00000000 -- Edit bug report at https://bugs.php.net/bug.php?id=67320&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67320&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67320&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67320&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67320&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67320&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67320&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67320&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67320&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67320&r=support Expected behavior: https://bugs.php.net/fix.php?id=67320&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67320&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67320&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67320&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67320&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67320&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67320&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67320&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67320&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67320&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67320&r=mysqlcfg

« previous php.bugs (#185887) next »