You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2004/09/23 01:27:49 UTC

mp2: static build shutdown segfault

Got a core when running the test suite on the static server (probably at 
the server shutdown). couldn't reproduce it with (t/SMOKE -bug).

#0  0x4043d67f in find_entry (ht=0x6c2f742f, key=0x407538e6, klen=14, val=0x0)
     at apr_hash.c:235
235         for (hep = &ht->array[hash & ht->max], he = *hep;
(gdb) bt
#0  0x4043d67f in find_entry (ht=0x6c2f742f, key=0x407538e6, klen=14, val=0x0)
     at apr_hash.c:235
#1  0x4043d8a9 in apr_hash_get (ht=0x6c2f742f, key=0x407538e6, klen=-1)
     at apr_hash.c:297
#2  0x4044f5fd in apr_pool_userdata_get (data=0xbfffe8c8,
     key=0x407538e6 "APR::Pool::new", pool=0x81140f8) at apr_pools.c:1851
#3  0x40752173 in mpxs_apr_pool_DESTROY (my_perl=0x869f408, obj=0x944da84)
     at APR__Pool.h:352
#4  0x407533b2 in XS_APR__Pool_DESTROY (my_perl=0x869f408, cv=0x8af8c94)
     at Pool.xs:119
#5  0x400bdbba in Perl_pp_entersub (my_perl=0x869f408) at pp_hot.c:2857
#6  0x4003ec29 in S_call_body (my_perl=0x869f408, myop=0xbfffeaf0, is_eval=0)
     at perl.c:2285
#7  0x4003e775 in Perl_call_sv (my_perl=0x869f408, sv=0x8af8c94, flags=150)
     at perl.c:2206
#8  0x400c9f0b in Perl_sv_clear (my_perl=0x869f408, sv=0x944dac0) at sv.c:5125
#9  0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x944dac0) at sv.c:5371
#10 0x400ca434 in Perl_sv_clear (my_perl=0x869f408, sv=0x944dacc) at sv.c:5223
#11 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x944dacc) at sv.c:5371
#12 0x400ad520 in Perl_hv_free_ent (my_perl=0x869f408, hv=0x94500e4,
     entry=0x94432b4) at hv.c:1399
---Type <return> to continue, or q <return> to quit---
#13 0x400adabe in S_hfreeentries (my_perl=0x869f408, hv=0x94500e4) at 
hv.c:1575
#14 0x400adb3f in Perl_hv_undef (my_perl=0x869f408, hv=0x94500e4) at hv.c:1602
#15 0x400ca30a in Perl_sv_clear (my_perl=0x869f408, sv=0x94500e4) at sv.c:5188
#16 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x94500e4) at sv.c:5371
#17 0x400ca434 in Perl_sv_clear (my_perl=0x869f408, sv=0x94500d8) at sv.c:5223
#18 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x94500d8) at sv.c:5371
#19 0x400ad520 in Perl_hv_free_ent (my_perl=0x869f408, hv=0x945000c,
     entry=0x94431f4) at hv.c:1399
#20 0x400adabe in S_hfreeentries (my_perl=0x869f408, hv=0x945000c) at 
hv.c:1575
#21 0x400adb3f in Perl_hv_undef (my_perl=0x869f408, hv=0x945000c) at hv.c:1602
#22 0x400ca30a in Perl_sv_clear (my_perl=0x869f408, sv=0x945000c) at sv.c:5188
#23 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x945000c) at sv.c:5371
#24 0x400ca434 in Perl_sv_clear (my_perl=0x869f408, sv=0x9450018) at sv.c:5223
#25 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x9450018) at sv.c:5371
#26 0x080844ef in modperl_svptr_table_destroy (my_perl=0x869f408, 
tbl=0x8ad2a40)
     at modperl_svptr_table.c:123
#27 0x080808e8 in modperl_perl_destruct (perl=0x869f408) at modperl_perl.c:153

#28 0x0806ebb8 in modperl_interp_destroy (interp=0x8760150)
     at modperl_interp.c:145
#29 0x0806ed61 in modperl_interp_pool_destroy (data=0x935c058)
     at modperl_interp.c:201
---Type <return> to continue, or q <return> to quit---
#30 0x4044f77e in run_cleanups (cref=0x8d38178) at apr_pools.c:1951
#31 0x4044ed05 in apr_pool_destroy (pool=0x8d38168) at apr_pools.c:730
#32 0x4044ecf1 in apr_pool_destroy (pool=0x81000a8) at apr_pools.c:727
#33 0x4044ecf1 in apr_pool_destroy (pool=0x80fe0a0) at apr_pools.c:727
#34 0x080b7165 in destroy_and_exit_process (process=0x80fe120,
     process_exit_value=0) at main.c:208
#35 0x080b7e28 in main (argc=9, argv=0xbffff134) at main.c:626


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


Re: mp2: static build shutdown segfault

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
This just exposes an already known problem.

my $pool;
sub handler {
   my $r = shift;
   $pool = $r->pool;
}

In this case, by the time $pool->DESTROY() gets called, the request pool
has already been destroyed by apache, so we have a APR::Pool object that
points to a freed pool, and thus we segfault.

