Skip to content
Snippets Groups Projects
  • Ilya Verbin's avatar
    72a6abee
    core: fix ASAN_START_SWITCH_FIBER() usage · 72a6abee
    Ilya Verbin authored
    The `__sanitizer_start_switch_fiber()` function takes a pointer as the
    first argument to store the current fake stack if there is one (it is
    necessary when stack-use-after-return detection is enabled). When leaving a
    fiber definitely, NULL must be passed so that the fake stack is destroyed.
    
    Before this patch, NULL was passed for dead fibers, however this is wrong
    for dead fibers that are recycled and resumed. In such cases ASAN destroys
    the fake stack, and the fiber crashes trying to use it in `fiber_yield()`
    upon return from `coro_transfer()`.
    
    Closes tarantool/tarantool-qa#321
    
    NO_DOC=bugfix
    NO_TEST=tested by test-release-asan workflow
    72a6abee
    History
    core: fix ASAN_START_SWITCH_FIBER() usage
    Ilya Verbin authored
    The `__sanitizer_start_switch_fiber()` function takes a pointer as the
    first argument to store the current fake stack if there is one (it is
    necessary when stack-use-after-return detection is enabled). When leaving a
    fiber definitely, NULL must be passed so that the fake stack is destroyed.
    
    Before this patch, NULL was passed for dead fibers, however this is wrong
    for dead fibers that are recycled and resumed. In such cases ASAN destroys
    the fake stack, and the fiber crashes trying to use it in `fiber_yield()`
    upon return from `coro_transfer()`.
    
    Closes tarantool/tarantool-qa#321
    
    NO_DOC=bugfix
    NO_TEST=tested by test-release-asan workflow
ghqa-321-segfault-with-clang-16-asan.md 173 B

bugfix/core

  • Fixed a crash that could happen when Tarantool is compiled by clang version 15 and above with enabled AddressSanitizer (tarantool/tarantool-qa#321).