You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Herve Guillemet <hg...@apteryx.fr> on 2005/05/19 21:41:22 UTC

[mp2] Problem with custom config in Location

1. Problem Description:

A custom apache config directive defined in a <Location> together with
a PerlResponseHandler makes the request handling crash.

httpd.conf contains:
--------------------

PerlLoadModule Xi::TestConf

<Location /test>
  XiTest test
  SetHandler modperl
  PerlResponseHandler Xi::Test
</Location>

TestConf.pm:
------------

package Xi::TestConf;

use Apache2::Module ();

my @directives = ( { name         => 'XiTest' } );
Apache2::Module::add(__PACKAGE__, \@directives);

sub XiTest {
   my($self, $parms, $arg) = @_;
   $self->{XiTest} = $arg;
}

1;

Test.pm:
--------

package Xi::Test;

use Apache2::Const -compile => qw/OK/;

sub handler {
   my $r = shift;
   $r->print("Hello");
   return OK;
}

1;

Result:
-------
% telnet localhost 8000 
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /test/foo HTTP/1.0

Connection closed by foreign host.

Thanks in advance for any feedback about this.


2. Used Components and their Configuration:

*** mod_perl version 1.999023

*** using /opt/xi3/lib/perl5/site_perl/5.8.6/i686-linux-thread-multi/Apache2/BuildConfig.pm

*** Makefile.PL options:
   MP_APR_LIB     => aprext
   MP_AP_PREFIX   => /opt/xi3
   MP_COMPAT_1X   => 0
   MP_GENERATE_XS => 1
   MP_LIBNAME     => mod_perl
   MP_USE_DSO     => 1


*** The httpd binary was not found


*** (apr|apu)-config linking info

  -L/opt/xi3/lib -laprutil-0 -lgdbm -ldb -lexpat
  -L/opt/xi3/lib -lapr-0 -lrt -lm -lcrypt -lnsl  -lpthread -ldl



*** /opt/xi3/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
   Platform:
     osname=linux, osvers=2.6.11.8, archname=i686-linux-thread-multi
     uname='linux acer 2.6.11.8 #1 sat apr 30 19:16:00 cest 2005 i686 unknown unknown gnulinux '
     config_args=''
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -I/usr/local/include'
     ccversion='', gccversion='3.3.4', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.3.4.so, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.3.4'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/opt/xi3/lib/perl5/5.8.6/i686-linux-thread-multi/CORE'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
   Built under linux
   Compiled at May  1 2005 21:29:27
   %ENV:
     PERL_LWP_USE_HTTP_10="1"
   @INC:
     /opt/xi3/lib/perl5/5.8.6/i686-linux-thread-multi
     /opt/xi3/lib/perl5/5.8.6
     /opt/xi3/lib/perl5/site_perl/5.8.6/i686-linux-thread-multi
     /opt/xi3/lib/perl5/site_perl/5.8.6
     /opt/xi3/lib/perl5/site_perl
     .

*** Packages of interest status:

Apache2         : -
Apache2::Request: -
CGI             : 3.05
LWP             : -
mod_perl        : -
mod_perl2       : 1.999023


3. This is the core dump trace: (if you get a core dump):

   [CORE TRACE COMES HERE]

This report was generated by /opt/xi3/bin/mp2bug on Thu May 19 18:53:06 2005 GMT.


Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
Herve Guillemet 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.
>>
>>
>> Works so far for me with your new patch.

Thank you, Herve. I've committed the fixes.

> Now I have a new problem with the patched version: no way to get the 
> value of the configuration directive at the server level.
> New test tarball attached.

That's a problem with the way your code is written. Please see the 
attached tarball that works. I suppose we need more examples at:
http://perl.apache.org/docs/2.0/user/config/custom.html
Please submit patches to improve those. You can find a complete coverage 
of the custom config API in the t/response/TestDirective/perlloadmodule* 
tests. Your case is covered by t/response/TestDirective/perlloadmodule.pm 
(see ServerTest).



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

Re: [mp2] Problem with custom config in Location

Posted by Herve Guillemet <hg...@apteryx.fr>.
>>>> 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.
>
> Works so far for me with your new patch.

Now I have a new problem with the patched version: no way to get the value 
of the configuration directive at the server level.
New test tarball attached.

Re: [mp2] Problem with custom config in Location

Posted by Herve Guillemet <hg...@apteryx.fr>.

