-
Notifications
You must be signed in to change notification settings - Fork 931
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
Assertion active hook flag removed hit #824
Comments
This makes a difference here, since the code doesn't use locks¹, just careful ordering of memory operations which ought to work on all supported architectures. That is, provided there's no parallel execution. Signal handlers run asynchronously, but suspend the regular thread execution while running. OK, so rewrite it to send a signal from the other thread (but be careful with one-shot/reentrance semantics) and do the ¹ Use of locks would require dragging in problematic OS-specific dependencies just for that sole purpose. |
It seems that Line 336 in e2c312e
Line 373 in e2c312e
This cannot happen in the signal case, so this should be marked as invalid due to API misuse (I was not aware of the signal vs thread safe fact). |
OK. The remaining question is whether signal-safety vs. thread-safety is what the original report is about. I'll ask. Anyway, it crashes in a different place, so there might still be a different issue there. |
Maybe, but so far I was not able to get that crash without the assertion being triggered. |
I tried to look into SEGV in in lua_resume after lua_yield from hook. Therefore, the following c library was used:
compiled with
gcc -o testhook.so -lpthread -pthread -shared -I . test.c
and on the Lua side:
When running LuaJIT with debug info, LUA_USE_APICHECK, and LUA_USE_ASSERT enabled this will hit quite reliable the assertion
LuaJIT/src/lj_dispatch.c
Line 376 in e2c312e
I do not see a Lua API abuse/misuse here. Furthermore, to me the hit of the assertion seems not related to the original issue.
When assertions are disabled this sometimes result in a segmentation fault:
The text was updated successfully, but these errors were encountered: