You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2021/04/21 09:16:00 UTC

[jira] [Commented] (DISPATCH-1956) Potential deadlock: logging lock vs entity cache lock

    [ https://issues.apache.org/jira/browse/DISPATCH-1956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326391#comment-17326391 ] 

Jiri Daněk commented on DISPATCH-1956:
--------------------------------------

Here's the stacktrace with {{TSAN_OPTIONS=second_deadlock_stack=1}}

{noformat}
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=5929)
  Cycle in lock order graph: M11 (0x7b1000000280) => M9 (0x7b1000000200) => M11

  Mutex M9 acquired here while holding mutex M11 in main thread:
    #0 pthread_mutex_lock <null> (libtsan.so.0+0x51b3a)
    #1 sys_mutex_lock ../src/posix/threading.c:57 (libqpid-dispatch.so+0x8f4ce)
    #2 push_event ../src/entity_cache.c:61 (libqpid-dispatch.so+0x72671)
    #3 qd_entity_cache_add ../src/entity_cache.c:67 (libqpid-dispatch.so+0x728ad)
    #4 qd_alloc_init ../src/alloc_pool.c:310 (libqpid-dispatch.so+0x5f2a6)
    #5 qd_alloc ../src/alloc_pool.c:326 (libqpid-dispatch.so+0x5f895)
    #6 new_qd_log_entry_t ../src/log.c:64 (libqpid-dispatch.so+0x7897b)
    #7 qd_vlog_impl ../src/log.c:429 (libqpid-dispatch.so+0x79216)
    #8 qd_log_impl ../src/log.c:456 (libqpid-dispatch.so+0x795e8)
    #9 qd_python_log ../src/python_embedded.c:545 (libqpid-dispatch.so+0x8fb57)
    #10 method_vectorcall_VARARGS <null> (libpython3.8.so.1.0+0x13197d)
    #11 main_process ../router/src/main.c:97 (qdrouterd+0x4025ae)
    #12 main ../router/src/main.c:369 (qdrouterd+0x4032ae)

  Mutex M11 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (libtsan.so.0+0x51b3a)
    #1 sys_mutex_lock ../src/posix/threading.c:57 (libqpid-dispatch.so+0x8f4ce)
    #2 qd_vlog_impl ../src/log.c:428 (libqpid-dispatch.so+0x79211)
    #3 qd_log_impl ../src/log.c:456 (libqpid-dispatch.so+0x795e8)
    #4 qd_python_log ../src/python_embedded.c:545 (libqpid-dispatch.so+0x8fb57)
    #5 method_vectorcall_VARARGS <null> (libpython3.8.so.1.0+0x13197d)
    #6 main_process ../router/src/main.c:97 (qdrouterd+0x4025ae)
    #7 main ../router/src/main.c:369 (qdrouterd+0x4032ae)

  Mutex M11 acquired here while holding mutex M9 in main thread:
    #0 pthread_mutex_lock <null> (libtsan.so.0+0x51b3a)
    #1 sys_mutex_lock ../src/posix/threading.c:57 (libqpid-dispatch.so+0x8f4ce)
    #2 qd_vlog_impl ../src/log.c:428 (libqpid-dispatch.so+0x79211)
    #3 qd_log_impl ../src/log.c:456 (libqpid-dispatch.so+0x795e8)
    #4 qd_python_log ../src/python_embedded.c:545 (libqpid-dispatch.so+0x8fb57)
    #5 method_vectorcall_VARARGS <null> (libpython3.8.so.1.0+0x13197d)
    #6 main_process ../router/src/main.c:97 (qdrouterd+0x4025ae)
    #7 main ../router/src/main.c:369 (qdrouterd+0x4032ae)

  Mutex M9 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (libtsan.so.0+0x51b3a)
    #1 sys_mutex_lock ../src/posix/threading.c:57 (libqpid-dispatch.so+0x8f4ce)
    #2 qd_entity_refresh_begin ../src/entity_cache.c:78 (libqpid-dispatch.so+0x72940)
    #3 ffi_call_unix64 <null> (libffi.so.7+0x7abc)
    #4 main_process ../router/src/main.c:97 (qdrouterd+0x4025ae)
    #5 main ../router/src/main.c:369 (qdrouterd+0x4032ae)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/nix/store/g40sl3zh3nv52vj0mrl4iki5iphh5ika-gcc-10.2.0-lib/lib/libtsan.so.0+0x51b3a) in __interceptor_pthread_mutex_lock
{noformat}

