SegFault report with backtrace

2001-11-05 Thread karnurme


Hello!

Here is a simple Test.pm handler that causes segfaults in our server.

The Test.pm uses XS for creating configuration settings. The purpose is to
set 'Testing' flag on or off in .htaccess files. I tried to make the
module as simple as possible.

The specifications are in the attachments files. sf_install.txt contains
the information about the mod_perl compilation and the test
module. sf_case1.txt contains the backtrace in Mandrake 8.1 with perl
5.6.1 while the sf_case2.txt contains the backtrace from Debian 2.2 with
perl 5.005_3.

To sum up the attachments, the error_log gives warnings like:
[debug] mod_perl.c(1322): [warning] PerlFixupHandler stack is not an ARRAY!
and the backtrace gives information like:
... type=0x81264d4 SERVER_CREATE) at perl_config.c:896

The segfault problems seems to haunt me whenever I try to create new
configuration directives. In fact the different and unsolved segfaults
have made me test many combinations with different versions of linux, 
perl, apache and mod_perl during the last year. Maybe better luck with
solaris? Too bad that propably the fault lies with me.

Of course, I'm more than happy to test/give more info about the segfault
problem! Best wishes,
-- 

Kari Nurmela,
[EMAIL PROTECTED], (02) 333 8847 / (0400) 786 547
University of Turku, Finland



CASE 2
==
Debian 2.2 (stable)
Linux aura 2.2.19pre17-compact #1 Mon Apr 2 01:35:19 PDT 2001 i586 unknown

perl -V:

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.2.15pre14, archname=i386-linux
uname='linux them 2.2.15pre14 #2 smp mon mar 13 14:29:00 est 2000 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O2 ', gccversion=2.95.2 2313 (Debian GNU/Linux)
cppflags='-Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -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 -lndbm -lgdbm -ldbm -ldb -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 Apr 30 2000 12:08:38
  %ENV:
PERLPREFIX=/usr/local/wm5/perl
  @INC:
/usr/lib/perl5/5.005/i386-linux
/usr/lib/perl5/5.005
/usr/local/lib/site_perl/i386-linux
/usr/local/lib/site_perl
/usr/lib/perl5
.

BACKTRACE
=
[karnurme@sapphire apache]$ gdb /usr/local/wm5/apache/bin/httpd
(gdb) run -X -f /usr/local/wm5/apache/conf/httpd.conf -d /usr/local/wm5/apache
Starting program: /usr/local/wm5/apache/bin/httpd -X -f 
/usr/local/wm5/apache/conf/httpd.conf -d /usr/local/wm5/apache
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols 
found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols 
found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols 
found)...
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x807dad2 in perl_get_module_ptr ()
(gdb) bt
#0  0x807dad2 in perl_get_module_ptr ()
#1  0x807ddb5 in perl_get_module_ptr ()
#2  0x807e132 in perl_cmd_perl_TAKE123 ()
#3  0x807da09 in perl_cmd_perl_FLAG ()
#4  0x8097e84 in ap_clear_module_list ()
#5  0x8098151 in ap_handle_command ()
#6  0x80981ed in ap_srm_command_loop ()
#7  0x8098a92 in ap_parse_htaccess ()
#8  0x80aa022 in ap_send_error_response ()
#9  0x80ab457 in ap_some_auth_required ()
#10 0x80ab916 in ap_process_request ()
#11 0x80a2880 in ap_child_terminate ()
#12 0x80a2a41 in ap_child_terminate ()
#13 0x80a2bbc in ap_child_terminate ()
#14 0x80a322c in ap_child_terminate ()
#15 0x80a3a5c in main ()
#16 0x400d4a42 in __libc_start_main () from /lib/libc.so.6
(gdb)

karnurme@aura:~/wm5$ less apache/logs/error_log
[Mon Nov  5 17:02:45 2001] [notice] Apache/1.3.20 (Unix) mod_perl/1.26 configured -- 
resuming normal operations
[Mon Nov  5 17:03:22 2001] [notice] child pid 12686 exit signal Segmentation fault 
(11), possible coredump in /usr/local/wm5/apache

BACKTRACE WITH NEW LIBPERL
==
cd apache_1.3.20/src/modules/perl
rm *.[oa]
make LIBPERL=libperld.a
cp libperl.a /usr/lib/perl5/5.005/i386-linux/
cd mod_perl-1.26/
make install

(gdb) run -X -f `pwd`/t/conf/httpd.conf 

Re: SegFault report with backtrace

2001-11-05 Thread Ged Haywood

Hi there,

On Mon, 5 Nov 2001 [EMAIL PROTECTED] wrote:

 Here is a simple Test.pm handler that causes segfaults in our server.

Last year I had a Test.pm that caused segfaults too, on Solaris boxes.

By accident I discovered that the segfaults went away when I renamed
the file!  At the time I was doing some work for a company in London,
on a very tight schedule, so I never got the chance to investigate
further.  I sent a stack backtrace to Eric but we never got to the
bottom of it.

73,
Ged.