On 11/23/20 12:14 PM, yla...@apache.org wrote:
> Author: ylavic
> Date: Mon Nov 23 11:14:56 2020
> New Revision: 1883745
> 
> URL: http://svn.apache.org/viewvc?rev=1883745&view=rev
> Log:
> mod_auth_digest: fix crash on ONE_PROCESS (debug) mode shutdown.
> 
> There need to be separate global variables for rmm and mutex(es) in the parent
> and child processes, otherwise in ONE_PROCCESS (were clean_child_exit() and
> ap_terminate() execute in the same process) the variables get overwritten in
> child_init and freed twice when pchild and then pconf are destroyed.
> 
> Modified:
>     httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
> 
> Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_digest.c?rev=1883745&r1=1883744&r2=1883745&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c (original)
> +++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Mon Nov 23 11:14:56 2020

> @@ -417,20 +419,22 @@ static void initialize_child(apr_pool_t
>  {
>      apr_status_t sts;
>  
> -    if (!client_shm) {
> +    if (!main_client_shm) {
>          return;
>      }
>  
>      /* Get access to rmm in child */
> +    client_rmm = main_client_rmm;

Why is this needed?

>      sts = apr_rmm_attach(&client_rmm,
>                           NULL,
> -                         apr_shm_baseaddr_get(client_shm),
> +                         apr_shm_baseaddr_get(main_client_shm),
>                           p);
>      if (sts != APR_SUCCESS) {
>          log_error_and_cleanup("failed to attach to rmm", sts, s);
>          return;
>      }
>  
> +    client_lock = main_client_lock;

Why is this needed?

>      sts = apr_global_mutex_child_init(&client_lock,
>                                        apr_global_mutex_lockfile(client_lock),
>                                        p);

Regards

RĂ¼diger

Reply via email to