[Home]

Summary:ASTERISK-09304: asterisk 1.4.2 crashes randomly a few times everyday
Reporter:FranswaPan (franswaw)Labels:
Date Opened:2007-04-24 16:08:17Date Closed:2007-04-25 16:00:01
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) backtrace.txt
( 1) backtrace2.txt
Description:Hello,

First time I file a bug, please let me know what I am doing wrong.

We have 6 asterisk servers 1.4.2 used to load balance traffic, around 40 calls per server. Asterisk processes SIP2SIP calls.

Asterisk is running on debian sarge 2.4.27-3-386,asterisk_safe with -g option.

Randomly asterisk crashes, creates a core.dump and is restarted by asterisk_safe. All calls are cut, the logs in /var/log/asterisk/messages show the restart logs.

I have an asterisk core dump and I enabled the flags DEBUG_THREADS, DONT_OPTIMIZE before compiling and provide here a backtrace.

I can provide more info if needed...
thanks

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

Backtrace:

Core was generated by `/usr/sbin/asterisk -U asterisk -G asterisk -vvvg -c'.
Program terminated with signal 11, Segmentation fault.
#0  0x08103133 in ast_skip_blanks (str=0x0) at /root/install/asterisk-1.4.2/include/asterisk/strings.h:49
49      AST_INLINE_API(
(gdb) bt
#0  0x08103133 in ast_skip_blanks (str=0x0) at /root/install/asterisk-1.4.2/include/asterisk/strings.h:49
#1  0x410f25aa in handle_request (p=0x8495fc8, req=0x4114fbdc, sin=0x4114fbcc, recount=0x4114fbc0, nounlock=0x4114fbc4) at chan_sip.c:14611
#2  0x410f379f in sipsock_read (id=0x81cea70, fd=18, events=1, ignore=0x0) at chan_sip.c:14847
#3  0x080ace4d in ast_io_wait (ioc=0x81cbbe8, howlong=867) at io.c:279
#4  0x410f430a in do_monitor (data=0x0) at chan_sip.c:15044
ASTERISK-1  0x08104a94 in dummy_start (data=0x81ce5a0) at utils.c:545
ASTERISK-2  0x40026c51 in pthread_start_thread () from /lib/libpthread.so.0
ASTERISK-3  0x4029538a in clone () from /lib/libc.so.6


(gdb) bt full
#0  0x08103133 in ast_skip_blanks (str=0x0) at /root/install/asterisk-1.4.2/include/asterisk/strings.h:49
No locals.
#1  0x410f25aa in handle_request (p=0x8495fc8, req=0x4114fbdc, sin=0x4114fbcc, recount=0x4114fbc0, nounlock=0x4114fbc4) at chan_sip.c:14611
       cmd = 0x4114fdf8 "SIP/2.0"
       cseq = 0x4114fe0a "102 INVITE"
       useragent = 0x411016fa ""
       seqno = 102
       len = 3
       ignore = 0
       respid = 1091254013
       res = 0
       debug = 0
       e = 0x0
       error = 0
       __PRETTY_FUNCTION__ = "handle_request"
#2  0x410f379f in sipsock_read (id=0x81cea70, fd=18, events=1, ignore=0x0) at chan_sip.c:14847
       req = {rlPart1 = 0x4114fdf8 "SIP/2.0", rlPart2 = 0x0, len = 318, headers = 8, method = 1, lines = 0, flags = 0, header = {0x4114fdf8 "SIP/2.0", 0x4114fe04 "CSeq: 102 INVITE",
   0x4114fe16 "Via: SIP/2.0/UDP 81.201.82.29:5060;branch=z9hG4bK15386ac0;rport", 0x4114fe57 "From: \"01304668300\" <sip:01304668300@81.201.82.29>;tag=as040deada",
   0x4114fe9a "Call-ID: 3742260b134ef94c1aeae759108c6e78@81.201.82.29", 0x4114fed2 "To: <sip:0777@209.34.171.10>", 0x4114fef0 "Contact: <sip:209.34.171.10:5060;transport=udp>",
   0x4114ff21 "Content-Length: 0", 0x4114ff34 "", 0x0 <repeats 55 times>}, line = {0x4114ff36 "", 0x0 <repeats 63 times>},
 data = "SIP/2.0\0003\000\000\000CSeq: 102 INVITE\000\000Via: SIP/2.0/UDP 81.201.82.29:5060;branch=z9hG4bK15386ac0;rport\000\000From: \"01304668300\" <sip:01304668300@81.201.82.29>;tag=as040deada\000\000Call-ID: 3742260b134ef94c1aeae759108c6"..., sdp_start = 0, sdp_end = 0}
       sin = {sin_family = 2, sin_port = 50195, sin_addr = {s_addr = 178987729}, sin_zero = "\000\000\000\000\000\000\000"}
---Type <return> to continue, or q <return> to quit---
       p = (struct sip_pvt *) 0x8495fc8
       res = 318
       len = 16
       nounlock = 0
       recount = 0
       lockretry = 100
       __PRETTY_FUNCTION__ = "sipsock_read"
#3  0x080ace4d in ast_io_wait (ioc=0x81cbbe8, howlong=867) at io.c:279
       res = 1
       x = 0
       origcnt = 1
#4  0x410f430a in do_monitor (data=0x0) at chan_sip.c:15044
       res = 867
       sip = (struct sip_pvt *) 0x0
       peer = (struct sip_peer *) 0x0
       t = 1177447075
       fastrestart = 0
       lastpeernum = -1
       curpeernum = 3
       reloading = 0
       __PRETTY_FUNCTION__ = "do_monitor"
ASTERISK-1  0x08104a94 in dummy_start (data=0x81ce5a0) at utils.c:545
       _buffer = {__routine = 0x8068bc6 <ast_unregister_thread>, __arg = 0x58016, __canceltype = 6, __prev = 0x0}
---Type <return> to continue, or q <return> to quit---
       ret = (void *) 0x1
       a = {start_routine = 0x410f3bde <do_monitor>, data = 0x0, name = 0x81ce5b0 "do_monitor", ' ' <repeats 11 times>, "started at [15103] chan_sip.c restart_monitor()"}
ASTERISK-2  0x40026c51 in pthread_start_thread () from /lib/libpthread.so.0
No symbol table info available.
ASTERISK-3  0x4029538a in clone () from /lib/libc.so.6
No symbol table info available.




(gdb) thread apply all bt

Thread 1 (process 21125):
#0  0x08103133 in ast_skip_blanks (str=0x0) at /root/install/asterisk-1.4.2/include/asterisk/strings.h:49
#1  0x410f25aa in handle_request (p=0x8495fc8, req=0x4114fbdc, sin=0x4114fbcc, recount=0x4114fbc0, nounlock=0x4114fbc4) at chan_sip.c:14611
#2  0x410f379f in sipsock_read (id=0x81cea70, fd=18, events=1, ignore=0x0) at chan_sip.c:14847
#3  0x080ace4d in ast_io_wait (ioc=0x81cbbe8, howlong=867) at io.c:279
#4  0x410f430a in do_monitor (data=0x0) at chan_sip.c:15044
ASTERISK-1  0x08104a94 in dummy_start (data=0x81ce5a0) at utils.c:545
ASTERISK-2  0x40026c51 in pthread_start_thread () from /lib/libpthread.so.0
ASTERISK-3  0x4029538a in clone () from /lib/libc.so.6

Comments:By: Russell Bryant (russell) 2007-04-24 16:48:49

Please upgrade to the latest code in the 1.4 branch, or 1.4.3 when available.  I think this may have already been fixed.

$ svn co http://svn.digium.com/svn/asterisk/branches/1.4 asterisk-1.4

By: FranswaPan (franswaw) 2007-04-25 07:57:26

Problem is fixed in 1.4 branch.
Thanks!