core: Initialize scoreboard's used optional functions on graceful restarts to
avoid a crash when relocation occurs. PR 57177.
core: follow up to r1668532: CHANGES entry.
core: follow up to r1668532: always initialize optional_fn pointers in ap_create_scoreboard().
Submitted by: ylavic
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1670325 13f79535-47bb-0310-9956-
ffa450edef68
calls r:wsupgrade() can cause a child process crash.
[Edward Lu <Chaosed0 gmail.com>]
+ *) core: Initialize scoreboard's used optional functions on graceful restarts
+ to avoid a crash when relocation occurs. PR 57177. [Yann Ylavic]
+
*) mod_dav: Avoid a potential integer underflow in the lock timeout value sent
back to a client. The answer to a LOCK request could be an extremly large
integer if the time needed to lock the resource was longer that the
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_proxy_connect/wstunnel: If both client and backend sides get readable
- at the same time, don't lose errors occuring while forwarding on the first
- side when none occurs next on the other side, and abort.
- trunk patch: http://svn.apache.org/r1657636
- http://svn.apache.org/r1657638
- http://svn.apache.org/r1669130
- 2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-mod_proxy-transfer-v3.patch
- +1: ylavic, covener, jim
-
- *) core: Initialize scoreboard's used optional functions on graceful restarts to
- avoid a crash when relocation occurs. PR 57177.
- trunk patch: http://svn.apache.org/r1668532
- http://svn.apache.org/r1668535 (CHANGES entry)
- http://svn.apache.org/r1668553
- 2.4.x patch: trunk works (modulo CHANGES)
- +1: ylavic, covener, jim
-
*) core: If explicitly configured, use the KeepaliveTimeout value of the
virtual host which handled the latest request on the connection, or by
default the one of the first virtual host bound to the same IP:port.
apr_random_after_fork(&proc);
}
+static void core_optional_fn_retrieve(void)
+{
+ ap_init_scoreboard(NULL);
+}
+
AP_CORE_DECLARE(void) ap_random_parent_after_fork(void)
{
/*
APR_HOOK_REALLY_LAST);
ap_hook_dirwalk_stat(core_dirwalk_stat, NULL, NULL, APR_HOOK_REALLY_LAST);
ap_hook_open_htaccess(ap_open_htaccess, NULL, NULL, APR_HOOK_REALLY_LAST);
+ ap_hook_optional_fn_retrieve(core_optional_fn_retrieve, NULL, NULL,
+ APR_HOOK_MIDDLE);
/* register the core's insert_filter hook and register core-provided
* filters
scoreboard_size += sizeof(process_score) * server_limit;
scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
- pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
-
return scoreboard_size;
}
char *more_storage;
int i;
+ pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
+ if (!shared_score) {
+ return;
+ }
+
ap_calc_scoreboard_size();
ap_scoreboard_image =
ap_calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
apr_status_t rv;
#endif
- pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
-
if (ap_scoreboard_image) {
ap_scoreboard_image->global->restart_time = apr_time_now();
memset(ap_scoreboard_image->parent, 0,
memset(ap_scoreboard_image->servers[i], 0,
sizeof(worker_score) * thread_limit);
}
+ ap_init_scoreboard(NULL);
return OK;
}