[Home]

Summary:ASTERISK-25784: lock-order-inversion (potential deadlock) on dialplan reload
Reporter:Badalian Vyacheslav (slavon)Labels:
Date Opened:2016-02-11 23:41:00.000-0600Date Closed:2016-02-12 08:34:01.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:
Versions:13.7.2 Frequency of
Occurrence
Related
Issues:
duplicatesASTERISK-25736 pbx core: Deadlock during a reload
Environment:Attachments:
Description:{code}
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=22302)
 Cycle in lock order graph: M22 (0x7d940000c800) => M2263 (0x7f781b45ce60) => M22

 Mutex M2263 acquired here while holding mutex M22 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 ast_rdlock_contexts /root/asterisk/main/pbx.c:8183 (asterisk+0x0000005a1e52)
   #3 ast_hint_extension /root/asterisk/main/pbx.c:2887 (asterisk+0x0000005817bf)
   #4 ast_get_hint /root/asterisk/main/pbx.c:3959 (asterisk+0x000000587bbf)
   #5 manager_state_cb /root/asterisk/main/manager.c:6765 (asterisk+0x000000536dcf)
   #6 execute_state_callback /root/asterisk/main/pbx.c:3165 (asterisk+0x000000582ec5)
   #7 ast_add_hint /root/asterisk/main/pbx.c:3872 (asterisk+0x000000587653)
   #8 add_priority /root/asterisk/main/pbx.c:6968 (asterisk+0x00000059aeea)
   #9 ast_add_extension2_lockopt /root/asterisk/main/pbx.c:7143 (asterisk+0x00000059bd1f)
   #10 ast_add_extension2 /root/asterisk/main/pbx.c:7004 (asterisk+0x00000059af66)
   #11 pbx_load_config /root/asterisk/pbx/pbx_config.c:1841 (pbx_config.so+0x000000013f6e)
   #12 pbx_load_module /root/asterisk/pbx/pbx_config.c:2045 (pbx_config.so+0x000000015648)
   #13 handle_cli_dialplan_reload /root/asterisk/pbx/pbx_config.c:1565 (pbx_config.so+0x000000012372)
   #14 ast_cli_command_full /root/asterisk/main/cli.c:2717 (asterisk+0x0000004058fa)
   #15 consolehandler /root/asterisk/main/asterisk.c:2230 (asterisk+0x0000002c8cca)
   #16 asterisk_daemon /root/asterisk/main/asterisk.c:4743 (asterisk+0x0000002d7411)
   #17 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)

 Mutex M22 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_add_hint /root/asterisk/main/pbx.c:3841 (asterisk+0x0000005870db)
   #4 add_priority /root/asterisk/main/pbx.c:6968 (asterisk+0x00000059aeea)
   #5 ast_add_extension2_lockopt /root/asterisk/main/pbx.c:7143 (asterisk+0x00000059bd1f)
   #6 ast_add_extension2 /root/asterisk/main/pbx.c:7004 (asterisk+0x00000059af66)
   #7 pbx_load_config /root/asterisk/pbx/pbx_config.c:1841 (pbx_config.so+0x000000013f6e)
   #8 pbx_load_module /root/asterisk/pbx/pbx_config.c:2045 (pbx_config.so+0x000000015648)
   #9 handle_cli_dialplan_reload /root/asterisk/pbx/pbx_config.c:1565 (pbx_config.so+0x000000012372)
   #10 ast_cli_command_full /root/asterisk/main/cli.c:2717 (asterisk+0x0000004058fa)
   #11 consolehandler /root/asterisk/main/asterisk.c:2230 (asterisk+0x0000002c8cca)
   #12 asterisk_daemon /root/asterisk/main/asterisk.c:4743 (asterisk+0x0000002d7411)
   #13 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)

 Mutex M22 acquired here while holding mutex M2263 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 ast_merge_contexts_and_delete /root/asterisk/main/pbx.c:6211 (asterisk+0x0000005952fa)
   #4 pbx_load_module /root/asterisk/pbx/pbx_config.c:2052 (pbx_config.so+0x0000000156aa)
   #5 handle_cli_dialplan_reload /root/asterisk/pbx/pbx_config.c:1565 (pbx_config.so+0x000000012372)
   #6 ast_cli_command_full /root/asterisk/main/cli.c:2717 (asterisk+0x0000004058fa)
   #7 consolehandler /root/asterisk/main/asterisk.c:2230 (asterisk+0x0000002c8cca)
   #8 asterisk_daemon /root/asterisk/main/asterisk.c:4743 (asterisk+0x0000002d7411)
   #9 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)

 Mutex M2263 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 ast_wrlock_contexts /root/asterisk/main/pbx.c:8178 (asterisk+0x0000005a1e07)
   #3 ast_merge_contexts_and_delete /root/asterisk/main/pbx.c:6194 (asterisk+0x000000595198)
   #4 pbx_load_module /root/asterisk/pbx/pbx_config.c:2052 (pbx_config.so+0x0000000156aa)
   #5 handle_cli_dialplan_reload /root/asterisk/pbx/pbx_config.c:1565 (pbx_config.so+0x000000012372)
   #6 ast_cli_command_full /root/asterisk/main/cli.c:2717 (asterisk+0x0000004058fa)
   #7 consolehandler /root/asterisk/main/asterisk.c:2230 (asterisk+0x0000002c8cca)
   #8 asterisk_daemon /root/asterisk/main/asterisk.c:4743 (asterisk+0x0000002d7411)
   #9 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) ??:0 __interceptor_pthread_mutex_lock
==================

{code}
Comments:By: Asterisk Team (asteriskteam) 2016-02-11 23:41:02.660-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].