lua: abort trace recording on fiber yield
Since Tarantool fibers don't respect Lua coroutine switch mechanism, JIT machinery stays unnotified when one lua_State substitutes another one. As a result if trace recording hasn't been aborted prior to fiber switch, the recording proceeds using the new lua_State and leads to a failure either on any further compiler phase or while the compiled trace is executed. This changeset extends <cord_on_yield> routine aborting trace recording when the fiber switches to another one. If the switch-over occurs while mcode is being run the platform finishes its execution with EXIT_FAILURE code and calls panic routine prior to the exit. Closes #1700 Fixes #4491 Reviewed-by:Sergey Ostanevich <sergos@tarantool.org> Reviewed-by:
Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Signed-off-by:
Igor Munkin <imun@tarantool.org>
Showing
- src/lua/utils.c 40 additions, 0 deletionssrc/lua/utils.c
- test/app-tap/CMakeLists.txt 1 addition, 0 deletionstest/app-tap/CMakeLists.txt
- test/app-tap/gh-1700-abort-recording-on-fiber-switch.skipcond 7 additions, 0 deletions.../app-tap/gh-1700-abort-recording-on-fiber-switch.skipcond
- test/app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua 78 additions, 0 deletions.../app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua
- test/app-tap/gh-4491-coio-wait-leads-to-segfault.test.lua 53 additions, 0 deletionstest/app-tap/gh-4491-coio-wait-leads-to-segfault.test.lua
- test/app-tap/libyield.c 29 additions, 0 deletionstest/app-tap/libyield.c
test/app-tap/libyield.c
0 → 100644
Please register or sign in to comment