perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] why Apache::PerlSections gets resolved so many times?
Date Mon, 03 Jan 2005 15:31:51 GMT
Stas Bekman wrote:
> Philippe M. Chiasson wrote:
> 
>> Index: src/modules/perl/modperl_cmd.c
>> ===================================================================
>> --- src/modules/perl/modperl_cmd.c    (revision 123883)
>> +++ src/modules/perl/modperl_cmd.c    (working copy)
>> @@ -243,7 +243,7 @@
>>
>> MP_CMD_SRV_DECLARE(post_config_requires)
>> {
>> -    apr_pool_t *p = parms->pool;
>> +    apr_pool_t *p = parms->temp_pool;
>>     apr_finfo_t finfo;
>>     MP_dSCFG(parms->server);
>>
>> @@ -420,7 +420,7 @@
>>
>> MP_CMD_SRV_DECLARE(perl)
>> {
>> -    apr_pool_t *p = parms->pool;
>> +    apr_pool_t *p = parms->temp_pool;
>>     const char *endp = ap_strrchr_c(arg, '>');
>>     const char *errmsg;
>>     char *code = "";
>> @@ -473,7 +473,7 @@
>>
>> MP_CMD_SRV_DECLARE(perldo)
>> {
>> -    apr_pool_t *p = parms->pool;
>> +    apr_pool_t *p = parms->temp_pool;
>>     server_rec *s = parms->server;
>>     apr_table_t *options;
>>     modperl_handler_t *handler = NULL;
> 
> 
> 
> 
>>>> And that's just for <Perl> sections, and a cursory glance suggests

>>>> that there
>>>> could be a bunch of other configuration directives that mistakenly 
>>>> use parms->pool.
>>>>
>>>> I'll have a look and report later.
>>
>>
>>
>> I've looked carefully over modperl_cmd.c and I think the 3 places 
>> highlighted
>> in my patch (strangely, it's all my code) seem to be the only places 
>> where
>> using parms->temp_pool instead of parms->pool improves memory usages.
> 
> 
> and you are sure that this temp pool is not used for things that might 
> be needed at run time? e.g. things like saved apache::perlsections dump? 
> ( I didn't look, so this is just a suggestion)

As suspected it didn't fly, smoky did a good job and with an extra manual 
minimization we now get:

/TEST -maxclients 1 t/apr/table.t t/apache/conftree.t

#0  0x403709f3 in strlen () from /lib/tls/libc.so.6
(gdb) bt
#0  0x403709f3 in strlen () from /lib/tls/libc.so.6
#1  0x407204b4 in mpxs_Apache__Directive_as_hash (my_perl=0x8338dd0,
     tree=0x80cb578) at Apache__Directive.h:87
#2  0x40720c84 in XS_Apache__Directive_as_hash (my_perl=0x8338dd0,
     cv=0x94f9cc0) at Directive.xs:36
#3  0x4050a5a5 in Perl_pp_entersub (my_perl=0x8338dd0) at pp_hot.c:2890
#4  0x404e69a9 in Perl_runops_debug (my_perl=0x8338dd0) at dump.c:1449
#5  0x4048be26 in S_call_body (my_perl=0x8338dd0, myop=0xbfffec70, is_eval=0)
     at perl.c:2298
#6  0x4048b952 in Perl_call_sv (my_perl=0x8338dd0, sv=0x9914a2c, flags=4)
     at perl.c:2216
#7  0x4043e4ff in modperl_callback (my_perl=0x8338dd0, handler=0x82103a8,
     p=0x971dc90, r=0x971dcc8, s=0x8101be8, args=0x9b729e0)
     at modperl_callback.c:100
#8  0x4043edff in modperl_callback_run_handlers (idx=6, type=4, r=0x971dcc8,
     c=0x0, s=0x8101be8, pconf=0x0, plog=0x0, ptemp=0x0,
     run_mode=MP_HOOK_RUN_FIRST) at modperl_callback.c:261
#9  0x4043f257 in modperl_callback_per_dir (idx=6, r=0x971dcc8,
     run_mode=MP_HOOK_RUN_FIRST) at modperl_callback.c:368
#10 0x404375cf in modperl_response_handler_run (r=0x971dcc8, finish=1)
     at mod_perl.c:971
---Type <return> to continue, or q <return> to quit---
#11 0x404376ea in modperl_response_handler (r=0x971dcc8) at mod_perl.c:1011
#12 0x0808771d in ap_run_handler (r=0x971dcc8) at config.c:151
#13 0x08087b3a in ap_invoke_handler (r=0x971dcc8) at config.c:358
#14 0x0807dca1 in ap_process_request (r=0x971dcc8) at http_request.c:246
#15 0x08079619 in ap_process_http_connection (c=0x9671d00) at http_core.c:250
#16 0x0809147d in ap_run_process_connection (c=0x9671d00) at connection.c:42
#17 0x08085e0f in child_main (child_num_arg=1684955496) at prefork.c:609
#18 0x08086041 in make_child (s=0x8085a20, slot=2) at prefork.c:703
#19 0x080869e5 in ap_mpm_run (_pconf=0x0, plog=0x80fd180, s=0x1)
     at prefork.c:838
#20 0x0808bddd in main (argc=9, argv=0xbffff1f4) at main.c:619


-- 
__________________________________________________________________
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message