https://issues.apache.org/bugzilla/show_bug.cgi?id=53579
Priority: P2
Bug ID: 53579
Assignee: [email protected]
Summary: httpd looping writing on a pipe and unresponsive
(httpd <defunct>)
Severity: critical
Classification: Unclassified
Reporter: [email protected]
Hardware: PC
Status: NEW
Version: 2.2.22
Component: mpm_prefork
Product: Apache httpd-2
httpd shows 3 defunct children and is unable to serve any further requets. A
lelnet connection to port 80 is successful though.
Version output
httpd -V
Server version: Apache/2.2.22 (Unix)
Server built: Jun 27 2012 23:19:33
Server's Module Magic Number: 20051115:30
Server loaded: APR 1.4.5, APR-Util 1.4.1
Compiled using: APR 1.4.5, APR-Util 1.4.1
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/opt/tms"
-D SUEXEC_BIN="/opt/tms/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
httpd -l
Compiled in modules:
core.c
mod_authn_file.c
mod_authn_default.c
mod_authz_host.c
mod_authz_groupfile.c
mod_authz_user.c
mod_authz_default.c
mod_auth_basic.c
mod_filter.c
mod_deflate.c
mod_log_config.c
mod_env.c
mod_headers.c
mod_version.c
mod_ssl.c
prefork.c
http_core.c
mod_mime.c
mod_autoindex.c
mod_cgi.c
mod_dir.c
mod_actions.c
mod_alias.c
mod_rewrite.c
mod_so.c
Config file snippet
Timeout 3600
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
StartServers 1
MinSpareServers 1
MaxSpareServers 2
MaxClients 16
MaxRequestsPerChild 0
Listen 80
Listen 443
Following is the output of netstat and status of the httpd
# netstat -nt | grep ":80"
tcp 296 0 ::ffff:10.0.1.233:80 ::ffff:10.18.3.14:62429
CLOSE_WAIT
tcp 287 0 ::ffff:10.0.1.233:80 ::ffff:10.18.0.233:51590
CLOSE_WAIT
tcp 304 0 ::ffff:10.0.1.233:80 ::ffff:10.18.0.233:51284
CLOSE_WAIT
tcp 304 0 ::ffff:10.0.1.233:80 ::ffff:10.18.0.233:51576
CLOSE_WAIT
tcp 296 0 ::ffff:10.0.1.233:80 ::ffff:10.18.3.14:58146
CLOSE_WAIT
tcp 287 0 ::ffff:10.0.1.233:80 ::ffff:10.18.0.233:51783
CLOSE_WAIT
tcp 287 0 ::ffff:10.0.1.233:80 ::ffff:10.18.0.233:51761
CLOSE_WAIT
# ps -ef | grep httpd
admin 11463 19173 0 21:53 pts/0 00:00:00 grep httpd
admin 12084 24519 0 Jun29 ? 00:00:19 /usr/sbin/httpd -D NO_DETACH -f
/etc/opt/tms/output/httpd.conf
apache 21089 12084 0 Jul05 ? 00:00:00 [httpd] <defunct>
apache 31445 12084 0 Jul05 ? 00:00:00 [httpd] <defunct>
apache 31596 12084 0 Jul05 ? 00:00:00 [httpd] <defunct>
gdb -p 12084 /usr/sbin/httpd shows that the top level process is here:
(gdb) where
#0 0x00007f638884e470 in __write_nocancel () from /lib64/libpthread.so.0
#1 0x0000000000483c87 in apr_file_write ()
#2 0x00000000004273af in ap_mpm_pod_signal ()
#3 0x000000000045f3c3 in ap_mpm_run ()
#4 0x000000000040a664 in main ()
Apparently, it is getting stuck writing something to a file.
ap_mpm_pod_signal() effectively just called apr_file_write(), where it is
getting stuck.
Using an httpd built with -g , the stack trace from gdb looks like this:
(gdb) where
#0 0x00007f638884e470 in __write_nocancel () from /lib64/libpthread.so.0
#1 0x0000000000483c87 in apr_file_write (thefile=0x19314b0,
buf=0x7fffb849709f, nbytes=0x7fffb8497090) at file_io/unix/readwrite.c:188
#2 0x00000000004273af in pod_signal_internal (pod=0x1931420)
at mpm_common.c:630
#3 ap_mpm_pod_signal (pod=0x1931420) at mpm_common.c:726
#4 0x000000000045f3c3 in perform_idle_server_maintenance (
_pconf=<value optimized out>, plog=<value optimized out>,
s=<value optimized out>) at prefork.c:867
#5 ap_mpm_run (_pconf=<value optimized out>, plog=<value optimized out>,
s=<value optimized out>) at prefork.c:1107
#6 0x000000000040a664 in main (argc=5, argv=0x7fffb8497448) at main.c:753
thefile is as follows:
(gdb) frame 1
#1 0x0000000000483c87 in apr_file_write (thefile=0x19314b0,
buf=0x7fffb849709f, nbytes=0x7fffb8497090) at file_io/unix/readwrite.c:188
188 file_io/unix/readwrite.c: No such file or directory.
in file_io/unix/readwrite.c
(gdb) print thefile
$1 = (apr_file_t *) 0x19314b0
(gdb) print *thefile
$2 = {
pool = 0x18fa138,
filedes = 8,
fname = 0x0,
flags = 0,
eof_hit = 0,
is_pipe = 1,
timeout = -1,
buffered = 0,
blocking = BLK_ON,
ungetchar = 0,
buffer = 0x0,
bufpos = 0,
bufsize = 0,
dataRead = 0,
direction = 0,
filePtr = 0,
thlock = 0x0
}
(gdb)
In other words, it is writing to a pipe (thefile->ispipe == 1).
Note that line 188 of file_io/unix/readwrite.c is this:
187 do {
188 rv = write(thefile->filedes, buf, *nbytes);
189 } while (rv == (apr_size_t)-1 && errno == EINTR);
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]