On 27.04.2013 05:11, Guenter Knauf wrote: > On 26.04.2013 21:18, Jeff Trawick wrote: >> I can RM... > coool! > > I was recently on hunting an old NetWare-only with apr_pool_parent_get() > bug with Rainer, and he finally suggested a patch like this:
First: I think Jeff wants to release APR (thus 1.4), all of the below changes are for APR-UTIL. Some background AFAIR: On Netware the global pool is shared between NLMs, thus the pool below the global pool should in most cases be used instead. Also on Netware the apr_pool_parent_get() function for the global pool returns the pool itself. We were not able to find out whether that is actually intended or not, but use it to find the pool below the global pool. The loop should behave identical except when - pool is null, which should be a problem in all of the below situations even without the change - apr_pool_parent_get(pool) returns pool itself. The old loop then loops forever whereas the new one stops as needed by Netware - It's a bit slower due to one additional pointer comparison. That should be no problem especially since all the places are init functions which are not called frequently. Regards, Rainer > Index: dbd/apr_dbd.c > =================================================================== > --- dbd/apr_dbd.c (revision 1463267) > +++ dbd/apr_dbd.c (working copy) > @@ -102,8 +102,10 @@ > } > > /* Top level pool scope, need process-scope lifetime */ > - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) > - pool = parent; > + for (parent = apr_pool_parent_get(pool); > + parent && parent != pool; > + parent = apr_pool_parent_get(pool)) > + pool = parent; > #if APU_DSO_BUILD > /* deprecate in 2.0 - permit implicit initialization */ > apu_dso_init(pool); > Index: dbm/apr_dbm.c > > I verified that this fixes the NetWare crash while we believe that this > shouldnt make a difference for all other platforms ... > the same loop construct appears in 3 more files, where in apu_dso.c it > looks slightly different ... > > I really would like to get these patches in before release since without > I cant load mod_lua anymore due its dep to apr_dbd ... > > if nobody objects I would like to commit the below: > > Index: crypto/apr_crypto.c > =================================================================== > --- crypto/apr_crypto.c (revision 1463267) > +++ crypto/apr_crypto.c (working copy) > @@ -100,7 +100,9 @@ > } > > /* Top level pool scope, need process-scope lifetime */ > - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) > + for (parent = apr_pool_parent_get(pool); > + parent && parent != pool; > + parent = apr_pool_parent_get(pool)) > pool = parent; > #if APU_DSO_BUILD > /* deprecate in 2.0 - permit implicit initialization */ > Index: dbd/apr_dbd.c > =================================================================== > --- dbd/apr_dbd.c (revision 1463267) > +++ dbd/apr_dbd.c (working copy) > @@ -102,8 +102,10 @@ > } > > /* Top level pool scope, need process-scope lifetime */ > - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) > - pool = parent; > + for (parent = apr_pool_parent_get(pool); > + parent && parent != pool; > + parent = apr_pool_parent_get(pool)) > + pool = parent; > #if APU_DSO_BUILD > /* deprecate in 2.0 - permit implicit initialization */ > apu_dso_init(pool); > Index: dbm/apr_dbm.c > =================================================================== > --- dbm/apr_dbm.c (revision 1463267) > +++ dbm/apr_dbm.c (working copy) > @@ -129,8 +129,10 @@ > apr_pool_t *parent; > > /* Top level pool scope, need process-scope lifetime */ > - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) > - pool = parent; > + for (parent = apr_pool_parent_get(pool); > + parent && parent != pool; > + parent = apr_pool_parent_get(pool)) > + pool = parent; > > /* deprecate in 2.0 - permit implicit initialization */ > apu_dso_init(pool); > > for the last one in apu_dso.c I need to do some further testing 1st ... > > Gün. > > > > > > > -- kippdata informationstechnologie GmbH Tel: 0228 98549 -0 Bornheimer Str. 33a Fax: 0228 98549 -50 53111 Bonn www.kippdata.de HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417 Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann
