Bill Stoddard wrote:
> 
> How about initing log_hash in ap_register_log_handler instead, right before the hash 
>table is
> initialized?

Yes, that the first place where we need it. - Commit this one -

>  Don't submit the patch, it's easy :-).

It is Friday - I could miss a copy + paste -

Nice week-end everybody

Jean-frederic
 
>
> Bill
> 
> > Jeff Trawick wrote:
> > >
> > > jean-frederic clere <[EMAIL PROTECTED]> writes:
> > >
> > > > Hi,
> > > >
> > > > I have detected that the variable log_hash of mod_log_config is not initialized
> > > > correctly. It causes a core on Solaris...
> > >
> > > just curious, plz verify...
> >
> > I have:
> > ++++
> > $ mdb httpd core
> > Loading modules: [ ]
> > $C
> > ffbefa38 find_entry+0xa8(0, d5fd0, 1, 10aa80, 0, ff199f58)
> > ffbefab8 apr_hash_set+0x30(0, d5fd0, 1, 10aa80, 81010100, ff00)
> > ffbefb20 mod_log_config.so`ap_register_log_handler+0x6c(e1340, d5fd0, 25768, 0,
> > 33ac0, 33b60)
> > ffbefb88 http_pre_config+0x60(e1340, ff4a8, 1014c0, e1340, 1014c0, 0)
> > ffbefbe8 ap_run_pre_config+0x80(e1340, ff4a8, 1014c0, d8840, 0, 0)
> > ffbefc50 main+0x3c4(1, ffbefd54, ffbefd5c, d4400, 0, 0)
> > ffbefcf0 _start+0xb8(0, 0, 0, 0, 0, 0)
> > +++
> >
> > >
> > > I guess http_pre_config() is calling ap_register_log_handler() before
> > > log_pre_config() is called, thus the core dump because
> > > ap_register_log_handler() references the hash allocated by
> > > log_pre_config()?
> >
> > Yes, as above!
> >
> > >
> > > Could we instead create the hash in register_hooks() (just before we
> > > register the optional function) and dispense with the multiple places
> > > where the hash could be created?
> >
> > Yes, If I have got it right register_hooks() is the very first routine called.
> > And the patch is more easy!
> >
> > >
> > > Thanks,
> > >
> > > Jeff
> > >
> > > --
> > > Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
> > >        http://www.geocities.com/SiliconValley/Park/9289/
> > >              Born in Roswell... married an alien...
> > +++ NEW PATCH +++
> > Index: mod_log_config.c
> > ===================================================================
> > RCS file: /home/cvs/apache/httpd-2.0/modules/loggers/mod_log_config.c,v
> > retrieving revision 1.54
> > diff -u -r1.54 mod_log_config.c
> > --- mod_log_config.c  2001/04/18 21:06:07     1.54
> > +++ mod_log_config.c  2001/04/20 15:16:43
> > @@ -1155,7 +1155,6 @@
> >
> 
> >      static APR_OPTIONAL_FN_TYPE(ap_register_log_handler) *log_pfn_register;
> >
> > -    log_hash = apr_hash_make(p);
> >      log_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_log_handler);
> >
> >      if (log_pfn_register)
> 
> > @@ -1190,6 +1189,7 @@
> >
> >  static void register_hooks(apr_pool_t *p)
> >
> 
> > +    log_hash = apr_hash_make(p);
> >      ap_hook_pre_config(log_pre_config,NULL,NULL,APR_HOOK_REALLY_FIRST);
> >      ap_hook_child_init(init_child,NULL,NULL,APR_HOOK_MIDDLE);
> >      ap_hook_open_logs(init_config_log,NULL,NULL,APR_HOOK_MIDDLE);
> > +++ NEW PATCH +++
> >

Reply via email to