<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54422>54422</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion failure in kmp_dispatch
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alban-bridonneau-arm
</td>
</tr>
</table>
<pre>
I have observed an assertion failure in openmp, while running a benchmark. I have extracted a reproducer which triggers the assert reliably.
`
void main (int argc, char *argv[]) {
long __trans_tmp_1 = 4.0;
omp_set_num_threads (__trans_tmp_1);
while(1)
{
#pragma omp parallel for schedule(dynamic)
for (long pidx = 0; pidx < 10.0; pidx++)
;
}
}
`
I have compiled that code with
`
bin/clang -fopenmp -fopenmp-version=50 -mcpu=native kmp_assert_static_steal_reproducer.c -o kmp_assert_static_steal_reproducer
`
This was tested on AArch64, i don't know if it shows on other platforms.
The error message is as follows:
`
OMP: Error #13: Assertion failure at kmp_dispatch.cpp(1298).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Aborted (core dumped)
`
As far as I can see, this is one of several assert which have been revealed after the following patch landed:
https://reviews.llvm.org/D103648
Finally, i observed while making the reproducer that the types are important to the issue. When I changed the long type to int/float, i could no longer see the issue.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVU1v4zgM_TXOhYjh2PloDjmk0y12DoudwwJ7DGhZsbWVJUOSk8m_3yfZadPOZYIgkWSKfOR7pGvb3A7fqeOLJFt76S6yITbEHuugrKEzKz06ScqQHaTph6z8RtdOaUluNEaZlphqaUTXs3vLaXYmfwbHIkRv5OTgbDMK6eJF0VFwqm2l8xQ6OYeCkVZc61ueFS9Zccy2xbS4WNUQ9Yz4WfmkTCB2rYggRMcOZ0fsL9nmOdu8ZOWest3zdJF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