[Home]

Summary:ASTERISK-12172: Segfault on chan_sip with recording (when retransmitting?)
Reporter:Tjardick van der Kraan (tjardick)Labels:
Date Opened:2008-06-11 07:12:35Date Closed:2011-06-07 14:00:47
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Asterisk seemed to crash randomly. So we kept it running in with the -g to get a coredump. See aditional info for the bt and bt full.

It looks like it happens in case of a re-transmit on a channel that is running monitor.

Box situation:
All channels are coming in on Sangoma E1 and ran thru MixMonitor before being handed of to a SIP Peer.



****** ADDITIONAL INFORMATION ******

BT:

(gdb) bt
#0  0x00e76f01 in __ast_pthread_mutex_lock (filename=0xec38f4 "chan_sip.c", lineno=1902, func=0xec3e58 "retrans_pkt", mutex_name=0xec3e64 "&pkt->owner->lock", t=0x0) at /dar/build/asterisk-1.4.20.1/include/asterisk/lock.h:319
#1  0x00e75fe4 in retrans_pkt (data=0x97c40e0) at chan_sip.c:1902
#2  0x080f634b in ast_sched_runq ()
#3  0x00eb67dd in do_monitor (data=0x0) at chan_sip.c:15812
#4  0x08106484 in dummy_start ()
ASTERISK-1  0x00d3e3cc in start_thread () from /lib/tls/libpthread.so.0
ASTERISK-2  0x00c671ae in clone () from /lib/tls/libc.so.6

BT Full:

(gdb) bt full
#0  0x00e76f01 in __ast_pthread_mutex_lock (filename=0xec38f4 "chan_sip.c", lineno=1902, func=0xec3e58 "retrans_pkt", mutex_name=0xec3e64 "&pkt->owner->lock", t=0x0) at /dar/build/asterisk-1.4.20.1/include/asterisk/lock.h:319
       res = -1209720248
       canlog = 13893367
       __PRETTY_FUNCTION__ = "__ast_pthread_mutex_lock"
#1  0x00e75fe4 in retrans_pkt (data=0x97c40e0) at chan_sip.c:1902
       pkt = (struct sip_pkt *) 0x97c40e0
       prev = (struct sip_pkt *) 0x80f6337
       cur = (struct sip_pkt *) 0x0
       reschedule = 1000
       xmitres = 0
       __PRETTY_FUNCTION__ = "retrans_pkt"
#2  0x080f634b in ast_sched_runq ()
No symbol table info available.
#3  0x00eb67dd in do_monitor (data=0x0) at chan_sip.c:15812
       res = 0
       sip = (struct sip_pvt *) 0x0
       peer = (struct sip_peer *) 0x0
       t = 1213173148
       fastrestart = 0
       lastpeernum = -1
       curpeernum = 39
       reloading = 0
       __PRETTY_FUNCTION__ = "do_monitor"
#4  0x08106484 in dummy_start ()
No symbol table info available.
ASTERISK-1  0x00d3e3cc in start_thread () from /lib/tls/libpthread.so.0
No symbol table info available.
ASTERISK-2  0x00c671ae in clone () from /lib/tls/libc.so.6
No symbol table info available.
Comments:By: Tjardick van der Kraan (tjardick) 2008-06-20 02:44:26

Another trace, same lines of code in lock.h, chan_sip.c

(gdb) bt
#0  0x001adf01 in __ast_pthread_mutex_lock (filename=0x1fa8f4 "chan_sip.c", lineno=1902, func=0x1fae58 "retrans_pkt", mutex_name=0x1fae64 "&pkt->owner->lock", t=0x78657765)
   at /dar/build/asterisk-1.4.20.1/include/asterisk/lock.h:319
#1  0x001acfe4 in retrans_pkt (data=0x8969f50) at chan_sip.c:1902
#2  0x080f634b in ast_sched_runq ()
#3  0x001ed7dd in do_monitor (data=0x0) at chan_sip.c:15812
#4  0x08106484 in dummy_start ()
ASTERISK-1  0x00d3e3cc in start_thread () from /lib/tls/libpthread.so.0
ASTERISK-2  0x00c671ae in clone () from /lib/tls/libc.so.6
(gdb) bt full
#0  0x001adf01 in __ast_pthread_mutex_lock (filename=0x1fa8f4 "chan_sip.c", lineno=1902, func=0x1fae58 "retrans_pkt", mutex_name=0x1fae64 "&pkt->owner->lock", t=0x78657765)
   at /dar/build/asterisk-1.4.20.1/include/asterisk/lock.h:319
       res = -1210289592
       canlog = 13893367
       __PRETTY_FUNCTION__ = "__ast_pthread_mutex_lock"
#1  0x001acfe4 in retrans_pkt (data=0x8969f50) at chan_sip.c:1902
       pkt = (struct sip_pkt *) 0x8969f50
       prev = (struct sip_pkt *) 0x80f6337
       cur = (struct sip_pkt *) 0x0
       reschedule = 1000
       xmitres = 0
       __PRETTY_FUNCTION__ = "retrans_pkt"
#2  0x080f634b in ast_sched_runq ()
No symbol table info available.
#3  0x001ed7dd in do_monitor (data=0x0) at chan_sip.c:15812
       res = 0
       sip = (struct sip_pvt *) 0x0
       peer = (struct sip_peer *) 0x0
       t = 1213764834
       fastrestart = 0
       lastpeernum = -1
       curpeernum = 35
       reloading = 0
       __PRETTY_FUNCTION__ = "do_monitor"
#4  0x08106484 in dummy_start ()
No symbol table info available.
ASTERISK-1  0x00d3e3cc in start_thread () from /lib/tls/libpthread.so.0
No symbol table info available.
ASTERISK-2  0x00c671ae in clone () from /lib/tls/libc.so.6
No symbol table info available.

By: Mark Michelson (mmichelson) 2008-06-24 14:46:31

Sorry it took so long for someone to comment on this issue. There's apparently some sort of memory corruption happening here, but it's not obvious where it is based just on the backtrace.

If you can, could you run Asterisk under Valgrind? Instructions for how to do it are located in doc/valgrind.txt in the Asterisk source directory. Thanks!

By: Jason Parker (jparker) 2008-11-18 16:40:22.000-0600

Closing due to lack of response from reporter.  There have also been quite a lot of fixes in this area.

Please reopen if this is still an issue with the latest version of Asterisk.