<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94207>94207</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
【Tsan】【Bug】Calling siglongjmp in signal handler will cause the ignore_reads_and_writes check to fail
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yinchuang-code
</td>
</tr>
</table>
<pre>
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
- ThreadIgnoreBegin
- thr->ignore_reads_and_writes++
- trigger signal
- CallUserSignalHandler
- thr->ignore_reads_and_writes = 0
- Call siglonghmp to jump to a normal position
- ThreadIgnoreEnd
- CHECK_GT(thr->ignore_reads_and_writes, 0); // failed!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU01v2zAM_TXyhUgg03ZiH3xY0mQddlx3DmSLkdXKUiDJDfrvByVuum7FCgwwLFskHz8enwhBK0vUsmrDqrtMTHFwvn3Rth8mYdWid5KyzsmX9iEIC1IH0RkCrazzFEBb2ApjfgbyP7SywtwLKw15OA9k4eYmPAHZFCmho6PzBL0wBsIlBoZrEMNtN0XQEc7aGBjFEwFD3N7vtt8PXx8Y1nHwC1bsrrAHT0KGg7DycPY6UmC4Bc6wYcWGIcJR6JRPW3gYkuu3S9TOStBHCG4kZwmmQKkK46x6HE_J-Y-aii-M3zH-7i2NO5G9fi_eoW9I6dkAsIDP6t2kZ4aJXitFfs7_hvHxfF_tnyYBVtwB_819Ow8-tTyMJ4gOHqfrKcA6PwoDJxd01O7DFndW3tAS3H-wAwz3DPczQwzzN0DIZFvIpmhERm2-ztdlzpsKs6FtylXVULWu86oUVV_XlB-rZl3Wx3y1bsoq0y1yLPmKFzkvqgqXdbEqUSQ_2TfYHVnJaRTaLI15HpfOq0yHMFHblMjXmREdmXARAqKlM1yMDDHpwrcpZtFNKrCSGx1ieEOJOhpq2a5gNWcNT0J5_clvt5tJ3S4TBdqqfy7eVQO9SAsah1fF_U1vP1D_lMhLw8wmb9ohxlNIe3sZstJxmLpl70aG-1TyfCxO3j1SHxnuL40GhvvrIJ5b_BUAAP__zS5QVg">