Commit 39136793 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1668532, r1668535, r1668553 from trunk:

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
parent 2d5c6f78
Loading
Loading
Loading
Loading
+3 −0
Changes for CHANGES: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ Changes with Apache 2.4.13
     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
+0 −17
Changes for STATUS: 0 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -106,23 +106,6 @@ RELEASE SHOWSTOPPERS:
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.
+7 −0
Changes for server/core.c: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4760,6 +4760,11 @@ static void core_child_init(apr_pool_t *pchild, server_rec *s)
    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)
{
    /*
@@ -4939,6 +4944,8 @@ static void register_hooks(apr_pool_t *p)
                                  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
+6 −4
Changes for server/scoreboard.c: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -138,8 +138,6 @@ AP_DECLARE(int) ap_calc_scoreboard_size(void)
    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;
}

@@ -148,6 +146,11 @@ AP_DECLARE(void) ap_init_scoreboard(void *shared_score)
    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 *));
@@ -299,8 +302,6 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
    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,
@@ -309,6 +310,7 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
            memset(ap_scoreboard_image->servers[i], 0,
                   sizeof(worker_score) * thread_limit);
        }
        ap_init_scoreboard(NULL);
        return OK;
    }