[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[ID 20000118.004] DynaLoader doesn't dlclose XS code on interpreter exit




This is a bug report for perl from root@mongo.uk.sun.com,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
[Please enter your report here]

DynaLoader assumes that exiting of the perl interpreter is the same thing as
exit of the entire application.  In the case where perl is built as a .so and
embedded inside something else (e.g. Apache/mod_perl) it is certainly not the
same thing.

The failure of DynaLoader to dlclose the XS modules leads to a very insiduous
bug.  The XS modules are left loaded in memory, and if the perl libperl.so is
subsequently reloaded via dlopen, it is often loaded into a different address.
The orphaned XS .so files are still in memory, linked to a 'ghost' of the perl
libperl.so.  This causes all sorts of insiduous memory and heap corruption
problems.

DynaLoader maintains a list of opened .so files in dl_librefs - on exit it
should dlunload all the objects in this list.

[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by root at Tue May 11 08:54:38 BST 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos mongo 5.7 generic sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-fast', gccversion=
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R /usr/local/lib/perl5/5.00503/sun4-solaris/CORE'
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /usr/local/lib/perl5/5.00503/sun4-solaris
    /usr/local/lib/perl5/5.00503
    /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/home1/rootal
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home1/rootal/bin:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/opt/gcc/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/usr/dt/bin:/usr/openwin/bin:/opt/SUNWisdn/bin:/opt/SUNWisdn/tools:.
    PERL_BADLANG (unset)
    SHELL=/bin/ksh


Follow-Ups from:
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]