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

[reSIProcate] Exception can not be catched by a try/catch block


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