On Fri, 20 May 2005, 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.

Works so far for me with your new patch.

Thanks,

Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
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@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] Problem with custom config in Location

Posted by Herve Guillemet <hg...@apteryx.fr>.
> 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.

Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Herve Guillemet wrote:
> 
>> New report:
> 
> [...]
> 
>> #22 0x08066b3d in worker_thread (thd=0x8231f18, dummy=0x0) at 
>> worker.c:835
>> #23 0x4010f2f1 in dummy_worker (opaque=0x0) at thread.c:105
>> #24 0x4019a54e in pthread_start_thread () from /lib/libpthread.so.0
>> #25 0x402a3b8a in clone () from /lib/libc.so.6
> 
> 
> Thanks for the perfect report, Herve :)
> 
> I'm now able to reproduce the problem with worker. I was first tested it 
> with prefork which worked just fine. I'm looking at it.

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)

Index: src/modules/perl/modperl_module.c
===================================================================
--- src/modules/perl/modperl_module.c	(revision 171124)
+++ src/modules/perl/modperl_module.c	(working copy)
@@ -165,10 +165,9 @@
      int is_startup;
      PTR_TBL_t *table;
      SV *mrg_obj = Nullsv, *base_obj, *add_obj;
-
  #ifdef USE_ITHREADS
+    MP_PERL_CONTEXT_DECLARE;
      modperl_interp_t *interp;
-    pTHX;
  #endif

      /* if the module is loaded in vhost, base==NULL */
@@ -184,7 +183,7 @@

  #ifdef USE_ITHREADS
      interp = modperl_interp_pool_select(p, s);
-    aTHX = interp->perl;
+    MP_PERL_CONTEXT_STORE_OVERRIDE(interp->perl);
  #endif

      table = modperl_module_config_table_get(aTHX_ TRUE);
@@ -240,6 +239,11 @@
          modperl_module_config_obj_cleanup_register(aTHX_ p, table, mrg);
      }

+#ifdef USE_ITHREADS
+    modperl_interp_unselect(interp);
+    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@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
Herve Guillemet wrote:
> New report:
[...]
> #22 0x08066b3d in worker_thread (thd=0x8231f18, dummy=0x0) at worker.c:835
> #23 0x4010f2f1 in dummy_worker (opaque=0x0) at thread.c:105
> #24 0x4019a54e in pthread_start_thread () from /lib/libpthread.so.0
> #25 0x402a3b8a in clone () from /lib/libc.so.6

Thanks for the perfect report, Herve :)

I'm now able to reproduce the problem with worker. I was first tested it 
with prefork which worked just fine. I'm looking at it.

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

Re: [mp2] Problem with custom config in Location

Posted by Herve Guillemet <hg...@apteryx.fr>.
New report:

---


1. Problem Description:

A custom apache config directive defined in a <Location> together with
a PerlResponseHandler makes the request handling crash (apache dumps 
core, see below).
Nothing printed in the error_log nor the access_log.

httpd.conf contains:
--------------------
PerlLoadModule Xi::TestConf

<Location /test>
  XiTest test
  SetHandler modperl
  PerlResponseHandler Xi::Test
</Location>

TestConf.pm:
------------
package Xi::TestConf;

use Apache2::Module ();

my @directives = ( { name         => 'XiTest' } );
Apache2::Module::add(__PACKAGE__, \@directives);

sub XiTest {
     my($self, $parms, $arg) = @_;
     $self->{XiTest} = $arg;
}

1;

Test.pm:
--------
package Xi::Test;

use Apache2::RequestIO ();

use Apache2::Const -compile => qw/OK/;

sub handler {
     my $r = shift;

     $r->print("Hello");

     return Apache::Const::OK;
}

1;


See attached bug tarball.


2. Used Components and their Configuration:

*** mod_perl version 2.000000

*** using /opt/xi3/lib/perl5/site_perl/5.8.6/i686-linux-thread-multi/Apache2/BuildConfig.pm

*** Makefile.PL options:
   MP_APR_LIB     => aprext
   MP_APXS        => /opt/xi3/bin/apxs
   MP_COMPAT_1X   => 0
   MP_DEBUG       => 1
   MP_GENERATE_XS => 1
   MP_LIBNAME     => mod_perl
   MP_TRACE       => 1
   MP_USE_DSO     => 1


*** The httpd binary was not found