Attached is a simplistic test to expose this bug. I am looking into a fix.



Stas Bekman wrote:
> Got a core when running the test suite on the static server (probably at 
> the server shutdown). couldn't reproduce it with (t/SMOKE -bug).
> 
> #0  0x4043d67f in find_entry (ht=0x6c2f742f, key=0x407538e6, klen=14, val=0x0)
>      at apr_hash.c:235
> 235         for (hep = &ht->array[hash & ht->max], he = *hep;
> (gdb) bt
> #0  0x4043d67f in find_entry (ht=0x6c2f742f, key=0x407538e6, klen=14, val=0x0)
>      at apr_hash.c:235
> #1  0x4043d8a9 in apr_hash_get (ht=0x6c2f742f, key=0x407538e6, klen=-1)
>      at apr_hash.c:297
> #2  0x4044f5fd in apr_pool_userdata_get (data=0xbfffe8c8,
>      key=0x407538e6 "APR::Pool::new", pool=0x81140f8) at apr_pools.c:1851
> #3  0x40752173 in mpxs_apr_pool_DESTROY (my_perl=0x869f408, obj=0x944da84)
>      at APR__Pool.h:352
> #4  0x407533b2 in XS_APR__Pool_DESTROY (my_perl=0x869f408, cv=0x8af8c94)
>      at Pool.xs:119
> #5  0x400bdbba in Perl_pp_entersub (my_perl=0x869f408) at pp_hot.c:2857
> #6  0x4003ec29 in S_call_body (my_perl=0x869f408, myop=0xbfffeaf0, is_eval=0)
>      at perl.c:2285
> #7  0x4003e775 in Perl_call_sv (my_perl=0x869f408, sv=0x8af8c94, flags=150)
>      at perl.c:2206
> #8  0x400c9f0b in Perl_sv_clear (my_perl=0x869f408, sv=0x944dac0) at sv.c:5125
> #9  0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x944dac0) at sv.c:5371
> #10 0x400ca434 in Perl_sv_clear (my_perl=0x869f408, sv=0x944dacc) at sv.c:5223
> #11 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x944dacc) at sv.c:5371
> #12 0x400ad520 in Perl_hv_free_ent (my_perl=0x869f408, hv=0x94500e4,
>      entry=0x94432b4) at hv.c:1399
> ---Type <return> to continue, or q <return> to quit---
> #13 0x400adabe in S_hfreeentries (my_perl=0x869f408, hv=0x94500e4) at 
> hv.c:1575
> #14 0x400adb3f in Perl_hv_undef (my_perl=0x869f408, hv=0x94500e4) at hv.c:1602
> #15 0x400ca30a in Perl_sv_clear (my_perl=0x869f408, sv=0x94500e4) at sv.c:5188
> #16 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x94500e4) at sv.c:5371
> #17 0x400ca434 in Perl_sv_clear (my_perl=0x869f408, sv=0x94500d8) at sv.c:5223
> #18 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x94500d8) at sv.c:5371
> #19 0x400ad520 in Perl_hv_free_ent (my_perl=0x869f408, hv=0x945000c,
>      entry=0x94431f4) at hv.c:1399
> #20 0x400adabe in S_hfreeentries (my_perl=0x869f408, hv=0x945000c) at 
> hv.c:1575
> #21 0x400adb3f in Perl_hv_undef (my_perl=0x869f408, hv=0x945000c) at hv.c:1602
> #22 0x400ca30a in Perl_sv_clear (my_perl=0x869f408, sv=0x945000c) at sv.c:5188
> #23 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x945000c) at sv.c:5371
> #24 0x400ca434 in Perl_sv_clear (my_perl=0x869f408, sv=0x9450018) at sv.c:5223
> #25 0x400ca8c8 in Perl_sv_free (my_perl=0x869f408, sv=0x9450018) at sv.c:5371
> #26 0x080844ef in modperl_svptr_table_destroy (my_perl=0x869f408, 
> tbl=0x8ad2a40)
>      at modperl_svptr_table.c:123
> #27 0x080808e8 in modperl_perl_destruct (perl=0x869f408) at modperl_perl.c:153
> 
> #28 0x0806ebb8 in modperl_interp_destroy (interp=0x8760150)
>      at modperl_interp.c:145
> #29 0x0806ed61 in modperl_interp_pool_destroy (data=0x935c058)
>      at modperl_interp.c:201
> ---Type <return> to continue, or q <return> to quit---
> #30 0x4044f77e in run_cleanups (cref=0x8d38178) at apr_pools.c:1951
> #31 0x4044ed05 in apr_pool_destroy (pool=0x8d38168) at apr_pools.c:730
> #32 0x4044ecf1 in apr_pool_destroy (pool=0x81000a8) at apr_pools.c:727
> #33 0x4044ecf1 in apr_pool_destroy (pool=0x80fe0a0) at apr_pools.c:727
> #34 0x080b7165 in destroy_and_exit_process (process=0x80fe120,
>      process_exit_value=0) at main.c:208
> #35 0x080b7e28 in main (argc=9, argv=0xbffff134) at main.c:626
> 
> 

-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5