[asterisk-bugs] [Asterisk 0017610]: Deadlock is happended.( between channel and sip_pvt lock)

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jul 9 06:24:29 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17610 
====================================================================== 
Reported By:                warmguy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17610
Category:                   Channels/chan_sip/General
Reproducibility:            have not tried
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 274052 
Request Review:              
====================================================================== 
Date Submitted:             2010-07-08 23:36 CDT
Last Modified:              2010-07-09 06:24 CDT
====================================================================== 
Summary:                    Deadlock is happended.( between channel and sip_pvt
lock)
Description: 
I have been testing asterisk. (Trunk version)
When testing more than 4cps asterisk does not work.

I am confirmed reason for using GDB.
The reason is estimated to deadlock. Help needed.

Between thread ID 24 and thread ID 5 the circular Deadlock occurs.
Thread 24 (Thread 0x8cc8b90 (LWP 1886)):   chan lock(waiting) <-
sip_pvt_lock(acquired) <- monlock(acquired) 
Thread 5 (Thread 0x648ab90 (LWP 1948)): sip_pvt lock(waiting) <- chan
lock(acquired) 

Here is the debugging information.
Thread 24 (Thread 0x8cc8b90 (LWP 1886)): 
https://issues.asterisk.org/view.php?id=0  0x00e45424 in __kernel_vsyscall ()
https://issues.asterisk.org/view.php?id=1  0x008df839 in __lll_lock_wait () from
/lib/libpthread.so.0
https://issues.asterisk.org/view.php?id=2  0x008dad84 in _L_lock_277 () from
/lib/libpthread.so.0
https://issues.asterisk.org/view.php?id=3  0x008da932 in __pthread_mutex_lock
(mutex=<value optimized out>)
    at pthread_mutex_lock.c:69
https://issues.asterisk.org/view.php?id=4  0x008223f6 in pthread_mutex_lock
(mutex=Could not find the frame base
for "pthread_mutex_lock".
) at forward.c:182
https://issues.asterisk.org/view.php?id=5  0x08116ca3 in
__ast_pthread_mutex_lock (filename=0x81d45f4
"channel.c",
    lineno=1138, func=0x81d5ddb "__ast_queue_frame",
    mutex_name=0x81d57e5 "chan", t=0xb0da1020) at lock.c:230
https://issues.asterisk.org/view.php?id=6  0x0808813f in __ao2_lock
(user_data=0xb0da1658,
    file=0x81d45f4 "channel.c", func=0x81d5ddb "__ast_queue_frame",
line=1138,
    var=0x81d57e5 "chan") at astobj2.c:157
https://issues.asterisk.org/view.php?id=7  0x080acf5a in __ast_queue_frame
(chan=0xb0da1658, fin=0x8cc771c,
head=0,
    after=0x0) at channel.c:1138
https://issues.asterisk.org/view.php?id=8  0x080ad4b3 in ast_queue_frame
(chan=0xb0da1658, fin=0x8cc771c)
    at channel.c:1218
https://issues.asterisk.org/view.php?id=9  0x080ad74d in ast_queue_control_data
(chan=0xb0da1658,
    control=AST_CONTROL_CONNECTED_LINE, data=0x8cc7794, datalen=31)
    at channel.c:1270
https://issues.asterisk.org/view.php?id=10 0x080c17d3 in
ast_channel_queue_connected_line_update
(chan=0xb0da1658,
    connected=0x8cc7cb4) at channel.c:7437
https://issues.asterisk.org/view.php?id=11 0x00462b4c in handle_response_invite
(p=0xb0d9c2c8, resp=200,
    rest=0x9533dc0 "OK", req=0x94c4a30, seqno=102) at chan_sip.c:18321
https://issues.asterisk.org/view.php?id=12 0x00467223 in handle_response
(p=0xb0d9c2c8, resp=200,
    rest=0x9533dc0 "OK", req=0x94c4a30, seqno=102) at chan_sip.c:19068
https://issues.asterisk.org/view.php?id=13 0x00478439 in handle_incoming
(p=0xb0d9c2c8, req=0x94c4a30,
    sin=0xb0d9c5f4, recount=0x8cc8274, nounlock=0x8cc8270) at
chan_sip.c:23087
https://issues.asterisk.org/view.php?id=14 0x00479155 in process_request_queue
(p=0xb0d9c2c8, recount=0x8cc8274,
    nounlock=0x8cc8270) at chan_sip.c:23268
https://issues.asterisk.org/view.php?id=15 0x004793f3 in
scheduler_process_request_queue (data=0xb0d9c2c8)
    at chan_sip.c:23316
https://issues.asterisk.org/view.php?id=16 0x08173bba in ast_sched_runq
(con=0xb0fe5fa0) at sched.c:621
https://issues.asterisk.org/view.php?id=17 0x0047b8bd in do_monitor (data=0x0)
at chan_sip.c:23907
https://issues.asterisk.org/view.php?id=18 0x0818d335 in dummy_start
(data=0xb0ff6108) at utils.c:971
https://issues.asterisk.org/view.php?id=19 0x008d932f in start_thread
(arg=<value optimized out>)
    at pthread_create.c:297
https://issues.asterisk.org/view.php?id=20 0x0081420e in clone () from
/lib/libc.so.6

