[reSIProcate] Exception can not be catched by a try/catch block
Scott Godin
sgodin at sipspectrum.com
Mon Jan 2 13:30:42 CST 2012
Wow - that's strange. Not sure why offhand the try/catch you inserted
would not catch that exception. My guess is some kind of compiler
issue/option. Does it matter if you try to catch Exception or
BaseException explicitly instead of the catch all "..."?
Scott
On Mon, Jan 2, 2012 at 2:20 PM, Murat BAYKIZ <murat.baykiz at argela.com.tr>wrote:
> Hi Scott,
>
> Thanks for fast response.
> Exception is thrown at line 435 in SipMessage.cxx
> The problem occurs while processing a sip message which has a "branch=0"
> value.
>
> > 433 InfoLog (<< "Trying to compute a transaction id on a 2543
> response. Drop the response");
> > 434 DebugLog (<< *this);
> > 435 throw Exception("Drop invalid 2543 response", __FILE__,
> __LINE__);
>
>
> Thanks for your note.
> Murat
>
>
> On 2 Oca 2012, at 20:58, Scott Godin <sgodin at sipspectrum.com> wrote:
>
> 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 at argela.com.tr>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 at resiprocate.org
>> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20120102/6836bc55/attachment.htm>
More information about the resiprocate-devel
mailing list