*** (apr|apu)-config linking info

  -L/opt/xi3/lib -laprutil-0 -lgdbm -ldb -lexpat
  -L/opt/xi3/lib -lapr-0 -lrt -lm -lcrypt -lnsl  -lpthread -ldl



*** /opt/xi3/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
   Platform:
     osname=linux, osvers=2.6.11.8, archname=i686-linux-thread-multi
     uname='linux acer 2.6.11.8 #1 sat apr 30 19:16:00 cest 2005 i686 unknown unknown gnulinux '
     config_args='-Doptimize=-g -Dusethreads'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-g',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include'
     ccversion='', gccversion='3.3.4', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='gcc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.3.4.so, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.3.4'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/opt/xi3/lib/perl5/5.8.6/i686-linux-thread-multi/CORE'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
   Built under linux
   Compiled at May 20 2005 17:46:47
   %ENV:
     PERL_LWP_USE_HTTP_10="1"
   @INC:
     /opt/xi3/lib/perl5/5.8.6/i686-linux-thread-multi
     /opt/xi3/lib/perl5/5.8.6
     /opt/xi3/lib/perl5/site_perl/5.8.6/i686-linux-thread-multi
     /opt/xi3/lib/perl5/site_perl/5.8.6
     /opt/xi3/lib/perl5/site_perl
     .

*** Packages of interest status:

Apache2            : -
Apache2::Request   : -
CGI                : 3.05
ExtUtils::MakeMaker: 6.17
LWP                : 5.803
mod_perl           : -
mod_perl2          : 2.000000


3. This is the core dump trace: (if you get a core dump):

#0  0x4045d846 in Perl_safesysmalloc (size=22) at util.c:75
#1  0x4046de71 in S_save_hek_flags (my_perl=0x8277250,
     str=0xbf5ff514 "RequestRec::", len=12, hash=1405554878, flags=0) at 
hv.c:97
#2  0x40471994 in S_share_hek_flags (my_perl=0x8277250,
     str=0xbf5ff514 "RequestRec::", len=12, hash=1405554878, flags=0)
     at hv.c:2112
#3  0x4046f04a in S_hv_fetch_common (my_perl=0x8277250, hv=0x82d90f4,
     keysv=0x0, key=0xbf5ff514 "RequestRec::", klen=12, flags=0, action=12,
     val=0x82e90fc, hash=1405554878) at hv.c:765
#4  0x4046e394 in Perl_hv_fetch (my_perl=0x8277250, hv=0x82d90f4,
     key=0xbf5ff514 "RequestRec::", klen_i32=12, lval=1) at hv.c:333
#5  0x404097f7 in Perl_gv_fetchpv (my_perl=0x8277250,
     nambeg=0xbf5ff664 "Apache2::RequestRec::", add=1, sv_type=11) at 
gv.c:686
#6  0x40409552 in Perl_gv_stashpvn (my_perl=0x8277250,
     name=0x403d38e8 "Apache2::RequestRec", namelen=21, create=1) at 
gv.c:619
#7  0x404094a8 in Perl_gv_stashpv (my_perl=0x8277250,
     name=0x403d38e8 "Apache2::RequestRec", create=1) at gv.c:600
#8  0x404929b2 in Perl_newSVrv (my_perl=0x8277250, rv=0x8270898,
     classname=0x403d38e8 "Apache2::RequestRec") at sv.c:7752
#9  0x40492a3f in Perl_sv_setref_pv (my_perl=0x8277250, rv=0x8270898,
     classname=0x403d38e8 "Apache2::RequestRec", pv=0x83ba570) at sv.c:7784
#10 0x403b8274 in modperl_ptr2obj (my_perl=0x8277250,
     classname=0x403d38e8 "Apache2::RequestRec", ptr=0x83ba570)
#11 0x403b69ba in modperl_handler_make_args (my_perl=0x8277250, 
avp=0xbf5ff894)
     at modperl_handler.c:338
#12 0x403b5598 in modperl_callback_run_handlers (idx=6, type=4, 
r=0x83ba570,
     c=0x0, s=0x80a1ea0, pconf=0x0, plog=0x0, ptemp=0x0,
     run_mode=MP_HOOK_RUN_FIRST) at modperl_callback.c:221
#13 0x403b5b67 in modperl_callback_per_dir (idx=6, r=0x83ba570,
     run_mode=MP_HOOK_RUN_FIRST) at modperl_callback.c:368