> Potential deadlock: logging lock vs entity cache lock
> -----------------------------------------------------
>
>                 Key: DISPATCH-1956
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1956
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Router Node
>    Affects Versions: 1.15.0
>            Reporter: Ken Giusti
>            Priority: Major
>             Fix For: 1.17.0
>
>
> {noformat}
> WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=1474955) 
>  Cycle in lock order graph: M11 (0x7b10000002c0) => M9 (0x7b1000000240) => M11 
>  
>  Mutex M9 acquired here while holding mutex M11 in main thread: 
>  #0 pthread_mutex_lock <null> (libtsan.so.0+0x528ac) 
>  #1 sys_mutex_lock /home/kgiusti/work/dispatch/qpid-dispatch/src/posix/threading.c:57 (libqpid-dispatch.so+0x8cb7d) 
>  #2 push_event /home/kgiusti/work/dispatch/qpid-dispatch/src/entity_cache.c:63 (libqpid-dispatch.so+0x6fa13) 
>  #3 qd_entity_cache_add /home/kgiusti/work/dispatch/qpid-dispatch/src/entity_cache.c:69 (libqpid-dispatch.so+0x6fc26) 
>  #4 qd_alloc_init /home/kgiusti/work/dispatch/qpid-dispatch/src/alloc_pool.c:302 (libqpid-dispatch.so+0x5878b) 
>  #5 qd_alloc /home/kgiusti/work/dispatch/qpid-dispatch/src/alloc_pool.c:318 (libqpid-dispatch.so+0x5878b) 
>  #6 new_qd_log_entry_t /home/kgiusti/work/dispatch/qpid-dispatch/src/log.c:61 (libqpid-dispatch.so+0x75891) 
>  #7 qd_vlog_impl /home/kgiusti/work/dispatch/qpid-dispatch/src/log.c:426 (libqpid-dispatch.so+0x76205) 
>  #8 qd_log_impl /home/kgiusti/work/dispatch/qpid-dispatch/src/log.c:453 (libqpid-dispatch.so+0x76580) 
>  #9 qd_python_log /home/kgiusti/work/dispatch/qpid-dispatch/src/python_embedded.c:547 (libqpid-dispatch.so+0x8d1cb) 
>  #10 <null> <null> (libpython3.8.so.1.0+0x12a23b) 
>  #11 main_process /home/kgiusti/work/dispatch/qpid-dispatch/router/src/main.c:95 (qdrouterd+0x40281c) 
>  #12 main /home/kgiusti/work/dispatch/qpid-dispatch/router/src/main.c:367 (qdrouterd+0x4024fc) 
>  
>  Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message 
>  
>  Mutex M11 acquired here while holding mutex M9 in main thread: 
>  #0 pthread_mutex_lock <null> (libtsan.so.0+0x528ac) 
>  #1 sys_mutex_lock /home/kgiusti/work/dispatch/qpid-dispatch/src/posix/threading.c:57 (libqpid-dispatch.so+0x8cb7d) 
>  #2 qd_vlog_impl /home/kgiusti/work/dispatch/qpid-dispatch/src/log.c:425 (libqpid-dispatch.so+0x76200) 
>  #3 qd_log_impl /home/kgiusti/work/dispatch/qpid-dispatch/src/log.c:453 (libqpid-dispatch.so+0x76580) 
>  #4 qd_python_log /home/kgiusti/work/dispatch/qpid-dispatch/src/python_embedded.c:547 (libqpid-dispatch.so+0x8d1cb) 
>  #5 <null> <null> (libpython3.8.so.1.0+0x12a23b) 
>  #6 main_process /home/kgiusti/work/dispatch/qpid-dispatch/router/src/main.c:95 (qdrouterd+0x40281c) 
>  #7 main /home/kgiusti/work/dispatch/qpid-dispatch/router/src/main.c:367 (qdrouterd+0x4024fc) 
>  
> SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/lib64/libtsan.so.0+0x528ac) in __interceptor_pthread_mutex_lock
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org