perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [PATCH] Re: [BUG] Bad refcounting in Apache->push_handlers()
Date Thu, 07 Apr 2005 20:35:22 GMT
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@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