#14 0x403ae189 in modperl_response_handler_run (r=0x83ba570, finish=1)
     at mod_perl.c:979
#15 0x403ae2a0 in modperl_response_handler (r=0x83ba570) at 
mod_perl.c:1019
#16 0x080697a6 in ap_run_handler (r=0x83ba570) at config.c:152
#17 0x08069d48 in ap_invoke_handler (r=0x83ba570) at config.c:364
#18 0x080652af in ap_process_request (r=0x83ba570) at http_request.c:249
#19 0x08060de9 in ap_process_http_connection (c=0x839f688) at 
http_core.c:251
#20 0x080727e6 in ap_run_process_connection (c=0x839f688) at 
connection.c:43
#21 0x08066464 in process_socket (p=0x839f560, sock=0x839f598,
     my_child_num=-1084228640, my_thread_num=0, bucket_alloc=0x83a1568)
     at worker.c:521
#22 0x08066b3d in worker_thread (thd=0x8231f18, dummy=0x0) at worker.c:835
#23 0x4010f2f1 in dummy_worker (opaque=0x0) at thread.c:105
#24 0x4019a54e in pthread_start_thread () from /lib/libpthread.so.0
#25 0x402a3b8a in clone () from /lib/libc.so.6


This report was generated by /opt/xi3/bin/mp2bug on Fri May 20 16:00:12 2005 GMT.

Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
Herve Guillemet wrote:
> 
> 
> On Thu, 19 May 2005, Stas Bekman wrote:
> 
>> Herve Guillemet wrote:
>>
>>>
>>> 1. Problem Description:
>>>
>>> A custom apache config directive defined in a <Location> together with
>>> a PerlResponseHandler makes the request handling crash.
>>
>>
>> Herve, have you considered to check the error_log before reporting a 
>> problem? Your code is improperly written and the error_log should have 
>> told you that. In the future please check that file first. Thank you.
>>
>> Please find an attached tarball with a testing setup that works.
> 
> 
> Hi Stas,
> 
> I have indeed forgotten to mention that there was absolutely nothing in 
> the error_log, nor in the access_log, about the crashed request.

Please mention that in the future :)

> Thanks for your answer and the testing setup . But this still does not 
> work in my environment. No core generated.
> 
> make test
[...]
> t/bug....skipped
>         all skipped: no reason given

as you can see the test wasn't run, it was skipped. You need to install 
LWP from CPAN. But this test should work w/o LWP too. Please try with this 
patch

diff -u bug.t.orig bug.t
--- bug.t.orig  2005-05-20 10:39:16.000000000 -0400
+++ bug.t       2005-05-20 10:39:31.000000000 -0400
@@ -5,7 +5,7 @@
  use Apache::TestRequest;
  use Apache::TestUtil;

