llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Assertion failure at kmp_runtime.cpp(5915): thread->th.th_reap_state == 1.

Open jdenny-ornl opened this issue 8 years ago • 3 comments

Bugzilla Link 36705
Resolution FIXED
Resolved on Mar 19, 2018 15:52
Version unspecified
OS Linux
CC @AndreyChurbanov

Extended Description

I am testing with clang/OpenMP from master.

In the following example, where N=1 and M is in the range [2,7], I see the following assert failure after usually less than 5 runs. I see no failure after 100 runs in the following cases: (a) with KMP_HOT_TEAMS_MODE=1 (b) with any other combination of N and M (each limited to the range [1,8]), or (c) with M omitted.

$ cat test.c #include <stdlib.h> int main(int argc, const char *argv[]) { if (argc > 1) { #pragma omp target teams num_teams(atoi(argv[1])) ; } if (argc > 2) { #pragma omp target teams num_teams(atoi(argv[2])) ; } return 0; }

$ clang -fopenmp test.c

$ ./a.out $N $M Assertion failure at kmp_runtime.cpp(5915): thread->th.th_reap_state == 1. OMP: Error #​13: Assertion failure at kmp_runtime.cpp(5915). 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)

jdenny-ornl avatar Mar 13 '18 18:03 jdenny-ornl

Yes, I'm using a debug build.

Your fix works for me. Thanks.

jdenny-ornl avatar Mar 19 '18 22:03 jdenny-ornl

Looks like you are using debug build of the OpenMP runtime library, as this assertion should not happen in the release build. Anyway, I have posted the fix for review: https://reviews.llvm.org/D44637.

AndreyChurbanov avatar Mar 19 '18 17:03 AndreyChurbanov

In case it helps:

$ cat /etc/issue Ubuntu 17.10 \n \l

$ uname -srvmo Linux 4.13.0-36-generic #​40-Ubuntu SMP Fri Feb 16 20:07:48 UTC 2018 x86_64 GNU/Linux

I built clang, llvm, and the openmp runtime using the following clang:

$ clang --version clang version 4.0.1-6 (tags/RELEASE_401/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin

jdenny-ornl avatar Mar 13 '18 18:03 jdenny-ornl