Subject: | SIGPIPE signal handler is not installed, action left as SIG_IGN |
The os_unix.c module installs signal handlers for a few different signals. It attemps to install a handler consisting of an empty subroutine for SIGPIPE. However the code only installs the handler if a 'force' argument is set or if the current handling for the signal is SIG_DFL. The mod_fastcgi Apache module creates the FCGI Perl process with SIGPIPE ignored (SIG_IGN), which persists across the Perl exec() call. Thus the signal handler for SIGPIPE in FCGI-0.67/os_unix.c is not installed.
This problem is not severe because the SIG_IGN on SIGPIPE has the same effect as installing the empty signal handler. The FCGI application should still elect to catch and handle SIGPIPE (via the %SIG hash). However if code is later added to the empty signal handler, it will not take effect until the existing code is changed to install it.
This bug was found by inspection while diagnosing a deeper problem with FCGI applications not receiving SIGPIPE upon user's cancelling of the HTTP connection, because Apache 2.x/mod-fastcgi-2.4.2 apparently buffers all FCGI output before sending to the user.
FCGI-0.67/perl-5.8.1/i586-linux