Project

General

Profile

Actions

Bug #20220

closed

M:N threading needs to tell ASAN about stack switches

Added by kjtsanaktsidis (KJ Tsanaktsidis) 10 months ago. Updated 10 months ago.


Description

When switching stacks via coroutine_transfer in the M:N threading information, we need to tell ASAN about it in the same way that we do in cont.c. This is a matter of calling __sanitizer_start_switch_fiber in the transferring M:N thread, and then calling __sanitizer_finish_switch_fiber in the transferred-to M:N thread.


Related issues 1 (1 open0 closed)

Related to Ruby master - Misc #20387: Meta-ticket for ASAN supportAssignedkjtsanaktsidis (KJ Tsanaktsidis)Actions
Actions #1

Updated by Anonymous 10 months ago

  • Status changed from Open to Closed

Applied in changeset git|719db18b50a996f3df4f76854f7dc9d69f875582.


notify ASAN about M:N threading stack switches

In a similar way to how we do it with fibers in cont.c, we need to call
__sanitize_start_switch_fiber and __sanitize_finish_switch_fiber around
the call to coroutine_transfer to let ASAN save & restore the fake stack
pointer.

When a M:N thread is exiting, we pass to_dead to the new
coroutine_transfer0 function, so that we can pass NULL for saving the
stack pointer. This signals to ASAN that the fake stack can be freed
(otherwise it would be leaked)

[Bug #20220]

Actions #2

Updated by kjtsanaktsidis (KJ Tsanaktsidis) 8 months ago

  • Related to Misc #20387: Meta-ticket for ASAN support added
Actions

Also available in: Atom PDF

Like0
Like0Like0