【Tsan】【Bug】Calling siglongjmp in signal handler will cause the ignore_reads_and_writes check to fail

1 view
Skip to first unread message

847567161

unread,
May 28, 2024, 9:49:30 PMMay 28
to thread-sanitizer

Hello guys, 

  I raised an issue here, and I send this email because the problem is urgent:

     https://github.com/google/sanitizers/issues/1759

Tsan disable ignores in CallUserSignalHandler when ignores are enabled before call signal handler,but it will make "CHECK_GT(thr->ignore_reads_and_writes, 0);" failed in ThreadIgnoreEnd if someone use siglongjmp in signal handler:

dlopen

  • call ThreadIgnoreBegin
    • thr->ignore_reads_and_writes++
  • trigger signal
    • CallUserSignalHandler
    •   thr->ignore_reads_and_writes = 0
    •   Call siglongjmp to jump to a normal position
  • call ThreadIgnoreEnd
    • CHECK_GT(thr->ignore_reads_and_writes, 0); // failed!

https://gitee.com/openharmony/third_party_llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp#L2006



Looking forward to your reply.

Regards,
 Chuang
Reply all
Reply to author
Forward
0 new messages