lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Dec 28, 2009 at 4:43 PM, Mike Pall <mikelu-0912@mike.de> wrote:
> Pavel Shevaev wrote:
>> Could please someone clarify what's going on :) ? I'm especially
>> interested in how comes dl_iterate_phdr() ends up calling lua_call?
>
> A C++ exception is thrown which causes a cleanup of all
> stack-allocated resources. One of these has a destructor which
> calls back into Lua. This seems to trigger a chain of calls to
> require() and then ends up crashing during an __index metamethod
> call which involves module_index_event().

Thanks a lot, that explains a lot!

> Recompile with debug symbols and install debug symbols for the
> system libraries to get a better idea where this happens. You may
> want to avoid callbacks to Lua from destructors and/or avoid using
> require() in the cleanup path.

Thanks again for the insights, I'm going to review all my destructors
first and use debug versions of libraries as a last resort if nothing
helps since this situation happens pretty rarely.

-- 
Best regards, Pavel