[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: module loading in C
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 4 Sep 2008 13:54:05 -0300
> A crash occurs under these circumstances:
> - a program is in the final phase of its execution where its state is
> closed
> - a library module (=userdata) is unloaded in the cleanup (__gc=gctm)
> - a userdata calls its __gc method where it needs a function in the
> library just unloaded
> - segmentation fault results
So, the userdata is being finalized after the module, right? Either it
was created after the module, and then we have a bug in Lua (that should
finalize it before the module), or it was created before the module, and
then we have a weird program (where a userdata needs in its finalizer a
function from a module that was not loaded yet). Can you tell what is
your case?
-- Roberto