Hi Cynthia,
I have all of that already paged out from my memory, but I will try to
do my best. Also +Yuri who added the fibers change.
> ==12==ERROR: ThreadSanitizer: SEGV on unknown address 0x60000212fff8 (pc 0x00000031dd2b bp 0x7fff3added50 sp 0x7fff3added28 T12)
0x60000 address is used for traces:
https://github.com/llvm/llvm-project/blob/a8a85166d81f573af7ff325fdf93dd8bdfdeddbf/compiler-rt/lib/tsan/rtl/tsan_platform.h#L39
And trace object starts with a stack trace:
https://github.com/llvm/llvm-project/blob/a8a85166d81f573af7ff325fdf93dd8bdfdeddbf/compiler-rt/lib/tsan/rtl/tsan_trace.h#L47
The low bytes of fff8 suggest an underflow. So I would assume the
thread stack trace was underflowed, which suggests that did not
understand some of fiber switching code and added a frame on one fiber
and removed on a wrong fiber.
> ThreadSanitizer: can't find longjmp buf
This is also an indication that does not understand the longjmp, which
may lead to messed stack traces and stack frame pop on a wrong
context.
> curious why it wouldn't be able to find the longjmp buf.
Tsan stores jmp_buf's on setjmp per thread, and then on longjmp it
tries to find the stored jmp_buf pointer in the per-thread context.
This message means it couldn't find it.
One reason may be that we stored jmp_buf in one thread context, but
then trying to find in another thread context (due to fiber switches).
> I'm a bit unclear though if this is because I'm perhaps integrating wrong, or if the things I'm doing aren't currently supported inside of TSAN.
setjmp/longjmp are supported for some limited use cases. Namely,
intended use in a single thread. Also they are supported for anything
covered by tests.
Try to add a test with the crux of what you are doing. If it's
working, then it makes sense to add such a test so that it does not
break in future. If it's not working, then by the fact it's not
supported.