Thread 5 (Thread 0x648ab90 (LWP 1948)): 
https://issues.asterisk.org/view.php?id=0  0x00e45424 in __kernel_vsyscall ()
https://issues.asterisk.org/view.php?id=1  0x008df839 in __lll_lock_wait () from
/lib/libpthread.so.0
https://issues.asterisk.org/view.php?id=2  0x008dad84 in _L_lock_277 () from
/lib/libpthread.so.0
https://issues.asterisk.org/view.php?id=3  0x008da932 in __pthread_mutex_lock
(mutex=<value optimized out>)
    at pthread_mutex_lock.c:69
https://issues.asterisk.org/view.php?id=4  0x008223f6 in pthread_mutex_lock
(mutex=Could not find the frame base
for "pthread_mutex_lock".
) at forward.c:182
https://issues.asterisk.org/view.php?id=5  0x08116ca3 in
__ast_pthread_mutex_lock (filename=0x49f5f4
"chan_sip.c",
    lineno=6820, func=0x4a36a8 "sip_read", mutex_name=0x4a13de "p",
    t=0xb0d9bc90) at lock.c:230
https://issues.asterisk.org/view.php?id=6  0x0808813f in __ao2_lock
(user_data=0xb0d9c2c8,
    file=0x49f5f4 "chan_sip.c", func=0x4a36a8 "sip_read", line=6820,
    var=0x4a13de "p") at astobj2.c:157
https://issues.asterisk.org/view.php?id=7  0x0042624d in sip_read
(ast=0xb0da1658) at chan_sip.c:6820
https://issues.asterisk.org/view.php?id=8  0x080b2dc7 in __ast_read
(chan=0xb0da1658, dropaudio=0) at
channel.c:3423
https://issues.asterisk.org/view.php?id=9  0x080b47bd in ast_read
(chan=0xb0da1658) at channel.c:3746
https://issues.asterisk.org/view.php?id=10 0x00ea5040 in wait_for_answer
(in=0x9512698, outgoing=0xb0d9b178,
    to=0x6485a68, peerflags=0x6485cac, opt_args=0x648528c, pa=0x64852ec,
    num_in=0x6485a58, result=0x64852e8, dtmf_progress=0x0, ignore_cc=1)
    at app_dial.c:1097
https://issues.asterisk.org/view.php?id=11 0x00eabf04 in dial_exec_full
(chan=0x9512698,
    data=0x6487e88 "SIP/5016,60,wWrRM(monit,5006,SIMULCALL)",
    peerflags=0x6485cac, continue_exec=0x0) at app_dial.c:2218
https://issues.asterisk.org/view.php?id=12 0x00eae9b1 in dial_exec
(chan=0x9512698,
    data=0x6487e88 "SIP/5016,60,wWrRM(monit,5006,SIMULCALL)")
    at app_dial.c:2703
https://issues.asterisk.org/view.php?id=13 0x08130637 in pbx_exec (c=0x9512698,
app=0x93362d8,
    data=0x6487e88 "SIP/5016,60,wWrRM(monit,5006,SIMULCALL)") at
pbx.c:1395
https://issues.asterisk.org/view.php?id=14 0x08139a2a in pbx_extension_helper
(c=0x9512698, con=0x0,
    context=0x9512970 "outbound", exten=0x95129c0 "5016", priority=12,
    label=0x0, callerid=0xb0d83440 "5006", action=E_SPAWN,
found=0x648a2f0,
    combined_find_spawn=1) at pbx.c:4069
https://issues.asterisk.org/view.php?id=15 0x0813b2fa in ast_spawn_extension
(c=0x9512698,
    context=0x9512970 "outbound", exten=0x95129c0 "5016", priority=12,
    callerid=0xb0d83440 "5006", found=0x648a2f0, combined_find_spawn=1)
    at pbx.c:4560
https://issues.asterisk.org/view.php?id=16 0x0813b9fb in __ast_pbx_run
(c=0x9512698, args=0x0) at pbx.c:4655
https://issues.asterisk.org/view.php?id=17 0x0813cec9 in pbx_thread
(data=0x9512698) at pbx.c:4942
https://issues.asterisk.org/view.php?id=18 0x0818d335 in dummy_start
(data=0x9515f60) at utils.c:971
https://issues.asterisk.org/view.php?id=19 0x008d932f in start_thread
(arg=<value optimized out>)
    at pthread_create.c:297
https://issues.asterisk.org/view.php?id=20 0x0081420e in clone () from
/lib/libc.so.6

====================================================================== 

---------------------------------------------------------------------- 
 (0124377) pabelanger (manager) - 2010-07-09 06:24
 https://issues.asterisk.org/view.php?id=17610#c124377 
---------------------------------------------------------------------- 
Your backtrace is optimized (see below).  Also, do not post your output as
a note, upload it.

---
Debugging deadlocks:

Please select DEBUG_THREADS and DONT_OPTIMIZE in the Compiler Flags
section of menuselect. Recompile and install Asterisk (i.e. make install)

This will then give you the console command:

core show locks 

When the symptoms of the deadlock present themselves again, please provide
output of the deadlock via:

# asterisk -rx \\\"core show locks\\\" | tee /tmp/core-show-locks.txt

# gdb -se \\\"asterisk\\\" <pid of asterisk> | tee /tmp/backtrace.txt

gdb> bt
gdb> bt full
gdb> thread apply all bt

Then attach the core-show-locks.txt and backtrace.txt files to this issue.
Thanks! 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-09 06:24 pabelanger     Note Added: 0124377                          
======================================================================




More information about the asterisk-bugs mailing list