You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Michael J Schout <ms...@gkg.net> on 2000/07/19 18:34:21 UTC

segmentation fault with CGI::Application

I have been trying to get CGI::Application to work under mod_perl today.  So
far with no success.

Finally I removed everything except CGI::Application from the config files, and
the server dumps core on startup. 

I have a very stripped odwn httpd.conf that basically loads the bare minimum
apache modules, then does "PerlModule CGI::Appliation".

Starting httpd dumps core when it tries to start up.

Running it through the debugger produces this:

This GDB was configured as "i386-redhat-linux"...
Core was generated by `httpd -f /nis.home/mschout/dev/gkgdrs/gkgnsi/conf/redirect/httpd.conf'.
Program terminated with signal 11, Segmentation fault.
....
#0  0x80ad4d2 in Perl_gv_init ()
(gdb) bt
#0  0x80ad4d2 in Perl_gv_init ()
#1  0x80ae690 in Perl_gv_fetchpv ()
#2  0x806a0a5 in perl_section_hash_init ()
#3  0x806a375 in perl_section ()
#4  0x806a16d in perl_section_self_boot ()
#5  0x8068033 in perl_cmd_module ()
#6  0x8080519 in invoke_cmd ()
#7  0x808089c in ap_handle_command ()
#8  0x80808e8 in ap_srm_command_loop ()
#9  0x8080c57 in ap_process_resource_config ()
#10 0x80812e4 in ap_read_config ()
#11 0x8088bc5 in main ()
#12 0x400d79cb in __libc_start_main (main=0x80889e0 <main>, argc=3, 
    argv=0xbffff904, init=0x8062c24 <_init>, fini=0x8123e1c <_fini>, 
		rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffff8fc)
		at ../sysdeps/generic/libc-start.c:92

Taking out the "PerlModule CGI::Application" line causes the server to start up normally. 

Taking a quick glance through Application.pm, I dont see anything that should
be causing the interpreter to freak out.  I suspect the problem is outside of
CGI::Application somewhere, but CGI::Application is demonstrating some bug here
;).

Anyone have any ideas?

I'm using:

perl 5.6.0
mod_perl 1.24
Linux 2.2.x

Has anyone else gotten CGI::Application to run in this environment?  Anyone
else seen this?

Mike


Re: segmentation fault with CGI::Application [SOLVED]

Posted by Michael J Schout <ms...@gkg.net>.
Ok.

Turns out that what the real problem here was that CGI::Application uses
CGI::Carp, and I needed a newer version of CGI::Carp.

So I seem to have sovled this :)

Mike

On Wed, 19 Jul 2000, Michael J Schout wrote:

> I have been trying to get CGI::Application to work under mod_perl today.  So
> far with no success.
> 
> Finally I removed everything except CGI::Application from the config files, and
> the server dumps core on startup. 
> 
> I have a very stripped odwn httpd.conf that basically loads the bare minimum
> apache modules, then does "PerlModule CGI::Appliation".
> 
> Starting httpd dumps core when it tries to start up.
> 
> Running it through the debugger produces this:
> 
> This GDB was configured as "i386-redhat-linux"...
> Core was generated by `httpd -f /nis.home/mschout/dev/gkgdrs/gkgnsi/conf/redirect/httpd.conf'.
> Program terminated with signal 11, Segmentation fault.
> ....
> #0  0x80ad4d2 in Perl_gv_init ()
> (gdb) bt
> #0  0x80ad4d2 in Perl_gv_init ()
> #1  0x80ae690 in Perl_gv_fetchpv ()
> #2  0x806a0a5 in perl_section_hash_init ()
> #3  0x806a375 in perl_section ()
> #4  0x806a16d in perl_section_self_boot ()
> #5  0x8068033 in perl_cmd_module ()
> #6  0x8080519 in invoke_cmd ()
> #7  0x808089c in ap_handle_command ()
> #8  0x80808e8 in ap_srm_command_loop ()
> #9  0x8080c57 in ap_process_resource_config ()
> #10 0x80812e4 in ap_read_config ()
> #11 0x8088bc5 in main ()
> #12 0x400d79cb in __libc_start_main (main=0x80889e0 <main>, argc=3, 
>     argv=0xbffff904, init=0x8062c24 <_init>, fini=0x8123e1c <_fini>, 
> 		rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffff8fc)
> 		at ../sysdeps/generic/libc-start.c:92
> 
> Taking out the "PerlModule CGI::Application" line causes the server to start up normally. 
> 
> Taking a quick glance through Application.pm, I dont see anything that should
> be causing the interpreter to freak out.  I suspect the problem is outside of
> CGI::Application somewhere, but CGI::Application is demonstrating some bug here
> ;).
> 
> Anyone have any ideas?
> 
> I'm using:
> 
> perl 5.6.0
> mod_perl 1.24
> Linux 2.2.x
> 
> Has anyone else gotten CGI::Application to run in this environment?  Anyone
> else seen this?
> 
> Mike
> 


Re: segmentation fault with CGI::Application

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 19 Jul 2000, Michael J Schout wrote:

> I have been trying to get CGI::Application to work under mod_perl today.  So
> far with no success.
> 
> Finally I removed everything except CGI::Application from the config files, and
> the server dumps core on startup. 
> 
> I have a very stripped odwn httpd.conf that basically loads the bare minimum
> apache modules, then does "PerlModule CGI::Appliation".
> 
> Starting httpd dumps core when it tries to start up.
> 
> Running it through the debugger produces this:

i think this is one of the bugs fixed by the Perl patch (which will be 
in 5.6.1), see:
http://forum.swarthmore.edu/epigone/modperl/dilkhumyox/200008110955.KAA12277@tiree.fdgroup.co.uk

the patch below to mod_perl might also fix it.

--- perl_util.c~	Tue Jun 13 10:25:38 2000
+++ perl_util.c	Tue Jun 13 11:16:45 2000
@@ -547,12 +547,14 @@
 {
     dTHR;
     SV *sv = sv_newmortal();
+    COP *old_cop = curcop;
     dTHRCTX;
 
     sv_setpvn(sv, "require ", 8);
     MP_TRACE_d(fprintf(stderr, "loading perl module '%s'...", name)); 
     sv_catpv(sv, name);
     perl_eval_sv(sv, G_DISCARD);
+    curcop = old_cop;
     if(s) {
 	if(perl_eval_ok(s) != OK) {
 	    MP_TRACE_d(fprintf(stderr, "not ok\n"));