mirror of
https://github.com/ruby/ruby.git
synced 2026-08-01 02:20:48 +08:00
ThreadSanitizer cannot follow Ruby's userspace coroutine stack switches, so its per-thread shadow stack leaks across a switch and eventually faults inside libtsan. Create a TSan fiber per coroutine and switch to it at each transfer, mirroring the existing AddressSanitizer annotations. The main context borrows the OS thread's implicit fiber and must not destroy it. Only amd64 is annotated here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>