lua-users home
lua-l archive

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

2011/11/10 Philipp Janda <>:
> On 09.11.2011 17:31, Benoit Germain wrote:
>>> The glibc memory corruption is gone, but now I get an assertion failure
>>> on
>>> 'make test' (not always on the first test, but I don't get far):
>>> lua5.1: lanes.c:1018: selfdestruct_remove: Assertion `found' failed.
>>> Aborted (core dumped)
> A proper solution would probably involve using pthread_cleanup_push to free
> the Lane's memory on actual cancellation.
> Now I get a SIGSEGV in tests/atexit.lua :-)

Just wondering. I changed the desinit sequence a bit. Before,
selfdestruct_atexit was an atexit() handler. Now it is called when the
main application's Lua state is closed, causing garbage collection of
a full userdata that triggers its __gc metamethod.
I changed to the new behavior because I observed when debugging the
win32 build that the threads were no longer registered in the debugger
when tracing inside the atexit sequence.

I haven't had reports of this crash with the old method. So maybe the
threads no longer run when atexit handlers are called with the pthread
build too?

In that case, maybe moving again the s_lane structures liberation
still present in the selfdestruct chain in an atexit handler would fix
the crash?