Re: [reSIProcate] Exception can not be catched by a try/catch block
Do you know what exception is being thrown? Could it be the assert in compute2543TransactionHash that is triggering the core dump, and not an exception? Can you post the SIP message or Via header that is causing the problem for you, or a short test program that demonstrates the issue? Note: take a look at resip/stack/test/testSipMessage.cxx for a sample of how to create a quick SipMessage test program.
Regards,
Scott
On Mon, Jan 2, 2012 at 1:26 PM, Murat BAYKIZ
<murat.baykiz@xxxxxxxxxxxxx> wrote:
Hi all,
Resiprocate sip stack terminates(core dump occurs) while processing a sip message. When I analyzed the core, I see there is something wrong with the transaction-id. At SipMessage.cxx line 334 - An exception is thrown and although main has a try/catch block the exception is not catched.
const Data&
314 SipMessage::getTransactionId() const
315 {
316 if (empty(h_Vias))
317 {
318 InfoLog (<< "Bad message with no Vias: " << *this);
319 throw Exception("No Via in message", __FILE__,__LINE__);
320 }
321
322 assert(exists(h_Vias) && !header(h_Vias).empty());
323 if( exists(h_Vias) && header(h_Vias).front().exists(p_branch)
324 && header(h_Vias).front().param(p_branch).hasMagicCookie()
325 && (!header(h_Vias).front().param(p_branch).getTransactionId().empty())
326 )
327 {
328 return header(h_Vias).front().param(p_branch).getTransactionId();
329 }
330 else
331 {
332 if (mRFC2543TransactionId.empty())
333 {
334 compute2543TransactionHash();
335 }
336 return mRFC2543TransactionId;
337 }
338 }
I also add a try/catch around the line 334, but the exception still was not catched and the program terminated.
332 if (mRFC2543TransactionId.empty())
333 {
try{
334 compute2543TransactionHash();
}catch(...){
// can not catch the exception
}
335 }
We are working on Solaris 10 with gcc 4.3.3.
Any idea about the problem?
Thanks,
Murat
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel