develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #1997] DynaLoader doesn't dlclose XS code on interpreter exit

From:
Michael G Schwern via RT
Date:
July 12, 2005 19:40
Subject:
[perl #1997] DynaLoader doesn't dlclose XS code on interpreter exit
Message ID:
rt-3.0.11-1997-117123.10.4465048617564@perl.org
> [root@mongo.uk.sun.com - Tue Jan 18 07:49:50 2000]:
>
> 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.

Looking at DynaLoader and skimming the discussion of this bug it seems
like it has been applied and fixed.  Could someone more familiar with
DynaLoader please confirm?




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About