-plan tests => 1, have_lwp;
+plan tests => 1;
  {
      my $response = GET '/test';


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

Re: [mp2] Problem with custom config in Location

Posted by Herve Guillemet <hg...@apteryx.fr>.

On Thu, 19 May 2005, Stas Bekman wrote:

> Herve Guillemet wrote:
>> 
>> 1. Problem Description:
>> 
>> A custom apache config directive defined in a <Location> together with
>> a PerlResponseHandler makes the request handling crash.
>
> Herve, have you considered to check the error_log before reporting a problem? 
> Your code is improperly written and the error_log should have told you that. 
> In the future please check that file first. Thank you.
>
> Please find an attached tarball with a testing setup that works.

Hi Stas,

I have indeed forgotten to mention that there was absolutely nothing in 
the error_log, nor in the access_log, about the crashed request.

Thanks for your answer and the testing setup . But this still does not 
work in my environment. No core generated.

make test
/opt/xi3/bin/perl -Iblib/arch -Iblib/lib t/TEST  -clean
[warning] setting ulimit to allow core files
ulimit -c unlimited; /opt/xi3/bin/perl 
/home/hg/bug-reporting-skeleton-mp2/t/TEST -clean
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= 
APACHE_TEST_APXS= /opt/xi3/bin/perl -Iblib/arch -Iblib/lib \
t/TEST  -bugreport -verbose=0
[warning] setting ulimit to allow core files
ulimit -c unlimited; /opt/xi3/bin/perl 
/home/hg/bug-reporting-skeleton-mp2/t/TEST -bugreport -verbose=0
/opt/xi3/bin/httpd  -d /home/hg/bug-reporting-skeleton-mp2/t -f 
/home/hg/bug-reporting-skeleton-mp2/t/conf/httpd.conf -D APACHE2 -D 
PERL_USEITHREADS
using Apache/2.0.54 (worker MPM)

waiting 60 seconds for server to start: ..
waiting 60 seconds for server to start: ok (waited 1 secs)
server localhost:8529 started
t/bug....skipped
         all skipped: no reason given
All tests successful, 1 test skipped.
Files=1, Tests=0,  0 wallclock secs ( 0.32 cusr +  0.01 csys =  0.33 CPU)
[warning] server localhost:8529 shutdown

% cat t/logs/error_log
[Fri May 20 09:55:16 2005] [info] mod_unique_id: using ip addr 10.0.0.6
[Fri May 20 09:55:17 2005] [notice] Digest: generating secret for digest 
authentication ...
[Fri May 20 09:55:17 2005] [notice] Digest: done
[Fri May 20 09:55:17 2005] [info] mod_unique_id: using ip addr 10.0.0.6
[Fri May 20 09:55:18 2005] [notice] Apache/2.0.54 (Unix) DAV/2 
mod_perl/1.999.23 Perl/v5.8.6 configured -- resuming normal operations
[Fri May 20 09:55:18 2005] [info] Server built: May  1 2005 13:33:18
[Fri May 20 09:55:18 2005] [debug] worker.c(1650): AcceptMutex: sysvsem 
(default: sysvsem)
[Fri May 20 09:55:18 2005] [info] removed PID file 
/home/hg/bug-reporting-skeleton-mp2/t/logs/httpd.pid (pid=1746)
[Fri May 20 09:55:18 2005] [notice] caught SIGTERM, shutting down
hg@acer:~/bug-reporting-skeleton-mp2 % cat t/logs/error_log
[Fri May 20 09:55:16 2005] [info] mod_unique_id: using ip addr 10.0.0.6
[Fri May 20 09:55:17 2005] [notice] Digest: generating secret for digest 
authentication ...
[Fri May 20 09:55:17 2005] [notice] Digest: done
[Fri May 20 09:55:17 2005] [info] mod_unique_id: using ip addr 10.0.0.6
[Fri May 20 09:55:18 2005] [notice] Apache/2.0.54 (Unix) DAV/2 
mod_perl/1.999.23 Perl/v5.8.6 configured -- resuming normal operations
[Fri May 20 09:55:18 2005] [info] Server built: May  1 2005 13:33:18
[Fri May 20 09:55:18 2005] [debug] worker.c(1650): AcceptMutex: sysvsem 
(default: sysvsem)
[Fri May 20 09:55:18 2005] [info] removed PID file 
/home/hg/bug-reporting-skeleton-mp2/t/logs/httpd.pid (pid=1746)
[Fri May 20 09:55:18 2005] [notice] caught SIGTERM, shutting down


cat t/logs/access_log
127.0.0.1 - - [20/May/2005:09:55:18 +0200] "GET /index.html HTTP/1.0" 200 828



Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
forgot the attachment.

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

Re: [mp2] Problem with custom config in Location

Posted by Stas Bekman <st...@stason.org>.
Herve Guillemet wrote:
> 
> 1. Problem Description:
> 
> A custom apache config directive defined in a <Location> together with
> a PerlResponseHandler makes the request handling crash.

Herve, have you considered to check the error_log before reporting a 
problem? Your code is improperly written and the error_log should have 
told you that. In the future please check that file first. Thank you.

Please find an attached tarball with a testing setup that works.

tar -xzvf bug-reporting-skeleton-mp2.tar.gz
cd bug-reporting-skeleton-mp2
perl Makefile.PL
make test
...
/home/stas/httpd/prefork/bin/httpd  -d /tmp/bug-reporting-skeleton-mp2/t 
-f /tmp/bug-reporting-skeleton-mp2/t/conf/httpd.conf -D APACHE2 -D 
PERL_USEITHREADS
using Apache/2.0.55-dev (prefork MPM)
waiting 60 seconds for server to start: ok (waited 1 secs)
server lapin.stason.org:8529 started
t/bug....ok
All tests successful.
Files=1, Tests=1,  1 wallclock secs ( 0.87 cusr +  0.07 csys =  0.94 CPU)
server lapin.stason.org:8529 shutdown


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