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

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

Michael G Schwern via RT
July 12, 2005 19:40
[perl #1997] DynaLoader doesn't dlclose XS code on interpreter exit
Message ID:
> [ - 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
> 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
>  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? Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About