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
Segmentation Fault #171
Comments
|
what runtime did you use? Lua, 5.1/5.2 LuaJit ? |
|
I have Lua 5.1 and luajit installed. The I looked at the code and didn't find where the cli arg |
|
|
|
On OSX the situation is a bit different. The test "blocks/hangs" forever (instead of segfaulting). |
|
Segfaulting Lua is hard, Luajit is somewhat easier, so I would suspect it to be related to Luajit. Have you tried the latest (just released) version? |
|
Just tried this (on OSX): busted -l lua spec/ev_common_spec.lua
●○/usr/local/bin/busted: line 41: 95435 Segmentation fault: 11 $COMMAND $BOOTSTRAP_PATH $*busted spec/ev_common_spec.lua
●○^C^CSo Lua 5.1.5 crashes, whereas Luajit hangs. |
|
beats me... first thing that comes to ming would be stacksize, due to recursion. But this seems to happen in the first test, so unlikely? I had a quick look, and websockets is pure Lua isn't it? maybe best to try and reduce further and post to the Lua list. |
|
yes, lua-websockets is pure Lua. It is the second test which hangs / crashes I think. The strange thing is, that the official 1.9.0 release does not show this behaviour... I'lll investigate deeper. |
|
got it. it's in init.lua |
|
imo this is a workaround. It should not happen in the first place. coxpcall is (supposed to be) transparent, and segfault is a failure anyway, Lua is supposed to be a safe language. Would it be possible to reduce the problem further? this really smells like a Lua bug. |
|
websockets has implementations for ev and copas. but the test affected is ev based. |
|
Then ev is the other suspect. .. |
|
I saw this happen in the first pass at busted code in the file loader. It had trouble with too many nested directories because each nest ended up adding a few layers to the stack. Stack sizes are different in lua on each OS. I think I worked around it by moving the directory traversal code into a coroutine. |
|
I asked on Lua mailing list for any ideas: http://permalink.gmane.org/gmane.comp.lang.lua.general/100273 |
|
recursion should provide a stack overflow error, never a segfault. Ran a simple test |
|
@lipp any chance of running this in a debugger and trace where it goes wrong? Probably start with a debug version of ev |
|
This reason for the segfault should be clarified still. |
|
Fabio suggested using valgrind while running the faulty test. Youmay want to give that a try. |
|
This is deep :( |
I know segmentation faults are improbable (not possible) for lua-only modules, but here is what I am observing with 9c221c4:
https://travis-ci.org/lipp/lua-websockets/builds/7674777
This does not happen with busted 1.9.0 from Luarocks repo :
https://travis-ci.org/lipp/lua-websockets/builds/7729683
(I know it is failing anyhow...)
The text was updated successfully, but these errors were encountered: