Re: apache segfaults on mod_perl dlclose

1999-12-14 Thread Saar Picker


So I've been reading. I've actually then gone on to test it with a non-DSO
mod_perl and still get segfaults in the cleanup handling phase. I think
the two errors may be related. I'm attaching The output from 
MOD_PERL_TRACE=all (had to set PERL_FREE=0 since it was giving way too
many error messages.

Hope this helps. This problem is really hampering my work at the moment.
Let me know if there's anything else I should try.

-Saar

On Tue, 14 Dec 1999, Doug MacEachern wrote:

 mod_perl+dso is not a stable mix, try linking mod_perl static.
 
 On Fri, 10 Dec 1999, Saar Picker wrote:
 
  
  Hi,
  
  After building apache with --shared-module=max and building mod_perl using
  apxs, I get some strange behavior. I've also built my perl with -g
  -DDEBUGGING.
  
  On starting the web server, I get a bunch of "Bad free() ignored."
  messages that seem to occur at the end of every block of perl code (ie.
  scripts, loaded modules, etc.). Then the server segfaults. Using httpd -X
  and gdb I've found that it cores when trying to do a dlclose() on the
  mod_perl shared library.
  
  Does anyone have an insights as to what might be happening? Backtrace
  below.
  
  Thanks,
  -Saar Picker
  
  Backtrace:
  
  (gdb) bt
  #0  0x401f4624 in ?? ()
  #1  0x4009d0c0 in dlclose_doit (handle=0x80b5fb0) at dlclose.c:26
  #2  0x4000a12b in _dl_catch_error (errstring=0x4009ed00, 
  operate=0x4009d0a8 dlclose_doit, args=0x80b5fb0) at dl-error.c:141
  #3  0x4009d608 in _dlerror_run (operate=0x4009d0a8 dlclose_doit, 
  args=0x80b5fb0) at dlerror.c:122
  #4  0x4009d08e in dlclose (handle=0x80b5fb0) at dlclose.c:32
  #5  0x806f590 in ap_os_dso_unload (handle=0x80b5fb0) at os.c:130
  #6  0x804f280 in unload_module (modi=0x80ad2d4) at mod_so.c:181
  #7  0x805102e in run_cleanups (c=0x80ae05c) at alloc.c:1706
  #8  0x804f85d in ap_clear_pool (a=0x80ad0dc) at alloc.c:531
  #9  0x805f803 in standalone_main (argc=4, argv=0xb954) at
  http_main.c:4469
  #10 0x8060093 in main (argc=4, argv=0xb954) at http_main.c:4830
  #11 0x400b7cb3 in __libc_start_main (main=0x805fd5c main, argc=4, 
  argv=0xb954, init=0x804e890 _init, fini=0x8093d6c _fini, 
  rtld_fini=0x4000a350 _dl_fini, stack_end=0xb94c)
  at ../sysdeps/generic/libc-start.c:78
  
  
  
 


loading perl module 'Apache'...ok
perl_startup: perl aleady running...ok
loading perl module 'Apache'...ok
cleanup_av: SvREFCNT(0x81c8c14)==1
cleanup_av: SvREFCNT(0x819102c)==1
cleanup_av: SvREFCNT(0x819138c)==1
cleanup_av: SvREFCNT(0x8184ba4)==1
cleanup_av: SvREFCNT(0x8191074)==1
cleanup_av: SvREFCNT(0x8191020)==1
cleanup_av: SvREFCNT(0x81076c0)==1
cleanup_av: SvREFCNT(0x81076f0)==1
cleanup_av: SvREFCNT(0x81076d8)==1
loading perl module 'Apache'...ok
[Tue Dec 14 09:28:11 1999] [error] Cannot remove module mod_perl.c: not found in 
module list
perl_cmd_warn: 1
perl_cmd_tainting: 1
perl_cmd_setenv: 'PERLDB_OPTS' = 'NonStop=1 LineInfo=/tmp/db.out AutoTrace=1 frame=2'
loading perl module 'Apache'...ok
loading perl module 'Apache::DB'...ok
perl_cmd_fresh_restart: 0
perl_cmd_require: /usr/home/saarp/test/apache/perl/startup.pl
attempting to require `/usr/home/saarp/test/apache/perl/startup.pl'
init `PerlTransHandler' stack
perl_cmd_push_handlers: @PerlTransHandler, 'Apache::UriHandler'
pushing `Apache::UriHandler' into `PerlTransHandler' handlers
init `PerlLogHandler' stack
perl_cmd_push_handlers: @PerlLogHandler, 'Apache::LogDBI'
pushing `Apache::LogDBI' into `PerlLogHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Registry'
pushing `Apache::Registry' into `PerlHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::AXML'
pushing `Apache::AXML' into `PerlHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Logon'
pushing `Apache::Logon' into `PerlHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Logout'
pushing `Apache::Logout' into `PerlHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Error'
pushing `Apache::Error' into `PerlHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::Error'
pushing `Apache::Error' into `PerlHandler' handlers
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::PlaySong'
pushing `Apache::PlaySong' into `PerlHandler' handlers
loading perl module 'Apache'...ok
`PerlRestartHandler' push_handlers() stack is empty
PerlRestartHandler handlers returned -1
[Tue Dec 14 09:28:11 1999] [info] created shared memory segment #545920
perl_init_ids: uid=99, euid=99, gid=99, egid=99
`PerlChildInitHandler' push_handlers() stack is empty
PerlChildInitHandler handlers returned -1
`PerlInitHandler' push_handlers() stack is empty
PerlInitHandler handlers returned -1
`PerlPostReadRequestHandler' push_handlers() stack is empty
PerlPostReadRequestHandler handlers 

Re: apache segfaults on mod_perl dlclose

1999-12-14 Thread Saar Picker


On Tue, 14 Dec 1999, Doug MacEachern wrote:

 On Tue, 14 Dec 1999, Saar Picker wrote:
 
  
  So I've been reading. I've actually then gone on to test it with a non-DSO
  mod_perl and still get segfaults in the cleanup handling phase. I think
 
 is 'make test' core dumping or ?  let's see your perl -V too
 

No, make test works fine. Perl -V info below. This is on a redhat6.1 box
with glibc2.1.1.

-Saar

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.2.5-15, archname=i686-linux
uname='linux ernie 2.2.5-15 #1 mon apr 19 23:00:46 edt 1999 i686
unknown '
hint=previous, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-g', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -DDEBUGGING'
ccflags ='-Dbool=char -DHAS_BOOL -DDEBUGGING'
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=y, 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.so.6, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
-Wl,-rpa
th,/usr/local/debug/lib/perl5/5.00503/i686-linux/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: DEBUGGING
  Built under linux
  Compiled at Dec 10 1999 11:33:43
  @INC:
/usr/local/debug/lib/perl5/5.00503/i686-linux
/usr/local/debug/lib/perl5/5.00503
/usr/local/debug/lib/perl5/site_perl/5.005/i686-linux
/usr/local/debug/lib/perl5/site_perl/5.005
.



Re: apache segfaults on mod_perl dlclose

1999-12-14 Thread Saar Picker


Hrm. Does perl use 0x as a marker? I thought once an sv was freed
it gets a null value or something. In any case, this shouldn't be
happening due to any strictly perl modules I'm loading. I am using
XML::Parser(::Expat) but I don't see why there should be interaction
between the two. Even when I comment the XML module out, segfaults still
occur. And there doesn't seem to be any problem when running the scripts
from the command-line. Isn't perl supposed to be smart enough not to try
and free variables which are already empty?

Anyways, any ideas on how I might proceed would be helpful.

-Saar


On Tue, 14 Dec 1999, Doug MacEachern wrote:

 I just looked closer at your attachement, so this is not 'make test', lots
 of stuff going on here, you must have had a working mod_perl at somepoint.
 
 as for the actually core dump:
 assertion botched (chunk's head overwrite?): ovp-ovu.ovu_rmagic ==
 0x
 
 normally this is caused by duplicate free() or similar bug in an extension
 or the library an extension is linked with.  if you don't have purify,
 insure++ or similar, you'll need to start backing out some of your many
 modules to identify the culprit.  one of the Perl -D options for malloc
 activity might help too.
 



Re: apache segfaults on mod_perl dlclose

1999-12-14 Thread Doug MacEachern

On Tue, 14 Dec 1999, Saar Picker wrote:

 
 Hrm. Does perl use 0x as a marker? 

yes, see malloc.c

 I thought once an sv was freed it gets a null value or something. 

sure, but with Perls before 5.005_60-ish, Perl's malloc overrides system
malloc/free *everywhere*, not just for Perl data, but also for other C
code using malloc/free in the same runtime

 In any case, this shouldn't be happening due to any strictly perl 
 modules I'm loading. 

true, but pure Perl can't be ruled out as triggering such a bug.

it might help if you can run your server under gdb and post a stacktrace
after this core dump.