-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux x86/x86_64 - chance of hang in the tests at process exit #16
Comments
I am afraid that someone more knowledgeable with pthreads than myself should endeavour to have to look into this as I don't have the slightest idea what the problem could be. |
I notice this on Ubuntu as well when trying to setup tests for LuaDist (LuaDist/Repository#76). The problem does not seem to occur in OSX and Cygwin. |
Just curious if 32aa701 fixes it? |
Forget it, I believe the fix is more complex. In fact, I'm not even sure if I won't have to resort to a dirty hack to fix it. |
v3.1.6 contains a fix. Let's hope there is only one such bug :-). |
I tried the latest git version and this issue is still present for me (LuaJIT 2.0.0 beta9 and Lua 5.1.5 on Linux 3.2.0, Debian Squeeze). |
I've been trying to setup a bootable Debian USB drive to check this, but without success so far (network doesn't work yet). But I don't forget :-). |
It looks like this crash at application shutdown occurs when the main thread invokes atexit_close_keepers(). The crash disappears when I don't register it anymore. It is as if the function pointer is invoked after the lanes SO is unloaded. I'll do some tests with this behavior removed and see how things fare. |
I'd like to comment on this:
This is because Lua is not compiled with pthread support. When Lua is loaded into I usually handle it by compiling a custom version of Lua with pthread support and debug symbols enabled, which I call
|
Another option is to add this to your .gdbinit so that gdb always loads pthread by itself even if the debugged image isn't pthread-enabled: |
fixed by f154e1f |
I hate to be the bearer of bad news, but this didn't fix the issue for me. |
Ok I reproduced it with Debian Squeeze amd64 as well. However, it won't hang with Debian Squeeze i386. |
Here is the callstack I get:
If I change the selfdestruct_gc code at line 1213 to perform a full selfdestruct chain processing as in windows, the application hangs much less often but I still get an occasional crash:
It looks like the crash occurs inside the timer lane's thread (which is the only one the test creates). |
I caused the program to crash while inside gdb and inspected the process: here is what I see:
As you can see, lanes/core.so is no longer loaded, therefore it was unloaded before all objects are garbage collected, including the one Lanes registers so that its __gc metamethod performs thread cleanup. This seems to be related to a known Lua issue that exists since Lua 5.1, and is fixed in Lua 5.2.1. But again, why is it not 100%, and why should it work fine on 32 bits flavors? |
I can reproduce this crash on 32-bit. Do you have any ideas for how this might be fixed on the Lanes side? |
Some simple repro case would help answer this. If I can debug it I should be able to see what's wrong. But so far I haven't had any issue (but I don't work on linux, and even a few tries in virtualbox didn't crash). |
Just in case:is it fixed in version 3.6.4? |
Not for me. Here's what happens on both 3.6.4 and 3.6.6:
Got the same result on both Lua 5.1.5 and 5.2.2 (Debian jessie x86-64) |
I am somewhat stumped. I have a debian 6.0.6 64 bits virtualbox that works just fine:
|
938ee19 fixes a possible shutdown sequence crash. I don't really think this could be the actual issue as I fix something related to the protect_allocator feature, but who knows :-). Can someone give it a try? |
It works now. On both 5.1.5 and 5.2.2. |
w00t! |
It seems that some of the tests have a problem closing out when Lua is tearing itself down.
32-bit machine uname -a: Linux pinetrail 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011 i686 i686 i386 GNU/Linux
64-bit machine uname -a: Linux ionic 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:27:26 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
I have tried GDB on a 32-bit and 64-bit machine and it complains that it cannot track the threads.
It seems that each of the tests have a chance of this hang. If you know any trick for managing this generic error, let me know.
Encountered at revision: v3.0-beta-10-g60a0e70 60a0e70
The text was updated successfully, but these errors were encountered: