[Openmp-commits] [openmp] [OpenMP] avoid segv for a lock that has already been destroyed (PR #145625)

Konrad Kleine via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 26 01:21:55 PDT 2025


kwk wrote:

It looks like the test `ompt/misc/lock_double_destroy.cpp` that was added with this PR fails in our build on [fedora-rawhide-i386](https://download.copr.fedorainfracloud.org/results/@fedora-llvm-team/llvm-snapshots-big-merge-20250626/fedora-rawhide-i386/09211991-llvm/builder-live.log.gz) and [fedora-42-i386](https://download.copr.fedorainfracloud.org/results/@fedora-llvm-team/llvm-snapshots-big-merge-20250626/fedora-42-i386/09211987-llvm/builder-live.log.gz) with the following output. (This was discovered [here](https://github.com/fedora-llvm-team/llvm-snapshots/issues/1518#issuecomment-3006787220)).

```
FAIL: libomp :: ompt/misc/lock_double_destroy.cpp (141 of 402, 5 of 5 attempts)
******************** TEST 'libomp :: ompt/misc/lock_double_destroy.cpp' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/./bin/clang++ -fopenmp   -I /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/src -I /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test -L /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/src  -fno-omit-frame-pointer -I /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt -std=c++17 /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/misc/lock_double_destroy.cpp -o /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/test/ompt/misc/Output/lock_double_destroy.cpp.tmp -lm -latomic && /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/test/ompt/misc/Output/lock_double_destroy.cpp.tmp | tee /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/test/ompt/misc/Output/lock_double_destroy.cpp.tmp.out | /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/./bin/FileCheck /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/misc/lock_double_destroy.cpp
# executed command: /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/./bin/clang++ -fopenmp -I /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/src -I /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test -L /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/src -fno-omit-frame-pointer -I /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt -std=c++17 /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/misc/lock_double_destroy.cpp -o /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/test/ompt/misc/Output/lock_double_destroy.cpp.tmp -lm -latomic
# .---command stderr------------
# | In file included from /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/misc/lock_double_destroy.cpp:3:
# | /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/callback.h:829:18: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# |   829 |     event_name = "ompt_event_section_begin";
# |       |                  ^
# | /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/callback.h:833:18: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# |   833 |     event_name = "ompt_event_ws_loop_chunk_begin";
# |       |                  ^
# | /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/callback.h:837:18: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# |   837 |     event_name = "ompt_event_taskloop_chunk_begin";
# |       |                  ^
# | /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/callback.h:841:18: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# |   841 |     event_name = "ompt_event_distribute_chunk_begin";
# |       |                  ^
# | /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/callback.h:845:18: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
# |   845 |     event_name = "ompt_ws_loop_iteration_begin";
# |       |                  ^
# | 5 warnings generated.
# `-----------------------------
# executed command: /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/test/ompt/misc/Output/lock_double_destroy.cpp.tmp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -11
# executed command: tee /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/runtimes/runtimes-bins/openmp/runtime/test/ompt/misc/Output/lock_double_destroy.cpp.tmp.out
# executed command: /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/./bin/FileCheck /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/misc/lock_double_destroy.cpp
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/llvm/redhat-linux-build/./bin/FileCheck /builddir/build/BUILD/llvm-21.0.0_pre20250626.g2f9eee849f7d74-build/llvm-project-2f9eee849f7d7414c447d26625517edc34437138/openmp/runtime/test/ompt/misc/lock_double_destroy.cpp
# `-----------------------------
# error: command failed with exit status: 2

--

********************
```

https://github.com/llvm/llvm-project/pull/145625


More information about the Openmp-commits mailing list