llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.04k stars 11.98k forks source link

Multiple flaky test on openmp-clang-x86_64-linux-debian #44742

Open vitalybuka opened 4 years ago

vitalybuka commented 4 years ago
Bugzilla Link 45397
Version unspecified
OS Linux
CC @jdoerfert,@jprotze
jprotze commented 3 years ago

I replaced the runline for this test with:

// RUN: %libomp-compile && gdb -batch -ex run -ex bt -ex "print __kmp_gtid" -ex "print b" -ex "print (bfhead_t )b" %libomp-run > %t.out 2>&1

The segfault only occurs when the system is loaded, so seems to be sensitive to the scheduling of threads. I can reproduce the segfault by running multiple tests concurrently.

When the test fails, I get output like this:

[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x2aaaad8b0700 (LWP 135331)] [Thread 0x2aaaad8b0700 (LWP 135331) exited] [New Thread 0x2aaaad8b0700 (LWP 135348)]

Thread 1 "bug_nested_prox" received signal SIGSEGV, Segmentation fault. 0x00002aaaab1fa461 in __kmp_free_fast_memory (th=0x617bc0) at llvm-project/openmp/runtime/src/kmp_alloc.cpp:2203 2203 if ((kmp_uintptr_t)b->bh.bb.bthr & 1) { // the buffer is allocated address

​0 0x00002aaaab1fa461 in __kmp_free_fast_memory (th=0x617bc0) at llvm-project/openmp/runtime/src/kmp_alloc.cpp:2203

​1 0x00002aaaab230bf0 in __kmp_reap_thread (thread=0x617bc0, is_root=1) at llvm-project/openmp/runtime/src/kmp_runtime.cpp:5954

​2 0x00002aaaab228a54 in __kmp_reset_root (gtid=0, root=0x607f80) at llvm-project/openmp/runtime/src/kmp_runtime.cpp:3957

​3 0x00002aaaab2286d8 in __kmp_unregister_root_current_thread (gtid=0) at llvm-project/openmp/runtime/src/kmp_runtime.cpp:4003

​4 0x00002aaaab22c0f2 in __kmp_internal_end_library (gtid_req=-1) at llvm-project/openmp/runtime/src/kmp_runtime.cpp:6201

​5 0x00002aaaab22befc in __kmp_internal_end_atexit () at llvm-project/openmp/runtime/src/kmp_runtime.cpp:5901

​6 0x00002aaaab22bec9 in __kmp_internal_end_dtor () at llvm-project/openmp/runtime/src/kmp_runtime.cpp:5869

​7 0x00002aaaaaabb08a in _dl_fini () from /lib64/ld-linux-x86-64.so.2

​8 0x00002aaaab76fce9 in __run_exit_handlers () from /lib64/libc.so.6

​9 0x00002aaaab76fd37 in exit () from /lib64/libc.so.6

​10 0x00002aaaab75855c in __libc_start_main () from /lib64/libc.so.6

​11 0x00000000004007d9 in _start ()

$1 = 0 $2 = (bfhead_t *) 0x78000000000071a3 Cannot access memory at address 0x78000000000071a3

I tried to disable the hidden helper threads in lit config but still get the segfault:

config.environment['LIBOMP_USE_HIDDEN_HELPER_TASK'] = "0" config.environment['LIBOMP_NUM_HIDDEN_HELPER_THREADS'] = "0"

vitalybuka commented 4 years ago

Disabled with https://github.com/llvm/llvm-project/commit/c9ae3c5e10796252a7938ac9fa1503481ef2c197

vitalybuka commented 4 years ago

(view as text) **** TEST 'libomp :: tasking/bug_nested_proxy_task.c' FAILED **** Script:

: 'RUN: at line 1'; /b/1/openmp-clang-x86_64-linux-debian/llvm.build/./bin/clang -fopenmp -pthread -fno-experimental-isel -I /b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/test -I /b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/src -L /b/1/openmp-clang-x86_64-linux-debian/llvm.build/lib -I /b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/test/ompt /b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/test/tasking/bug_nested_proxy_task.c -o /b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/test/tasking/Output/bug_nested_proxy_task.c.tmp -lm -latomic && /b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/test/tasking/Output/bug_nested_proxy_task.c.tmp

Exit Code: -11

Command Output (stdout):

$ ":" "RUN: at line 1" $ "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/./bin/clang" "-fopenmp" "-pthread" "-fno-experimental-isel" "-I" "/b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/test" "-I" "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/src" "-L" "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/lib" "-I" "/b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/test/ompt" "/b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/test/tasking/bug_nested_proxy_task.c" "-o" "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/test/tasking/Output/bug_nested_proxy_task.c.tmp" "-lm" "-latomic" $ "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/test/tasking/Output/bug_nested_proxy_task.c.tmp" note: command had no output on stdout or stderr error: command failed with exit status: -11

--


vitalybuka commented 4 years ago

assigned to @jdoerfert