Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Roberto Ierusalimschy <roberto <at> inf.puc-rio.br>
Subject: Re: crash in Lua 5.1 and 5.2: calling C function from unloaded lib
Newsgroups: gmane.comp.lang.lua.general
Date: Monday 9th April 2012 16:43:41 UTC (over 5 years ago)
> The following extension and Lua program crash both Lua 5.1 and Lua
> 5.2.  From an strace it appears that the extension library is called
> into after it was unloaded.  Perhaps this is a GC-related bug where
> the loaded library is collected prematurely?

Unfortunatelly, this seems to be a "conceptual" bug. The loaded library
is being collected exactly where the specification says it should be
collected, but the resulting behavior allows client code to crash the
interpreter, which is unacceptable.

I see three solutions:

1) To disallow the unloading of dynamic libraries. (Very quick and dirty.)

2) To handle dynamic libraries as a special case when running
finalizers. (May be good for a patch.)

3) To change the specification in some way (e.g., introducing priorities
for finalizers).

-- Roberto
 
CD: 2ms