a normal listener.
There was an additional bug than what Ian submitted to fix listen.c
(i.e. check sa for null): make_pipe_of_death does not zero out
lr->bind_addr (since it uses apr_palloc). So, on Solaris, the first
time through, bind_addr was probably 0, but the second time, not (pools!).
(This caused Aaron's analysis that the patch worked the first time,
but not the second time.)
Submitted by: Ian Holsman
Reviewed by: Justin Erenkrantz, Aaron Bannert
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92387
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.30-dev
+ *) Fix segfault when worker MPM receives SIGHUP.
+ [Ian Holsman, Aaron Bannert, Justin Erenkrantz]
+
*) Fix bug that could potentially prevent the perchild MPM from
working with more than one vhost/uid. [Aaron Bannert]
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2001/12/07 18:10:25 $]
+Last modified at [$Date: 2001/12/08 01:38:04 $]
Release:
any) to segfault on AIX and can probably cause load or other
errors on some other platforms.
- * Sending httpd a SIGHUP with worker MPM causes a segfault
- when we started as root and switch to a different user.
- Aaron Says: I've only been able to reproduce this on
- Solaris, works fine for Linux. Also, it appears
- to be happening in the parent.
-
RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
* There is increasing demand from module writers for an API
/* see if we've got an old listener for this address:port */
for (walk = &old_listeners; *walk; walk = &(*walk)->next) {
sa = (*walk)->bind_addr;
- apr_sockaddr_port_get(&oldport, sa);
- apr_sockaddr_ip_get(&oldaddr, sa);
- if (!strcmp(oldaddr, addr) && port == oldport) {
- /* re-use existing record */
- new = *walk;
- *walk = new->next;
- new->next = ap_listeners;
- ap_listeners = new;
- return;
+ /* Some listeners are not real so they will not have a bind_addr. */
+ if (sa) {
+ apr_sockaddr_port_get(&oldport, sa);
+ apr_sockaddr_ip_get(&oldaddr, sa);
+ if (!strcmp(oldaddr, addr) && port == oldport) {
+ /* re-use existing record */
+ new = *walk;
+ *walk = new->next;
+ new->next = ap_listeners;
+ ap_listeners = new;
+ return;
+ }
}
}
lr->sd = sd;
lr->active = 1;
lr->accept_func = check_pipe_of_death;
+ /* We are not bound to a real address. So, indicate that. */
+ lr->bind_addr = 0;
lr->next = ap_listeners;
ap_listeners = lr;
(*num_listeners)++;