<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66654>66654</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[OpenMP] th_task_team inconsistency caught by a debug assert
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mikaoP
</td>
</tr>
</table>
<pre>
```cpp
#include <omp.h>
int main() {
int x;
#pragma omp parallel
#pragma omp single
{
omp_event_handle_t ev;
#pragma omp task detach(ev)
{ }
omp_fulfill_event(ev);
}
}
```
`clang -fopenmp t1.c -o t1 && OMP_NUM_THREADS=1 ./t1`
```
Assertion failure at kmp_runtime.cpp(2459): master_th->th.th_task_team == team->t.t_task_team[master_th->th.th_task_state].
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2459).
```
I've hit this assert when compiling in a debug build
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU12PozoM_TXmxSqCBCh94KG9tLr3oXeq_XhGAQxkJwRETGfn36-gO53uavZhJSTinPj4-FhWzunWEmUQHyDOPTVzN0xZr5_VcPHKoX7NIAluXzWOEOQQ7EFIbSsz14Qg_xn60e9AHm-Ytoy90hZECmKHsD3c7nEBvoN8CxGEHCfV9gqHfsRRTcoYMh-jTtvW0B27cw79WNCVLBedsrWhgpGuDzV-52HlnrEmVlUHIqUriN3D0-0BYZs_UDezabQxtxL3hIcW3l6_H968uoeVUbbFTTOMZBcFoV_hZkAOEUQCIsGn86X4_-u5-PLvp-M-_wwyD9EHceLwkeaRde8cTawHi43SZp4IFeNzPxbTbFn35C-DEqmI4t2qd4-9ckxTwd0G5JE7n7tisaJgUj2CzEHmuJxX2Od3EOLDn3IdKyaIc_8m6ul8WSodp2mYFtdDuYR_J9X_sN3_QGyvhJ1m5E47VCsnvnRksRr6URttW9QWFdZUzi2Wsza1V2ey3smd8igLk10cRKkIhddlaZUEqSqDmqIqrmUSyW1YUqxU1NRbosbTmQiEDHZhGkaRlMKvVF1XaRjIZivLtCGIAuqVNr4x194fptbTzs2UJUkSR55RJRm37pMQll5wBUGIZb2mbMnZlHPrIAqMduzeWVizWRfxaSR7vkCc4y-D0rYarNOOyVavWKm57RjL13vfN2O8eTJZxzw6kHsQJxCnVnM3l3419CBOS7mfv804Dd-oYhCnVaQDcVqb-BEAAP__boY9WA">