[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: crash in Lua 5.1 and 5.2: calling C function from unloaded lib
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 9 Apr 2012 13:43:41 -0300
> 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