[asterisk-commits] mjordan: branch 12 r422715 - /branches/12/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 5 16:53:40 CDT 2014


Author: mjordan
Date: Fri Sep  5 16:53:35 2014
New Revision: 422715

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422715
Log:
main/cdr: Fix crash/memory consumption in CDRs in multi-party bridge scenarios

This patch fixes an issue where CDRs would get stuck generating an infinite
number of CDRs, eventually crashing Asterisk (and consuming a lot of memory
along the way).

When a channel enters into a multi-party bridge, the CDR engine creates
mappings of each participant to each other participant, picking the 'A' party
as it goes. So, if we have four channels in a multi-party bridge (Alice, Bob,
Charlie, Denise), we would have something like:

Alice => Bob
Alice => Charlie
Alice => Denise
Bob => Charlie
Bob => Denise
Charlie => Denise

This works fine when participants enter the bridge a single time.

When a participant leaves a bridge, the CDRs for that channel are transitioned
to a finalized state.

The bug occurs if Bob rejoins. When the CDR engine creates mappings between the
channels, it walks through all the participants currently in the bridge, and
realizes that no one in the bridge can create a CDR with the channel (Bob).
As such it creates a new CDR for the candidate and appends it to that
candidate's chain. Unfortunately, on this particular code path, it doesn't
stop traversing the candidate's chain. Since we just added ourselves to the
chain, this causes the loop to keep going, constantly adding new CDRs.

This patch makes it so the engine bails when it creates a CDR match in this
case.

Review: https://reviewboard.asterisk.org/r/3964/

ASTERISK-24241 #close
Reported by: Deepak Singh Rawat
Tested by: Deepak Singh Rawat

ASTERISK-24208
Reported by: Frankie Chin


Modified:
    branches/12/main/cdr.c

Modified: branches/12/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/cdr.c?view=diff&rev=422715&r1=422714&r2=422715
==============================================================================
--- branches/12/main/cdr.c (original)
+++ branches/12/main/cdr.c Fri Sep  5 16:53:35 2014
@@ -2322,6 +2322,7 @@
 			 */
 			memset(&cand_cdr->end, 0, sizeof(cand_cdr->end));
 		}
+		return 0;
 	}
 	return 0;
 }




More information about the asterisk-commits mailing list