Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[openmp] runtime/test/affinity/Output/redetect.c test hangs #50370

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR51403
Status NEW
Importance P normal
Reported by Michał Górny (mgorny@gentoo.org)
Reported on 2021-08-07 11:35:44 -0700
Last modified on 2021-10-12 09:45:56 -0700
Version unspecified
Hardware PC Linux
CC jonathan.l.peyton@intel.com, llvm-bugs@lists.llvm.org, tstellar@redhat.com
Fixed by commit(s)
Attachments
Blocks PR52147
Blocked by
See also
I can reliably reproduce this when building with GCC 11.2.0 and Clang 13.0.0-
rc1, both when building with -O2 and -O0 -g.

This is on Linux 5.13.8, glibc 2.33, openmp release/13.x branch.

If I'm reading the backtraces right, it seems that the first thread is in
wait(), while all the remaining threads are waiting on a futex.

Process 3138661 stopped
* thread #1, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd256015d57 libc.so.6`__GI___wait4(pid=-1, stat_loc=0x00007ffe95b5fbcc, options=0, usage=0x0000000000000000) at wait4.c:30:10
  thread #2, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017e45a8, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #3, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017e73ac, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #4, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017ea168, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #5, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017ecf6c, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #6, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017efd6c, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #7, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017f2b6c, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #8, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017f5928, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #9, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017f8728, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #10, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017fb528, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #11, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017fe328, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
  thread #12, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000018010e8, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
Executable module set to "/tmp/portage/sys-libs/libomp-13.0.0.9999/work/libomp-
13.0.0.9999_build-abi_x86_64.amd64/runtime/test/affinity/Output/redetect.c.tmp".

(lldb) bt
error: libc.so.6 {0x00005c83}: DIE has DW_AT_ranges(DW_FORM_sec_offset 0x42)
attribute, but range extraction failed (invalid range list offset 0x42), please
file a bug and attach the file at the start of this error message
error: libc.so.6 {0x00005e0f}: DIE has DW_AT_ranges(DW_FORM_sec_offset 0x37)
attribute, but range extraction failed (invalid range list offset 0x37), please
file a bug and attach the file at the start of this error message
* thread #1, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
  * frame #0: 0x00007fd256015d57 libc.so.6`__GI___wait4(pid=-1, stat_loc=0x00007ffe95b5fbcc, options=0, usage=0x0000000000000000) at wait4.c:30:10
    frame #1: 0x0000000000401762 redetect.c.tmp`main + 562
    frame #2: 0x00007fd255f717fd libc.so.6`__libc_start_main(main=(redetect.c.tmp`main), argc=1, argv=0x00007ffe95b600e8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007ffe95b600d8) at libc-start.c:332:16
    frame #3: 0x00000000004011aa redetect.c.tmp`_start + 42

(lldb) thread select 2
* thread #2, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
    frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017e45a8, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
(lldb) bt
* thread #2, name = 'redetect.c.tmp', stop reason = signal SIGSTOP
  * frame #0: 0x00007fd25612a6c2 libpthread.so.0`__futex_abstimed_wait_common64(futex_word=0x00000000017e45a8, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:74:11
    frame #1: 0x00007fd256123ebf libpthread.so.0`__pthread_cond_wait(cond=0x00000000017e4580, mutex=0x00000000017e45c0) at pthread_cond_wait.c:504:10
    frame #2: 0x00007fd25620790d libomp.so`void __kmp_suspend_template<kmp_flag_64<false, true> >(th_gtid=9, flag=0x00007fd255ef3e80) at z_Linux_util.cpp:1474:16
    frame #3: 0x00007fd25620c5eb libomp.so`void __kmp_suspend_64<false, true>(th_gtid=9, flag=0x00007fd255ef3e80) at z_Linux_util.cpp:1526:3
    frame #4: 0x00007fd2561c04fb libomp.so`kmp_flag_64<false, true>::suspend(this=0x00007fd255ef3e80, th_gtid=9) at kmp_wait_release.h:906:31
    frame #5: 0x00007fd2561bc33a libomp.so`bool __kmp_wait_template<kmp_flag_64<false, true>, true, false, true>(this_thr=0x00000000017e4100, flag=0x00007fd255ef3e80, itt_sync_obj=0x0000000000000000) at kmp_wait_release.h:448:13
    frame #6: 0x00007fd2561c037a libomp.so`kmp_flag_64<false, true>::wait(this=0x00007fd255ef3e80, this_thr=0x00000000017e4100, final_spin=1, itt_sync_obj=0x0000000000000000) at kmp_wait_release.h:921:14
    frame #7: 0x00007fd2561b8237 libomp.so`__kmp_hyper_barrier_release(bt=bs_forkjoin_barrier, this_thr=0x00000000017e4100, gtid=9, tid=-2, propagate_icvs=1, itt_sync_obj=0x0000000000000000) at kmp_barrier.cpp:649:10
    frame #8: 0x00007fd2561bb891 libomp.so`__kmp_fork_barrier(gtid=9, tid=-2) at kmp_barrier.cpp:1938:5
    frame #9: 0x00007fd2561836f3 libomp.so`::__kmp_launch_thread(this_thr=0x00000000017e4100) at kmp_runtime.cpp:5814:5
    frame #10: 0x00007fd2562053a2 libomp.so`__kmp_launch_worker(thr=0x00000000017e4100) at z_Linux_util.cpp:527:14
    frame #11: 0x00007fd25611de1e libpthread.so.0`start_thread(arg=0x00007fd255ef4ac0) at pthread_create.c:481:8
    frame #12: 0x00007fd25604916f libc.so.6`__clone at clone.S:95
Quuxplusone commented 2 years ago

I'm having trouble reproducing the hang. Is there a particular environment setting (linux kernel, linux distro, glibc version, hardware, etc.) that is critical to replicating the bug?