[Home]

Summary:ASTERISK-10032: Asterisk Crashes in Function "retrans_pkt"
Reporter:callguy (callguy)Labels:
Date Opened:2007-08-06 14:48:52Date Closed:2007-08-17 16:20:32
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 10391.patch.txt
Description:We are seeing asterisk crash with what appears to be a race condition in chan_sip, apparently around packet retransmission. A BT Full from asterisk made with "don't optimize" is included. This appears related to, but slightly different than 10256.

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

#1  0x00c354d9 in ast_mutex_lock (pmutex=0x0)
   at /usr/src/asterisk-test/1.4.9/asterisk-1.4.9/include/asterisk/lock.h:532
No locals.
#2  0x00c34ab8 in retrans_pkt (data=0x9b9e070) at chan_sip.c:1873
       pkt = (struct sip_pkt *) 0x9b9e070
       prev = (struct sip_pkt *) 0x0
       cur = (struct sip_pkt *) 0x0
       reschedule = 1000
       xmitres = 0
       __PRETTY_FUNCTION__ = "retrans_pkt"
#3  0x080e7727 in ast_sched_runq (con=0x89a24b8) at sched.c:359
       current = (struct sched *) 0xb68fd5d0
       tv = {tv_sec = 1186428922, tv_usec = 290585}
       numevents = 1
       res = 0
#4  0x00c71b28 in do_monitor (data=0x0) at chan_sip.c:15289
       res = 0
       sip = (struct sip_pvt *) 0x0
       peer = (struct sip_peer *) 0x0
       t = 1186428922
       fastrestart = 0
       lastpeernum = -1
       curpeernum = 4175
       reloading = 0
       __PRETTY_FUNCTION__ = "do_monitor"
ASTERISK-1  0x080f4999 in dummy_start (data=0xb765c290) at utils.c:545
       _buffer = {__routine = 0x80689d5 <ast_unregister_thread>, __arg = 0xe7bba0, __canceltype = 0, __prev = 0x0}
       ret = (void *) 0x0
       a = {start_routine = 0xc714f3 <do_monitor>, data = 0x0,
 name = 0xb765c2a0 "do_monitor", ' ' <repeats 11 times>, "started at [15343] chan_sip.c restart_monitor()"}
ASTERISK-2  0x006c13cc in start_thread () from /lib/tls/libpthread.so.0
No symbol table info available.
ASTERISK-3  0x005c4c3e in clone () from /lib/tls/libc.so.6
No symbol table info available.
Comments:By: callguy (callguy) 2007-08-06 17:52:56

We usually run against release versions only, if we patch this against the 1.4.9 source do you think that would be a problem (as opposed to rev 78241)? I have verified that it does patch cleanly, but want to be sure it may not have other adverse effects.

By: Gregory Hinton Nietsky (irroot) 2007-08-07 05:10:57

hi there thx looks like you onto somthing (i reported 10256) it has puzzled me for some time your patch seems to make logic.

ill try it out and let you know ...

By: Gregory Hinton Nietsky (irroot) 2007-08-08 06:26:35

all seems ok so far ... prehaps
ASTERISK-1026328 is related ??

patch gets 2 thumbs and one toe up here thx (ps that is a score of 100% not 75%)

By: callguy (callguy) 2007-08-08 09:41:28

seems ok over here as well. been running without issue since the patch was released. irroot - i agree, 10328 does look related as well.

By: callguy (callguy) 2007-08-13 13:35:09

FYI - we've been running for 5 days with this patch without any recurrence of the issue. This is closed as far as we're concerned.

By: Digium Subversion (svnbot) 2007-08-17 08:19:18

Repository: asterisk
Revision: 79857

------------------------------------------------------------------------
r79857 | russell | 2007-08-17 08:19:16 -0500 (Fri, 17 Aug 2007) | 5 lines

Fix some crashes in chan_sip.  This patch changes various places that add items
to the scheduler to ensure that they don't overwrite the ID of a previously
scheduled item.  If there is one, it should be removed.
(closes issue ASTERISK-10032, closes issue ASTERISK-9917, probably others, patch by me)

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-08-17 08:21:25

Repository: asterisk
Revision: 79858

------------------------------------------------------------------------
r79858 | russell | 2007-08-17 08:21:25 -0500 (Fri, 17 Aug 2007) | 13 lines

Merged revisions 79857 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79857 | russell | 2007-08-17 08:37:08 -0500 (Fri, 17 Aug 2007) | 5 lines

Fix some crashes in chan_sip.  This patch changes various places that add items
to the scheduler to ensure that they don't overwrite the ID of a previously
scheduled item.  If there is one, it should be removed.
(closes issue ASTERISK-10032, closes issue ASTERISK-9917, probably others, patch by me)

........

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-08-17 16:20:32

Repository: asterisk
Revision: 79916

------------------------------------------------------------------------
r79916 | file | 2007-08-17 16:20:31 -0500 (Fri, 17 Aug 2007) | 164 lines

Merged revisions 79841,79858-79862,79885,79888,79894,79901,79903,79905,79907,79913,79915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r79841 | crichter | 2007-08-17 05:29:56 -0300 (Fri, 17 Aug 2007) | 9 lines

Merged revisions 79833 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79833 | crichter | 2007-08-17 10:22:36 +0200 (Fr, 17 Aug 2007) | 1 line

sometimes we don't need to signal dtmf tones to asterisk, we just want them to go through as inband. Otherwise they might be generated by the other channel partner and then there is a double tone.
........

................
r79858 | russell | 2007-08-17 10:39:17 -0300 (Fri, 17 Aug 2007) | 13 lines

Merged revisions 79857 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79857 | russell | 2007-08-17 08:37:08 -0500 (Fri, 17 Aug 2007) | 5 lines

Fix some crashes in chan_sip.  This patch changes various places that add items
to the scheduler to ensure that they don't overwrite the ID of a previously
scheduled item.  If there is one, it should be removed.
(closes issue ASTERISK-10032, closes issue ASTERISK-9917, probably others, patch by me)

........

................
r79859 | tilghman | 2007-08-17 10:40:11 -0300 (Fri, 17 Aug 2007) | 2 lines

store and destroy implementations for realtime pgsql (closes issue ASTERISK-10015)

................
r79860 | tilghman | 2007-08-17 10:45:44 -0300 (Fri, 17 Aug 2007) | 2 lines

store and destroy implementations for sqlite (closes issue ASTERISK-10078) and odbc (closes issue ASTERISK-10079)

................
r79861 | russell | 2007-08-17 11:07:44 -0300 (Fri, 17 Aug 2007) | 12 lines

This commit adds a scheduler API call, ast_sched_replace that can be used
in place of a very common construct.  I also used it in a number of places
in chan_sip.

 if (id > -1)
    ast_sched_del(sched, id);
 id = ast_sched_add(sched, ...);

changes to:

 ast_sched_replace(id, sched, ...);

................
r79862 | russell | 2007-08-17 11:14:59 -0300 (Fri, 17 Aug 2007) | 2 lines

Make use of ast_sched_replace() in some places in chan_iax2

................
r79885 | tilghman | 2007-08-17 11:41:33 -0300 (Fri, 17 Aug 2007) | 2 lines

Change this flag... might not otherwise unlock in an OOM situation

................
r79888 | qwell | 2007-08-17 12:27:19 -0300 (Fri, 17 Aug 2007) | 4 lines

Correct the argument separator for a Dial statement in pbx_dundi.

Closes issue ASTERISK-10107, patch by lunn

................
r79894 | qwell | 2007-08-17 13:04:20 -0300 (Fri, 17 Aug 2007) | 4 lines

Fix Dial arguments in res_features.

Closes issue ASTERISK-10108, patch by lunn.

................
r79901 | tilghman | 2007-08-17 13:39:41 -0300 (Fri, 17 Aug 2007) | 2 lines

Documentation for '' in logger.conf, as suggested by jtodd (closes issue ASTERISK-10100)

................
r79903 | qwell | 2007-08-17 14:45:01 -0300 (Fri, 17 Aug 2007) | 13 lines

Merged revisions 79902 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue ASTERISK-10109)
........
r79902 | qwell | 2007-08-17 12:44:22 -0500 (Fri, 17 Aug 2007) | 4 lines

Re-add the setting of callerid name and number.

Issue 10485, reported by and fix explained by paradise.

........

................
r79905 | qwell | 2007-08-17 16:13:25 -0300 (Fri, 17 Aug 2007) | 20 lines

Merged revisions 79904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue ASTERISK-10065)
........
r79904 | qwell | 2007-08-17 14:12:19 -0500 (Fri, 17 Aug 2007) | 11 lines

Don't send a semicolon over the wire in sip notify messages.
Caused by fix for issue 9938.

I basically took the code that existed before 9938 was fixed, and
copied it into a new function - ast_unescape_semicolon

There should be very few places this will be needed (pbx_config
does NOT need this (see issue 9938 for details))

Issue 10430, patch by me, with help/ideas from murf (thanks murf).

........

................
r79907 | mmichelson | 2007-08-17 16:16:51 -0300 (Fri, 17 Aug 2007) | 14 lines

Merged revisions 79906 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79906 | mmichelson | 2007-08-17 14:14:05 -0500 (Fri, 17 Aug 2007) | 6 lines

Patch allows for more seamless transition from file storage voicemail to ODBC storage voicemail.
If a retrieval of a greeting from the database fails, but the file is found on the file system, then
we go ahead an insert the greeting into the database. The result of this is that people who
switch from file storage to ODBC storage do not need to rerecord their voicemail greetings.


........

................
r79913 | russell | 2007-08-17 18:04:33 -0300 (Fri, 17 Aug 2007) | 12 lines

Merged revisions 79912 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79912 | russell | 2007-08-17 16:01:43 -0500 (Fri, 17 Aug 2007) | 4 lines

Avoid a crash in the handling of DTMF based Caller ID.  It is valid for
ast_read to return NULL in the case that the channel has been hung up.
(crash reported by anonymouz666 on IRC in #asterisk-dev)

........

................
r79915 | mmichelson | 2007-08-17 18:19:18 -0300 (Fri, 17 Aug 2007) | 3 lines

I broke the build. Now I'm fixing it.


................

------------------------------------------------------------------------