Re: [PATCH] Re: [BUG] Bad refcounting in Apache->push_handlers()
[prev]
[thread]
[next]
[Date index for 2005/04/07]
Stas Bekman wrote:
Still need to check this one:
> Now with threaded perl 5.8.6 everything works fine, but:
> t/directive/perlrequire fails with: can't find ANONSUB top entry (get)
The patch below fixes the non-threaded case.
> with non-threaded 5.6.1 a bunch of tests fail with:
> Undefined subroutine &main::ÿÿÿÿÿÿÿÿÿÿÿÿÿ called, <DATA> line 462.
Index: src/modules/perl/modperl_handler.c
===================================================================
--- src/modules/perl/modperl_handler.c (revision 160427)
+++ src/modules/perl/modperl_handler.c (working copy)
@@ -49,6 +49,7 @@
* PerlTransHandler 'sub { ... }'
* B) run-time perl code
* $r->push_handlers(PerlTransHandler => sub { .... });
+ * $s->push_handlers(PerlTransHandler => sub { .... });
*
* In the case of non-threaded perl, we just compile A or grab B and
* store it in the mod_perl struct and call it when it's used. No
@@ -169,7 +170,7 @@
#else
/* it's safe to cache and later use the cv, since the same perl
* interpeter is always used */
- handler->cv = cv;
+ handler->cv = SvREFCNT_inc((SV*)cv);
handler->name = NULL;
MP_TRACE_h(MP_FUNC, "[%s] new cached cv anon handler\n",
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com