You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jamie Krasnoo <we...@planetphat.com> on 2000/08/04 05:41:20 UTC

Seg fault (11) backtrace (long email) - was RE: does anyone have a fix for this?

Perl -V output:

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.5-22smp, archname=i386-linux
    uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
09:11:51 edt 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2 -m486 -fno-strength-reduce',
gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under linux
  Compiled at Feb  2 2000 15:35:58
  @INC:
    /usr/lib/perl5/5.00503/i386-linux
    /usr/lib/perl5/5.00503
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005


Apache version 1.3.12.


mod_perl version 1.24

Options:

EVERYTHING=1 APACHE_SRC=../apache-1.3.12/src USE_APACI=1 DO_HTTPD=1
PERL_DEBUG=1 \
APACI_ARGS='--with-layout=RedHat --enable-module=rewrite --enable-module=inf
o --enable-module=usertrack --enable-module=unique_id'

test results:
All tests successful, 4 tests skipped.
Files=34,  Tests=418, 27 wallclock secs (21.67 cusr +  2.58 csys = 24.25
CPU)
kill `cat t/logs/httpd.pid`
rm -f t/logs/httpd.pid
rm -f t/logs/error_log


Ok, Heres the backtrace I did.

Program received signal SIGSEGV, Segmentation fault.
0x8086ef0 in perl_handler_ismethod ()
(gdb) bt
#0  0x8086ef0 in perl_handler_ismethod ()
#1  0x8087bc3 in perl_call_handler ()
#2  0x80875cb in perl_run_stacked_handlers ()
#3  0x80859bd in perl_handler ()
#4  0x80a1db3 in ap_invoke_handler ()
#5  0x80b5289 in ap_some_auth_required ()
#6  0x80b52ec in ap_process_request ()
#7  0x80acbde in ap_child_terminate ()
#8  0x80acd6c in ap_child_terminate ()
#9  0x80acec9 in ap_child_terminate ()
#10 0x80ad4f6 in ap_child_terminate ()
#11 0x80adc83 in main ()
#12 0x400d09cb in __libc_start_main (main=0x80ad93c <main>, argc=4,
argv=0xbffffb74, init=0x8060180 <_init>,
    fini=0x81271fc <_fini>, rtld_fini=0x4000ae60 <_dl_fini>,
stack_end=0xbffffb6c) at ../sysdeps/generic/libc-start.c:92

I also did an strace I hope its of some help -

gettimeofday({965330042, 362731}, NULL) = 0
stat("/web/myeboard/markup/html/hello", 0xbffff93c) = -1 ENOENT (No such
file or directory)
stat("/web/myeboard/markup/html", {st_mode=S_IFDIR|0775, st_size=4096, ...})
= 0
open("/web/myeboard/markup/html/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 5
fstat(5, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
getdents(5, /* 5 entries */, 3933)      = 96
getdents(5, /* 0 entries */, 3933)      = 0
close(5)                                = 0
rt_sigaction(SIGALRM, NULL, {0x80aa050, [], SA_INTERRUPT|0x4000000}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/web/myeboard/perl/app/hello.pm", O_RDONLY) = 5
fstat64(0x5, 0xbfffd0e8)                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x401b0000
read(5, "package hello;\n\nuse strict;\nuse "..., 4096) = 364
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(5, "", 4096)                       = 0
close(5)                                = 0
munmap(0x401b0000, 4096)                = 0
--- SIGSEGV (Segmentation fault) ---

I think I know what the problem is. If the module doesn't have its directory
in the package declaration, it will seg fault. If its there, it runs fine.
But even so, the server should give an error and complain that it can't find
&app::hello::handler instead of segmenting.

The problem can be replicated with a simple hello world module.

in the conf file is this

<Location /hello>
     SetHandler perl-script
     PerlHandler app::hello
</Location>

with the directory structure as

/home/httpd/perl/app

and the hello.pm residing in app. Run with the package declaration as
"package app::hello;"
then as "package hello;" <-- should seg fault on this one and single server
should die.

I tried this with both stock RedHat kernel and 2.4.0-test5 kernel, same
results both seg fault and tests normal.

Still learning,

Jamie Krasnoo

I apologize for the lengthy email.


-----Original Message-----
From: Eric Cholet [mailto:cholet@logilune.com]
Sent: Thursday, August 03, 2000 3:28 AM
To: Jamie Krasnoo
Cc: Mod_Perl
Subject: Re: does anyone have a fix for this?


> Hello all,
>
> I'm new to the list and I'm hoping that someone could help me and explain
> what I'm doing wrong or how to fix this
>
>
> I recently compiled mod_perl-1.24 and it can run modules that I program.
> However I get a segmentation fault (11) when I use a :: to describe where
> the module is.
>
> Example
>
> This works fine -
>
> <Location /hello>
>   SetHandler perl-script
>   PerlHandler hello
> </Location>
>
>
> This causes the horrible [Wed Aug  2 22:34:30 2000] [notice] child pid
4433
> exit signal Segmentation fault (11)

Please read the SUPPORT file from the mod_perl distribution for information
on how to supply a backtrace so we can investigate the segfault.

Thanks,

--
Eric


Re: Seg fault (11) backtrace (long email) - was RE: does anyone have a fix for this?

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 3 Aug 2000, Jamie Krasnoo wrote:
 
> Program received signal SIGSEGV, Segmentation fault.
> 0x8086ef0 in perl_handler_ismethod ()

yes, cvs should fix this, here's the diff:

--- mod_perl.c  2000/05/25 18:06:23     1.121
+++ mod_perl.c  2000/06/02 17:23:07     1.122
@@ -1222,7 +1222,7 @@
     }
 
 #ifdef CVf_METHOD
-    if (CvFLAGS(cv) & CVf_METHOD) {
+    if (cv && (CvFLAGS(cv) & CVf_METHOD)) {
         is_method = 1;
     }
 #endif