Re: cvs: php4 /sapi/apache2filter sapi_apache2.c

From: Date: Mon, 06 May 2002 06:19:19 +0000
Subject: Re: cvs: php4 /sapi/apache2filter sapi_apache2.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11718@lists.php.net to get a copy of this message
Hello Aaron, you might want to merge these two fixes to the branch for inclusion in 4.2.1. Derick On Sun, 5 May 2002, Aaron Bannert wrote: > aaron Sun May 5 14:11:41 2002 EDT > > Modified files: > /php4/sapi/apache2filter sapi_apache2.c > Log: > Fix an elusive and intermittent startup SEGV. The problem was > the static string we were using to set an initialization flag > would get remapped to a different location when Apache reloaded > the DSO, causing us to not run our initialization routines. > > Submitted by: Justin Erenkrantz <jerenkrantz@apache.org> > Reviewed by: Aaron Bannert (I added the big comment too) > > > Index: php4/sapi/apache2filter/sapi_apache2.c > diff -u php4/sapi/apache2filter/sapi_apache2.c:1.74 php4/sapi/apache2filter/sapi_apache2.c:1.75 > --- php4/sapi/apache2filter/sapi_apache2.c:1.74 Tue Apr 23 20:55:38 2002 > +++ php4/sapi/apache2filter/sapi_apache2.c Sun May 5 14:11:41 2002 > @@ -454,14 +454,19 @@ > * prevents us from starting PHP until the second load. */ > apr_pool_userdata_get(&data, userdata_key, s->process->pool); > if (data == NULL) { > - apr_pool_userdata_setn((const void *)1, userdata_key, > - apr_pool_cleanup_null, s->process->pool); > + /* We must use set() here and *not* setn(), otherwise the > + * static string pointed to by userdata_key will be mapped > + * to a different location when the DSO is reloaded and the > + * pointers won't match, causing get() to return NULL when > + * we expected it to return non-NULL. */ > + apr_pool_userdata_set((const void *)1, userdata_key, > + apr_pool_cleanup_null, s->process->pool); > return OK; > } > else if (data == (const void *)2) { > return OK; > } > - apr_pool_userdata_setn((const void *)2, userdata_key, > + apr_pool_userdata_set((const void *)2, userdata_key, > apr_pool_cleanup_null, s->process->pool); > > /* Set up our overridden path. */ > > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > --------------------------------------------------------------------------- Did I help you? http://www.jdimedia.nl/derick/link.php?url=giftlist Frequent ranting: http://www.jdimedia.nl/derick/ --------------------------------------------------------------------------- PHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net ---------------------------------------------------------------------------

« previous php.cvs (#11718) next »