apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject apr_hook_global_pool is not initialized by apr_initialize
Date Fri, 15 Aug 2003 22:24:27 GMT
apr_dynamic_fn_register needs an initialized apr_hook_global_pool, however 
apr_initialize doesn't do that. Result: apr can't be used outside httpd, 
unless apr_hook_global_pool is initialized manually. This contradicts:

/**
  * Setup any APR internal data structures.  This MUST be the first function
  * called for any APR library.
  * @remark See apr_app_initialize if this is an application, rather than
  * a library consumer of apr.
  */
APR_DECLARE(apr_status_t) apr_initialize(void);

so it's not *any*. Is it an omission or by design? If by design apr_hash_make 
should probably check whether the pool is valid.

Notice that initializing it, in apr_initialize doesn't prevent overriding 
later in server/config.c:

  apr_hook_global_pool=process->pconf;

that's the core that I get when calling an optional function:

#0  apr_palloc (pool=0x0, size=39) at apr_pools.c:621
#1  0x403a9820 in apr_hash_make (pool=0x0) at apr_hash.c:135
#2  0x403dc313 in apr_dynamic_fn_register (
     szName=0x404b3fdb "apr_perlio_apr_file_to_PerlIO",
     pfn=0x404b3c66 <apr_perlio_apr_file_to_PerlIO>) at apr_hooks.c:409
#3  0x404b3c30 in apr_perlio_init (my_perl=0x804b2c0) at apr_perlio.c:414


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message