[asterisk-bugs] [JIRA] (ASTERISK-25778) lock-order-inversion (potential deadlock) in res_pjsip

Joshua Colp (JIRA) noreply at issues.asterisk.org
Mon Feb 15 11:03:33 CST 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-25778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joshua Colp closed ASTERISK-25778.
----------------------------------

    Resolution: Not A Bug

After looking over the locks this is referring to there doesn't seem to be an issue. The locks it is referring to being held aren't actually held at the time of invocation. There's no deadlocks here.

> lock-order-inversion (potential deadlock) in res_pjsip
> ------------------------------------------------------
>
>                 Key: ASTERISK-25778
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25778
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>    Affects Versions: 13.7.2
>         Environment: [root at vm-asterisk04t asterisk]# git branch -v
> * master a394865 Merge "Resources/res_phoneprov: fix memory leak and heap-use-after-free"
>            Reporter: Badalian Vyacheslav
>
> {code}
>   == Parsing '/etc/asterisk/pjsip.registration_custom.conf': Found
>   == Parsing '/etc/asterisk/pjsip.identify.conf': Found
>   == Parsing '/etc/asterisk/pjsip.identify_custom.conf': Found
>   == Manager registered action PJSIPShowEndpoints
>   == Manager registered action PJSIPShowEndpoint
> ==================
> WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=7657)
>   Cycle in lock order graph: M8244 (0x7d6000027800) => M8245 (0x7d300001b240) => M8244
>   Mutex M8245 acquired here while holding mutex M8244 in main thread:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 sorcery_object_load /root/asterisk/main/sorcery.c:1382 (asterisk+0x000000626c5d)
>     #4 internal_ao2_traverse /root/asterisk/main/astobj2_container.c:324 (asterisk+0x0000002db9c6)
>     #5 __ao2_callback /root/asterisk/main/astobj2_container.c:410 (asterisk+0x0000002dbec4)
>     #6 ast_sorcery_load /root/asterisk/main/sorcery.c:1416 (asterisk+0x000000627905)
>     #7 ast_sip_initialize_system res_pjsip/config_system.c:188 (res_pjsip.so+0x000000045406)
>     #8 load_module /root/asterisk/res/res_pjsip.c:3996 (res_pjsip.so+0x000000038149)
>     #9 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #10 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #11 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #12 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #13 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M8244 previously acquired by the same thread here:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 internal_ao2_traverse /root/asterisk/main/astobj2_container.c:306 (asterisk+0x0000002db830)
>     #4 __ao2_callback /root/asterisk/main/astobj2_container.c:410 (asterisk+0x0000002dbec4)
>     #5 ast_sorcery_load /root/asterisk/main/sorcery.c:1416 (asterisk+0x000000627905)
>     #6 ast_sip_initialize_system res_pjsip/config_system.c:188 (res_pjsip.so+0x000000045406)
>     #7 load_module /root/asterisk/res/res_pjsip.c:3996 (res_pjsip.so+0x000000038149)
>     #8 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #9 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #10 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #11 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #12 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M8244 acquired here while holding mutex M8245 in main thread:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 internal_ao2_traverse /root/asterisk/main/astobj2_container.c:306 (asterisk+0x0000002db830)
>     #4 __ao2_callback /root/asterisk/main/astobj2_container.c:410 (asterisk+0x0000002dbec4)
>     #5 __ao2_find /root/asterisk/main/astobj2_container.c:433 (asterisk+0x0000002dbfe9)
>     #6 __ast_sorcery_insert_wizard_mapping /root/asterisk/main/sorcery.c:960 (asterisk+0x0000006218b2)
>     #7 __ast_sorcery_apply_wizard_mapping /root/asterisk/main/sorcery.c:1034 (asterisk+0x000000622e30)
>     #8 object_type_registered_observer /root/asterisk/res/res_pjsip_config_wizard.c:1150 (res_pjsip_config_wizard.so+0x000000005c64)
>     #9 __ast_sorcery_object_register /root/asterisk/main/sorcery.c:1161 (asterisk+0x000000623fd7)
>     #10 ast_sip_initialize_sorcery_auth res_pjsip/config_auth.c:297 (res_pjsip.so+0x00000006b53d)
>     #11 ast_res_pjsip_initialize_configuration res_pjsip/pjsip_configuration.c:1830 (res_pjsip.so+0x00000005b683)
>     #12 load_module /root/asterisk/res/res_pjsip.c:4051 (res_pjsip.so+0x0000000382ec)
>     #13 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #14 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #15 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #16 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #17 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M8245 previously acquired by the same thread here:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 __ast_sorcery_object_register /root/asterisk/main/sorcery.c:1161 (asterisk+0x000000623ee4)
>     #4 ast_sip_initialize_sorcery_auth res_pjsip/config_auth.c:297 (res_pjsip.so+0x00000006b53d)
>     #5 ast_res_pjsip_initialize_configuration res_pjsip/pjsip_configuration.c:1830 (res_pjsip.so+0x00000005b683)
>     #6 load_module /root/asterisk/res/res_pjsip.c:4051 (res_pjsip.so+0x0000000382ec)
>     #7 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #8 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #9 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #10 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #11 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
> SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) ??:0 __interceptor_pthread_rwlock_rdlock
> ==================
> {code}
> and secound place 
> {code}
> ==================
> WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=11380)
>   Cycle in lock order graph: M48 (0x7d4400009b00) => M49 (0x7d300000bdc0) => M8246 (0x7d300001b240) => M48
>   Mutex M49 acquired here while holding mutex M48 in main thread:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 __ast_sorcery_wizard_register /root/asterisk/main/sorcery.c:571 (asterisk+0x00000061e074)
>     #4 ast_bucket_init /root/asterisk/main/bucket.c:1012 (asterisk+0x0000003487ad)
>     #5 asterisk_daemon /root/asterisk/main/asterisk.c:4415 (asterisk+0x0000002d65b1)
>     #6 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M48 previously acquired by the same thread here:
>     #0 pthread_mutex_lock <null> (libtsan.so.0+0x000000037816)
>     #1 __ast_pthread_mutex_lock /root/asterisk/main/lock.c:313 (asterisk+0x000000503d01)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:200 (asterisk+0x0000002d78be)
>     #3 __ast_sorcery_wizard_register /root/asterisk/main/sorcery.c:546 (asterisk+0x00000061dc19)
>     #4 ast_bucket_init /root/asterisk/main/bucket.c:1012 (asterisk+0x0000003487ad)
>     #5 asterisk_daemon /root/asterisk/main/asterisk.c:4415 (asterisk+0x0000002d65b1)
>     #6 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M8246 acquired here while holding mutex M49 in main thread:
>     #0 pthread_rwlock_wrlock <null> (libtsan.so.0+0x0000000293ad)
>     #1 __ast_rwlock_wrlock /root/asterisk/main/lock.c:1018 (asterisk+0x00000050420f)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:212 (asterisk+0x0000002d7907)
>     #3 __ao2_link /root/asterisk/main/astobj2_container.c:114 (asterisk+0x0000002db10c)
>     #4 ast_sorcery_instance_observer_add /root/asterisk/main/sorcery.c:638 (asterisk+0x00000061e9e4)
>     #5 instance_created_observer /root/asterisk/res/res_pjsip_config_wizard.c:1164 (res_pjsip_config_wizard.so+0x000000005aa9)
>     #6 __ast_sorcery_open /root/asterisk/main/sorcery.c:786 (asterisk+0x00000061f97b)
>     #7 ast_sip_initialize_system res_pjsip/config_system.c:155 (res_pjsip.so+0x0000000450a3)
>     #8 load_module /root/asterisk/res/res_pjsip.c:3996 (res_pjsip.so+0x000000038149)
>     #9 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #10 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #11 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #12 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #13 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M49 previously acquired by the same thread here:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 __ast_sorcery_open /root/asterisk/main/sorcery.c:786 (asterisk+0x00000061f891)
>     #4 ast_sip_initialize_system res_pjsip/config_system.c:155 (res_pjsip.so+0x0000000450a3)
>     #5 load_module /root/asterisk/res/res_pjsip.c:3996 (res_pjsip.so+0x000000038149)
>     #6 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #7 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #8 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #9 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #10 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M48 acquired here while holding mutex M8246 in main thread:
>     #0 pthread_mutex_lock <null> (libtsan.so.0+0x000000037816)
>     #1 __ast_pthread_mutex_lock /root/asterisk/main/lock.c:313 (asterisk+0x000000503d01)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:200 (asterisk+0x0000002d78be)
>     #3 internal_ao2_traverse /root/asterisk/main/astobj2_container.c:306 (asterisk+0x0000002db830)
>     #4 __ao2_callback /root/asterisk/main/astobj2_container.c:410 (asterisk+0x0000002dbec4)
>     #5 __ao2_find /root/asterisk/main/astobj2_container.c:433 (asterisk+0x0000002dbfe9)
>     #6 __ast_sorcery_insert_wizard_mapping /root/asterisk/main/sorcery.c:961 (asterisk+0x000000621910)
>     #7 __ast_sorcery_apply_wizard_mapping /root/asterisk/main/sorcery.c:1034 (asterisk+0x000000622e30)
>     #8 object_type_registered_observer /root/asterisk/res/res_pjsip_config_wizard.c:1150 (res_pjsip_config_wizard.so+0x000000005c64)
>     #9 __ast_sorcery_object_register /root/asterisk/main/sorcery.c:1161 (asterisk+0x000000623fd7)
>     #10 ast_sip_initialize_sorcery_auth res_pjsip/config_auth.c:297 (res_pjsip.so+0x00000006b53d)
>     #11 ast_res_pjsip_initialize_configuration res_pjsip/pjsip_configuration.c:1830 (res_pjsip.so+0x00000005b683)
>     #12 load_module /root/asterisk/res/res_pjsip.c:4051 (res_pjsip.so+0x0000000382ec)
>     #13 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #14 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #15 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #16 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #17 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
>   Mutex M8246 previously acquired by the same thread here:
>     #0 pthread_rwlock_rdlock <null> (libtsan.so.0+0x0000000290ed)
>     #1 __ast_rwlock_rdlock /root/asterisk/main/lock.c:909 (asterisk+0x0000005041b6)
>     #2 __ao2_lock /root/asterisk/main/astobj2.c:221 (asterisk+0x0000002d7945)
>     #3 __ast_sorcery_object_register /root/asterisk/main/sorcery.c:1161 (asterisk+0x000000623ee4)
>     #4 ast_sip_initialize_sorcery_auth res_pjsip/config_auth.c:297 (res_pjsip.so+0x00000006b53d)
>     #5 ast_res_pjsip_initialize_configuration res_pjsip/pjsip_configuration.c:1830 (res_pjsip.so+0x00000005b683)
>     #6 load_module /root/asterisk/res/res_pjsip.c:4051 (res_pjsip.so+0x0000000382ec)
>     #7 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
>     #8 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
>     #9 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
>     #10 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
>     #11 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)
> SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) ??:0 __interceptor_pthread_rwlock_rdlock
> ==================
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list