httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <man...@raleigh.ibm.com>
Subject Re: apache-apr
Date Mon, 12 Apr 1999 23:39:07 GMT
On Mon, Apr 12, 1999 at 12:58:46PM -0700, unknown@riverstyx.net wrote:
> #0  0x400e55c2 in __libc_accept ()
> #1  0x4006c0c1 in accept (fd=16, addr={__sockaddr__ = 0xbd5ffd48, 
>       __sockaddr_at__ = 0xbd5ffd48, __sockaddr_ax25__ = 0xbd5ffd48, 
>       __sockaddr_dl__ = 0xbd5ffd48, __sockaddr_eon__ = 0xbd5ffd48, 
>       __sockaddr_in__ = 0xbd5ffd48, __sockaddr_in6__ = 0xbd5ffd48, 
>       __sockaddr_inarp__ = 0xbd5ffd48, __sockaddr_ipx__ = 0xbd5ffd48, 
>       __sockaddr_iso__ = 0xbd5ffd48, __sockaddr_ns__ = 0xbd5ffd48, 
>       __sockaddr_un__ = 0xbd5ffd48, __sockaddr_x25__ = 0xbd5ffd48}, 
>     addr_len=0xbd5ffd44) at wrapsyscall.c:146
> #2  0x80768ed in accept_thread ()
> #3  0x40069357 in pthread_start_thread (arg=0xbd5ffea4) at manager.c:192

Thank you very much for your help.

I've been able to duplicate your problem with a minimal configuration.
The conf file is attached. Just start a server with more two ports (-X is
fine), and hit only one of them a few times.

I think the problem is that the method we're using to kick out our
acceptor thread from accept() isn't working correctly. AFAIK, close()
is supposed to kick the acceptor thread out of accept(). But it
doesn't seem to do so all the time. It works during normal server
operation when we send a SIGWINCH to the parent process. But, it
doesn't seem to work when we're running in httpd -X mode, or when the
SIGWINCH is raised by the process itself because MaxRequestsPerChild
was hit, as you were seeing.

There's a reason why this doesn't show up when we are listening on
only one port (and why we hadn't seen this bug before you pointed it
out): it's the acceptor threads' job to notice that we've reached
MaxRequestsPerChild and to start the child process shutdown. If there
is only one acccetor thread, it will exit properly, because it wasn't
waiting in accept().

Should we be using a different method to kick a thread out of
accept(), or is this some sort of Linux kernel/libc bug, or am I just
missing something here?

-- 
Manoj Kasichainula - manojk@raleigh.ibm.com
IBM, Apache Development

Mime
View raw message