You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hit this situation while testing my #2601 fix: the thread_initexit_lock
unowned but contended, all threads waiting.
Detacher is pre-synchall trying to get lock.
Tons of new threads waiting on lock to init or threads waiting on the lock to exit.
Not clear how it got into this state: mutex_unlock() should call
mutex_notify_released_lock() which sets lock_requests to -1.
So we have a double-lock of T7049.
Currently it's handling a signal, but it arrived while in the cache, not while
holding the lock. The signal is SIGSEGV: hmm, suspicious, it looks like
self-interp:
(gdb) x/8i ucxt->uc_mcontext.rip-20
0x4b7ed8fc: add %al,(%rax)
0x4b7ed8fe: add %al,(%rax)
0x4b7ed900: pushq $0x712df29f
0x4b7ed905: movabs %gs:0x88,%rax
0x4b7ed910: mov 0x68(,%rax,1),%eax
0x4b7ed917: mov %rcx,%gs:0x10
0x4b7ed920: pop %rcx
0x4b7ed921: jmpq 0x4b7e1500
(gdb) x/4i 0x712df29f-5
0x712df29a <is_thread_tls_initialized+62>: callq 0x712c5e52 <safe_read_tls_magic>
0x712df29f <is_thread_tls_initialized+67>: cmp $0x244f4952,%eax
(gdb) dps ucxt->uc_mcontext.rsp ucxt->uc_mcontext.rsp+300
0x000000004ba52428 0x00000000712df29f is_thread_tls_initialized + 67 in section .text oflib64/debug/libdynamorio.so
<...>
0x000000004ba52468 0x00000000712e18da get_tls_thread_id + 13 in section .text of lib64/debug/libdynamorio.so
<...>
0x000000004ba52488 0x00000000712e18b8 get_thread_id + 13 in section .text of lib64/debug/libdynamorio.so
<...>
0x000000004ba524a8 0x000000007111ebc5 deadlock_avoidance_lock + 474 in section .text of lib64/debug/libdynamorio.so
<...>
0x000000004ba52508 0x000000007111f705 mutex_trylock + 106 in section .text of lib64/debug/libdynamorio.so
<...>
0x000000004ba52518 0x00000000716112c0 thread_initexit_lock in section .cspdata of lib64/debug/libdynamorio.so
<...>
0x000000004ba52538 0x000000007111f5ed mutex_lock + 132 in section .text of lib64/debug/libdynamorio.so
<...>
0x000000004ba52568 0x00000000710958d3 dynamo_thread_init + 255 in section .text of lib64/debug/libdynamorio.so
next_tag = 0x713234f6 <syscall_ready+5> "[\303\333\343h\200\037",
last_exit = 0x71349040 <linkstub_starting>,
(gdb) dps dcontext->upcontext.upcontext.mcontext.rsp dcontext->upcontext.upcontext.mcontext.rsp+500
0x000000004f824500 0x00007f8236ffd700 No symbol matches (void *)$retaddr.
0x000000004f824508 0x00000000712e352f os_thread_sleep + 600 in section .text of lib64/debug/libdynamorio.so
<...>
0x000000004f824568 0x00000000710958a6 dynamo_thread_init + 210 in section .text of lib64/debug/libdynamorio.so
OK so we attach to a thread and it got our takeover signal and is at the sleep I
added. We then loop around in dynamorio_take_over_threads() and re-takeover b/c
it's not yet in all_threads! This could happen w/o the sleep.
The text was updated successfully, but these errors were encountered:
Fixes a hang on attach on UNIX by avoiding re-takeover of an in-transition
thread, by waiting for uninit_thread_count to reach 0 before initiating
takeover of "unknown" threads.
Tested on the api.detach_spawn test.
Fixes#2603
Fixes a hang on attach on UNIX by avoiding re-takeover of an in-transition
thread, by waiting for uninit_thread_count to reach 0 before initiating
takeover of "unknown" threads.
Tested on the api.detach_spawn test.
Fixes#2603
I hit this situation while testing my #2601 fix: the thread_initexit_lock
unowned but contended, all threads waiting.
Detacher is pre-synchall trying to get lock.
Tons of new threads waiting on lock to init or threads waiting on the lock to exit.
Not clear how it got into this state: mutex_unlock() should call
mutex_notify_released_lock() which sets lock_requests to -1.
Fairly reproducible, even w/ diagnostics:
So we have a double-lock of T7049.
Currently it's handling a signal, but it arrived while in the cache, not while
holding the lock. The signal is SIGSEGV: hmm, suspicious, it looks like
self-interp:
OK so we attach to a thread and it got our takeover signal and is at the sleep I
added. We then loop around in dynamorio_take_over_threads() and re-takeover b/c
it's not yet in all_threads! This could happen w/o the sleep.
The text was updated successfully, but these errors were encountered: