Re: [mp2] Problem with custom config in Location

[prev] [thread] [next] [Date index for 2005/05/21]

From: Stas Bekman
Subject: Re: [mp2] Problem with custom config in Location
Date: 00:13 on 21 May 2005
Herve Guillemet wrote:
>> Stas Bekman wrote:
>>
>> Herve, you've uncovered a bloody global perl context switch bug. 
>> Please try this patch (the reproducing tar ball now works for me under 
>> worker)
> 
> 
> This test does run successfully with your patch.
> Now define two directives.
> Use one inside the Location, another outside, and core dumps again.
> Test tarball attached.

Thanks Herve. Please try this patch on top of the one I've sent before.

Index: src/modules/perl/modperl_module.c
===================================================================
--- src/modules/perl/modperl_module.c   (revision 171168)
+++ src/modules/perl/modperl_module.c   (working copy)
@@ -191,6 +191,12 @@
      add_obj  = modperl_svptr_table_fetch(aTHX_ table, add);

      if (!base_obj || (base_obj == add_obj)) {
+#ifdef USE_ITHREADS
+        modperl_interp_unselect(interp);
+        if (orig_perl) {
+            MP_PERL_CONTEXT_RESTORE;
+        }
+#endif
          return addv;
      }

@@ -241,7 +247,9 @@

  #ifdef USE_ITHREADS
      modperl_interp_unselect(interp);
-    MP_PERL_CONTEXT_RESTORE;
+    if (orig_perl) {
+        MP_PERL_CONTEXT_RESTORE;
+    }
  #endif

      return (void *)mrg;

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

(message missing)

[mp2] Problem with custom config in Location
Herve Guillemet 19:41 on 19 May 2005

Re: [mp2] Problem with custom config in Location
Herve Guillemet 07:57 on 20 May 2005

Re: [mp2] Problem with custom config in Location
Herve Guillemet 16:09 on 20 May 2005

Re: [mp2] Problem with custom config in Location
Herve Guillemet 23:16 on 20 May 2005

Re: [mp2] Problem with custom config in Location
Stas Bekman 00:13 on 21 May 2005

Re: [mp2] Problem with custom config in Location
Herve Guillemet 13:52 on 21 May 2005

Re: [mp2] Problem with custom config in Location
Herve Guillemet 20:30 on 21 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52