Hi list,
1. Problem Description:
I'm getting a variety of segfault conditions when I try to use an
output filter in conjunction with a ModPerl::Registry script. This is
highly repeatable; a freshly started httpd will segfault 3 times out
of 4.
If I turn off the output filter, the script runs just fine. If I run
the script under mod_cgi with the output filter enabled, it runs just
fine. Just fine = thousands of requests.
Also, if I use httpd -X, there are no segfaults with both
ModPerl::Registry and the output filter enabled. I have been unable
to get the server to generate a core file so far.
My error log contains entries as follows. These errors seem to occur
for each Apache prefork'd child except the initial process, and they
seem to appear at random, although the segfault errors appear 10-15
times as often as the others:
[Sun Oct 26 17:07:41 2003] [error] [client 192.168.1.1] Error reading
'/web/htdocs/gallery.cgi': 9:Bad file descriptor at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm
line 528.
[Sun Oct 26 17:09:11 2003] [error] [client 192.168.1.1] Error: read 1 bytes,
expected 6333 ('/web/htdocs/gallery.cgi') at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm
line 528.
[Sun Oct 26 17:15:32 2003] [error] [client 192.168.1.1] Error: read 1 bytes,
expected 6333 ('/web/htdocs/gallery.cgi') at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm
line 528.
[Sun Oct 26 17:15:44 2003] [notice] child pid 26289 exit signal Segmentation fault
(11)
[Sun Oct 26 17:16:07 2003] [notice] child pid 26290 exit signal Segmentation fault
(11)
[Sun Oct 26 17:16:13 2003] [notice] child pid 26287 exit signal Segmentation fault
(11)
My output filter uses Template Toolkit, and makes a connection to a
MySQL database, but is otherwise nothing special. It uses a handler
based very closely on the example in the mp2 docs (thanks Stas!).
2. Used Components and their Configuration:
RedHat Linux 9, kernel 2.4.20-20.9 on a Celeron 300A box with 256megs
of RAM, 512megs of swap (don't cringe), manually-built Apache and
modperl, as follows.
*** mod_perl version 1.9910
*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
MP_AP_PREFIX => /web/httpd
MP_COMPAT_1X => 1
MP_GENERATE_XS => 1
MP_INST_APACHE2 => 1
MP_LIBNAME => mod_perl
MP_USE_DSO => 1
MP_USE_STATIC => 1
*** /web/httpd/bin/httpd -V
Server version: Apache/2.0.47
Server built: Sep 21 2003 01:41:05
Server's Module Magic Number: 20020903:4
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_PROC_PTHREAD_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/web/httpd"
-D SUEXEC_BIN="/web/httpd/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.21-1.1931.2.382.entsmp, archname=i386-linux-thread-multi
uname='linux str'
config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686
-Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc.
-Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr
-Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm
-Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005
-Uversiononly -Dpager=/usr/bin/less -isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef'
useithreads=define usemultiplicity=
useperlio= d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=un uselongdouble=
usemymalloc=, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm',
optimize='',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING
-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.2.2 20030222 (Red Hat Linux 3.2.2-5)', gccosandvers=''
gccversion='3.2.2 200302'
intsize=r, longsize=r, ptrsize=5, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long'
k', ivsize=4'
ivtype='l, nvtype='double'
o_nonbl', nvsize=, Off_t='', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc'
l', ldflags =' -L/u'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libper
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef, ccdlflags='-rdynamic
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC'
ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s Unicode/Normalize XS/A'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
Locally applied patches:
MAINT18379
Built under linux
Compiled at Aug 13 2003 11:47:58
%ENV:
PERL_LWP_USE_HTTP_10="1"
@INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.
3. This is the core dump trace: (if you get a core dump):
I have been unable to get a core dump.
This report was generated by t/REPORT on Tue Oct 28 07:39:21 2003 GMT.
--
// 2 _____________________________________________________________
// / \
\\/ / | "I think not," said Descartes, and promptly disappeared. |
\\/ \_________________________________ __________________________/
Ewan Edwards {e^2}, [EMAIL PROTECTED] |/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]