Changes with Apache 1.3.28
+ *) Make sure the accept mutex is released before calling child exit
+ hooks and cleanups. Otherwise, modules can segfault in such code
+ and, with pthread mutexes, leave the server deadlocked. Even if
+ the module doesn't segfault, if it performs extensive processing
+ it can temporarily prevent the server from accepting new
+ connections. [Jeff Trawick]
+
*) Fix mod_rewrite's handling of absolute URIs. The escaping routines
now work scheme dependent and the query string will only be
appended if supported by the particular scheme. [André Malo]
static pool *plog; /* Pool for error-logging files */
static pool *ptrans; /* Pool for per-transaction stuff */
static pool *pchild; /* Pool for httpd child stuff */
+static pool *pmutex; /* Pool for accept mutex in child */
static pool *pcommands; /* Pool for -C and -c switches */
#ifndef NETWARE
static void clean_child_exit(int code)
{
if (pchild) {
+ /* make sure the accept mutex is released before calling child
+ * exit hooks and cleanups... otherwise, modules can segfault
+ * in such code and, depending on the mutex mechanism, leave
+ * the server deadlocked... even if the module doesn't segfault,
+ * if it performs extensive processing it can temporarily prevent
+ * the server from accepting new connections
+ */
+ ap_clear_pool(pmutex);
ap_child_exit_modules(pchild, server_conf);
ap_destroy_pool(pchild);
}
* we can have cleanups occur when the child exits.
*/
pchild = ap_make_sub_pool(pconf);
+ /* associate accept mutex cleanup with a subpool of pchild so we can
+ * make sure the mutex is released before calling module code at
+ * termination
+ */
+ pmutex = ap_make_sub_pool(pchild);
/* needs to be done before we switch UIDs so we have permissions */
reopen_scoreboard(pchild);
- SAFE_ACCEPT(accept_mutex_child_init(pchild));
+ SAFE_ACCEPT(accept_mutex_child_init(pmutex));
set_group_privs();
#ifdef MPE