You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Alex Vandiver <va...@tiac.net> on 2000/12/10 23:03:15 UTC

mod_perl segfault

Heya --
 Please 'scuse in advance the long post -- it had to be to fit in all of
the information asked for (better too much than too little, I hope). 
Anyways, I've run into an intermittent segfault problem with mod_perl
(Version 1.24).  It causes the Apache (version 1.3.12) process to die:
[Sun Dec 10 03:12:10 2000] [notice] child pid 18227 exit signal
Segmentation fault (11)

Here's my perl -V:
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.12-20, archname=i586-linux
    uname='linux melnorme 2.2.12-20 #1 mon sep 27 10:25:54 edt 1999 i586
unknown '
    config_args='-s'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, 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):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Sep  6 2000 23:47:54
  @INC:
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl

As I said above, this is mod_perl 1.24, running under Apache 1.3.12  The
same error also happened with Apache 1.3.9, however.  I built mod_perl
with:
perl Makefile.PL APACHE_PREFIX=/usr/local/apache
APACHE_SRC=../apache_1.3.14/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
APACI_ARGS='--with-layout=RedHat --verbose' PERL_DEBUG=1

I caught a backtrace of the segfault:
(gdb) run -X -D -f `pwd`/t/conf/httpd.conf -d `pwd`/t
Starting program:
/usr/src/redhat/SOURCES/mod_perl-1.24_01/../apache_1.3.14/src/httpd -X
-D -f `pwd`/t/conf/httpd.conf -d `pwd`/t

Program received signal SIGSEGV, Segmentation fault.
0x400cade7 in Perl_sv_setsv () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
(gdb) bt
#0  0x400cade7 in Perl_sv_setsv () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#1  0x400c09e8 in Perl_pp_sassign () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#2  0x400c052d in Perl_runops_standard () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#3  0x4007e36a in S_call_body () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#4  0x4007de2d in perl_call_sv () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#5  0x400b5230 in Perl_vdie () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#6  0x400b5391 in Perl_die () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#7  0x400e91dd in Perl_pp_require () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#8  0x400c052d in Perl_runops_standard () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#9  0x4007e36a in S_call_body () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#10 0x4007e0ab in perl_call_sv () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#11 0x40080f1e in S_call_list_body () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#12 0x40080bcc in Perl_call_list () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#13 0x400a2f85 in Perl_newATTRSUB () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#14 0x400a0087 in Perl_utilize () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#15 0x400993cd in Perl_yyparse () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#16 0x400e82a3 in S_doeval () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#17 0x400e99c3 in Perl_pp_entereval () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#18 0x400c052d in Perl_runops_standard () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#19 0x4007e36a in S_call_body () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#20 0x4007e0ab in perl_call_sv () from
/usr/local/lib/perl5/5.6.0/CORE/libperl.so
#21 0x8070deb in perl_call_handler (sv=0x86355f4, r=0x864bd44, args=0x0)
at mod_perl.c:1663
#22 0x80705fb in perl_run_stacked_handlers (hook=0x80ba419
"PerlHandler", r=0x864bd44, handlers=0x8638c70) at mod_perl.c:1382
#23 0x806eb9d in perl_handler (r=0x864bd44) at mod_perl.c:908
#24 0x808b563 in ap_invoke_handler (r=0x864bd44) at http_config.c:516
#25 0x809ee09 in process_request_internal (r=0x864bd44) at
http_request.c:1282
#26 0x809ee6c in ap_process_request (r=0x864bd44) at http_request.c:1298
#27 0x809674e in child_main (child_num_arg=0) at http_main.c:4203
#28 0x80968dc in make_child (s=0x80d7bd4, slot=0, now=976482722) at
http_main.c:4307
#29 0x8096a39 in startup_children (number_to_start=4) at
http_main.c:4389
#30 0x8097066 in standalone_main (argc=7, argv=0xbffffbd4) at
http_main.c:4677
#31 0x80977f3 in main (argc=7, argv=0xbffffbd4) at http_main.c:5004

The error happens at unpredictable times -- resending the same request
may or may not segfault again -- but it always works eventually.  The
file being run is a base install of Everything ( http://everydevel.com/
) -- so the code is known to work -- at least with slightly different
versions of things than I run.  I suspect that the error lies somewhere
with Perl 5.6.  Here's the relevant section from httpd.conf (addresses
obfuscated to protect the guilty):
<VirtualHost 12.34.56.78>
  ServerName segfault.example.com
  DocumentRoot /home/httpd/host
  ErrorLog  /var/log/httpd/host-error_log
  CustomLog /var/log/httpd/host-access_log commonuser

  <Location />
    Options Indexes FollowSymLinks ExecCGI
    DirectoryIndex index.html index.pl
    AllowOverride None
    order allow,deny
    allow from all
    AddHandler perl-script pl
    PerlModule Apache::DBI
    PerlHandler Apache::Registry
    PerlSetupEnv On
  </Location>

  <Location /images>
    SetHandler default-handler
    Options FollowSymLinks
  </Location>
</VirtualHost>

As you can guess, mod_perl is not a DSO, and I'm not using mod_php,
etc.  The only other possibly applicable fact is that LD_LIBRARY_PATH
needed to get set (/usr/local/lib/perl5/5.6.0/CORE) in order for
mod_perl to compile, as well as for Apache to run.  I don't know if this
is unusual or not..
  Anyways, hope that someone has an inkling as to what's going on here.
Many thanks,
  -Alex Vandiver