Skip to content
Snippets Groups Projects
  • Igor Munkin's avatar
    2711797b
    lua: abort trace recording on fiber yield · 2711797b
    Igor Munkin authored
    
    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: default avatarSergey Ostanevich <sergos@tarantool.org>
    Reviewed-by: default avatarVladislav Shpilevoy <v.shpilevoy@tarantool.org>
    Signed-off-by: default avatarIgor Munkin <imun@tarantool.org>
    2711797b
    History
    lua: abort trace recording on fiber yield
    Igor Munkin authored
    
    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: default avatarSergey Ostanevich <sergos@tarantool.org>
    Reviewed-by: default avatarVladislav Shpilevoy <v.shpilevoy@tarantool.org>
    Signed-off-by: default avatarIgor Munkin <imun@tarantool.org>