After serving up requests normally for some time, we get the following
line in our error_log:

[Mon Nov 10 13:44:31 2003] [notice] child pid 24121 exit signal
Segmentation fault (11)

There aren't any other entries in the error log for the requests.  We
think that this is happening during the normal termination of the child
process (after serving MaxRequestsPerChild requests, or exceeding
GTopLimit limits).  The segfaults were happening before we added the
GTopLimit configuration.

Has anybody seen this behavior before?  I can send more information if
needed.

Thanks

Useful information:

perl -V reports:
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.20-8smp, archname=i686-linux
    uname='linux ooghij 2.4.20-8smp #1 smp thu mar 13 17:45:54 est 2003
i686 i686 i386 gnulinux '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O3',
    cppflags='-fno-strict-aliasing -I/usr/include/gdbm'
    ccversion='', gccversion='3.2.2 20030222 (Red Hat Linux 3.2.2-5)',
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 -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  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 Jul 31 2003 13:36:56
  @INC:
    /usr/local/lib/perl5/5.8.0/i686-linux
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl
    .

The version of mod perl we are running is 1.28, with apache 1.28.

We built mod_perl with:
perl Makefile.PL \
APACHE_SRC=../apache_1.3.28/src \
APACHE_PREFIX=/usr/skynet \
DO_HTTPD=1 \
USE_APACI=1 \
EVERYTHING=1 \
APACI_ARGS='--disable-rule=EXPAT --disable-module=env
--disable-module=negotiation --disable-module=status
--disable-module=include --disable-module=autoindex
--disable-module=asis --disable-module=imap --disable-module=actions
--disable-module=userdir --disable-module=setenvif' 

The relevant portion of the httpd.conf file:
<VirtualHost 192.168.1.x:80>
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /usr/skynet/htdocs
ServerName skynet.whapps.com
Alias /icons/ "/usr/skynet/htdocs"
PerlTransHandler        Skynet::TransHandler
ErrorDocument 401 /authfail.html
<Directory /usr/skynet/htdocs>
        AuthName "Password Protected Area"
        AuthType Basic
        PerlAuthenHandler Skynet::AuthenHandler
        require valid-user
        PerlSetVar Apache::GTopLimit::DEBUG 1
        PerlFixupHandler Apache::GTopLimit
        PerlHandler Skynet::Handler
</Directory>
</VirtualHost>

The startup.pl file:
#!/usr/bin/perl
 
use strict;
use Skynet::Util;
use Apache::GTopLimit;
use Skynet::Handler;
use Apache::DBI;
 
# Control the life based on memory size
# in KB, so this is ~10MB
$Apache::GTopLimit::MAX_PROCESS_SIZE = 20000;
 
# Make sure we are in a sane environment.
$ENV{MOD_PERL} or die "not running under mod_perl!";
   
# Initialize the database connections for each child
#$Apache::DBI::DEBUG = "3";
my
$Dbh=Apache::DBI->connect_on_init("dbi:mysql:dbname=skynet;host=x.com;","user","pass",
                                {AutoCommit => 1, RaiseError => 1});
 
1;



A backtrace when the segfault occurs:
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) run -X -f /usr/skynet/conf/httpd.conf
Starting program: /usr/skynet/bin/httpd -X -f
/usr/skynet/conf/httpd.conf
  
Program received signal SIGSEGV, Segmentation fault.
0x0807698b in hvrv2table (rv=0x0) at perl_util.c:101
101         return (table *)SvIV((SV*)SvRV(rv));
(gdb) bt
#0  0x0807698b in hvrv2table (rv=0x0) at perl_util.c:101
#1  0x08088995 in XS_Apache__Table_DESTROY (cv=0x81ae5dc) at Table.c:149
#2  0x0810b6c9 in Perl_pp_entersub ()
#3  0x080ba314 in S_call_body ()
#4  0x080ba0ee in Perl_call_sv ()
#5  0x08112b2b in Perl_sv_clear ()
#6  0x08112d53 in Perl_sv_free ()
#7  0x08117995 in Perl_sv_clean_objs ()
#8  0x080b89f8 in perl_destruct ()
#9  0x0806bd6c in perl_shutdown (s=0x819e12c, p=0x8df749c) at
mod_perl.c:294
#10 0x0806ff43 in perl_child_exit_cleanup (data=0x80000) at
mod_perl.c:926
#11 0x0808a8e4 in run_cleanups (c=0x8df7634) at alloc.c:1745
#12 0x08089183 in ap_clear_pool (a=0x8df749c) at alloc.c:541
#13 0x08089200 in ap_destroy_pool (a=0x8df749c) at alloc.c:571
#14 0x080965ce in clean_child_exit (code=0) at http_main.c:528
#15 0x0809942d in child_main (child_num_arg=0) at http_main.c:4367
#16 0x080999ba in make_child (s=0x819e12c, slot=0, now=1068483979) at
http_main.c:4768
#17 0x08099b20 in startup_children (number_to_start=5) at
http_main.c:4850
#18 0x0809a1bd in standalone_main (argc=4, argv=0xbfffead4) at
http_main.c:5169
#19 0x0809a9db in main (argc=4, argv=0xbfffead4) at http_main.c:5511
#20 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) list
5511            STANDALONE_MAIN(argc, argv);
5512        }
5513    #else
5514        if (!tpf_child) {
5515            memcpy(tpf_server_name, input_parms.parent.servname,
5516                   INETD_SERVNAME_LENGTH);
5517            tpf_server_name[INETD_SERVNAME_LENGTH + 1] = '\0';
5518            sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1,
getpid());
5519            tpf_parent_pid = getppid();
5520            ap_open_logs(server_conf, plog);
(gdb)

Marc Slagle
Whapps, LLC


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to