[asterisk-dev] Question about hup_handler & deadlocks

Jay Hoover jay at snapvine.com
Sat Sep 23 20:18:35 MST 2006


Hello everyone,

I'm currently investigating a deadlock we're experiencing under high load in
Asterisk and I have a question about hup_handler. I don't yet have enough
information on this or a good enough repro to write up a report, but it
appears to be a deadlock caused by hup_handler calling into
ast_module_reload from a thread that is currently inside a system call.

Can anyone enlighten me about why ast_module_reload needs to be called from
the SIGHUP handler? I see that this was added quite a few years ago (may
'01), but I can't find anything in the code that explains the reasoning
behind it.

Thanks,
Jay


ps. for those who are curious about the deadlock.

#0  0x003637a2 in _dl_sysinfo_int80 () from /lib/ld- linux.so.2
#1  0x004352fb in __write_nocancel () from /lib/tls/libc.so.6
#2  0x003dabdf in _IO_new_file_write () from /lib/tls/libc.so.6
#3  0x003d963b in _IO_new_do_write () from /lib/tls/libc.so.6
#4  0x003da0e8 in _IO_new_file_overflow () from /lib/tls/libc.so.6
#5  0x003dad02 in _IO_new_file_xsputn () from /lib/tls/libc.so.6
#6  0x003d0111 in fputs () from /lib/tls/libc.so.6
#7  0x080baff6 in console_verboser (s=0x811cb00 "    -- Registered
indication country 'fi'\n", pos=0, replace=0, complete=1) at asterisk.c:975
#8  0x08056cf3 in ast_verbose (fmt=0x810589c "    -- Registered indication
country '%s'\n") at logger.c:896
#9  0x080c37ce in ast_register_indication_country (zone=0x8320d58) at
indications.c :477
#10 0xf6ed19e5 in ind_load_module () at res_indications.c:346
#11 0x0805c05d in ast_module_reload (name=0x0) at loader.c:257
#12 0x080badd1 in hup_handler (num=-512) at asterisk.c:752
#13 <signal handler called>
#14 0x003637a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#15 0x0050046f in __close_nocancel () from /lib/tls/libpthread.so.0
#16 0xf6edb429 in agi_exec_full (chan=0x8bdcd10, data=Variable "data" is not
available.
) at res_agi.c:297
#17 0x0808503d in pbx_exec (c=0x8bdcd10, app=0x8317d98, data=0xf3f29b59,
newstack=1) at pbx.c:545
#18 0xf6ed8ddc in handle_exec (chan=0x0, agi=0x0, argc=3, argv=0xf3f29950)
at res_agi.c:1089
#19 0xf6edaf3b in agi_exec_full (chan=0x8bdcd10, data=Variable "data" is not
available.
) at res_agi.c:1823
#20 0x0809063d in pbx_extension_helper (c=0x8bdcd10, con=Variable "con" is
not available.
) at pbx.c:545
#21 0x08090bdc in ast_spawn_extension (c=0x0, context=0xf6ede188 "? ",
exten=0xf6ede188 "? ", priority=-152182392, callerid=0xf6ede188 "? ") at
pbx.c:2218
#22 0xf675460c in macro_exec (chan=0x8bdcd10, data=0xf3f31889) at
app_macro.c:210
#23 0x0808503d in pbx_exec (c=0x8bdcd10, app=0x834b4b0, data=0xf3f31889,
newstack=1) at pbx.c:545
#24 0xf66ed0fe in dial_exec_full (chan=0x863e6d0, data=Variable "data" is
not available.
) at app_dial.c:1455
#25 0xf66ef46d in dial_exec (chan=0x0, data=0xf6ede188) at app_dial.c:1616
#26 0x0808503d in pbx_exec (c=0x863e6d0, app=0x8353fe8, data=0xf3f32960,
newstack=1) at pbx.c:545
#27 0xf635ff13 in failoverdial_exec (chan=0x863e6d0, data=0xf3f36f70) at
app_failoverdial.c:154
#28 0x0809063d in pbx_extension_helper (c=0x863e6d0, con=Variable "con" is
not available.
) at pbx.c:545
#29 0x080918f6 in __ast_pbx_run (c=0x863e6d0) at pbx.c:2218
#30 0x08092830 in ast_pbx_run (c=0x863e6d0) at pbx.c:2544
#31 0x08093205 in ast_pbx_outgoing_exten (type=0xf658f844 "Local",
format=64, data=0xf658f944, timeout=45000, context=0xf658fd44 "dialout",
    exten=0xf658fc44 "outbound-handler", priority=1, reason=0xf3f39438,
sync=2, cid_num=0xf658fe48 "6419208463", cid_name=0xf658ff48 "",
vars=0xec01c8e0,
    account=0xf6590048 "", channel=0x0) at pbx.c:5001
#32 0xf6c90208 in attempt_thread (data=0xf658f730) at pbx_spool.c:266
#33 0x004fb341 in start_thread () from /lib/tls/libpthread.so.0
#34 0x00443fee in clone () from /lib/tls/libc.so.6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20060923/a664352f/attachment-0001.htm


More information about the asterisk-dev mailing list