< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] Exception encountered when using reSIProcate in a multi-threaded program


On 7/18/05, Andy Agarwal <Andy@xxxxxxxxxxx> wrote:
> If I run a simple program that generates calls one after the other
> INVITE, ACK, BYE, INVITE,... Then this problem does not happen. I tried
> this with thousands of calls.
> But if I run my multithreaded program that's generating these INVITEs
> *once every 20 ms*, then I get this assertion error for different pairs
> of calls. Last time it was between call 1 and call 40. This time it is
> between call 33 and call 86 (see tid=eb01e926a62eb30b in the log excerpt
> below)
> 
> But if I slow down the rate of INVITE generation to *once every 80 ms*,
> then I don't get this assertion error anymore. I am running this program
> on a Windows Server 2003, 3GHz Pentium 4 box.
> I guess the tid generation takes the timestamp into account which is
> what could be causing this problem at 'high speeds'.
> 
> Is SipMessage::compute2543TransactionHash() the one that is being used
> to generate the tid ? Can you give me an idea of where I should place
> more debug statements.

This function call shouldn't be called unless you receive a request
from a 2543 endpoint.

Put a debug line in BranchParameter::BranchParameter(Type type) to
output the value of mTransactionId.

You may also need to put debug in Random::getRandomHex. Possibly we're
getting nailed on some win32 thread safety issue with getRandom. Focus
your effort there.

Jason



> 
> > TransactionState.cxx:43