[reSIProcate] Getting a DestroyUsage...

John Draper lists at webcrunchers.com
Mon Dec 12 17:09:00 CST 2005


Hi,

I'm crashing in the following code in DialogUsageManager.cxx line 935
Partial code listed below from lines 931 - 937 - this is in the DumThread
code and "DialogUsageManager::internalProcess" gets called repeatedly
getting the response data back from SIP server.   One  such request data 
is a
DestroyUsage response.  What exactly is a DestroyUsage object,  it's
purpose in life,  and why would I get one coming back to me after issuing
an Invite?

      DestroyUsage* destroyUsage = dynamic_cast<DestroyUsage*>(msg.get());
      if (destroyUsage)
      {
         DebugLog(<< "Destroying usage" << *destroyUsage);
         destroyUsage->destroy();         <----- Crashes here....
         return;
      }

DestroyUsage::destroy()
{
   if (mDialogSet)
   {
      delete mDialogSet;    <---- Crashes here.
   }
   else if (mDialog)
   {
      delete mDialog;
   }
   else if (mHandle.isValid())
   {
      delete mHandle.get();
   }
}

And why would I want to delete my dialogSet after issuing an Invite?  Is 
this a normal
thing it's supposed to do?    I presume so,  but in chasing down the 
problem,  it eventually
gets to here...

HeaderFieldValueList::~HeaderFieldValueList()
{
   for (iterator i = begin(); i != end(); i++)      <---- Last thing it 
was pointing to before crashing
   {
      delete *i;
   }
   delete mParserContainer;
}

Stack trace

#0    0x002a850c in 
__gnu_cxx::__normal_iterator<resip::HeaderFieldValue**, 
std::vector<resip::HeaderFieldValue*, 
std::allocator<resip::HeaderFieldValue*> > 
 >::__normal_iterator(resip::HeaderFieldValue** const&) at 
stl_iterator.h:590
#1    0x002a803c in 
__gnu_cxx::__normal_iterator<resip::HeaderFieldValue**, 
std::vector<resip::HeaderFieldValue*, 
std::allocator<resip::HeaderFieldValue*> > 
 >::__normal_iterator(resip::HeaderFieldValue** const&) at 
stl_iterator.h:590
#2    0x002a8078 in std::vector<resip::HeaderFieldValue*, 
std::allocator<resip::HeaderFieldValue*> >::begin() at stl_vector.h:365
#3    0x002a7ac4 in resip::HeaderFieldValueList::begin() at 
HeaderFieldValueList.hxx:49
#4    0x000b9478 in resip::HeaderFieldValueList::~HeaderFieldValueList() 
at HeaderFieldValueList.cxx:18
#5    0x000b943c in resip::HeaderFieldValueList::~HeaderFieldValueList() 
at HeaderFieldValueList.cxx:17
#6    0x00022e94 in resip::SipMessage::cleanUp() at SipMessage.cxx:148
#7    0x00022b8c in resip::SipMessage::~SipMessage() at SipMessage.cxx:133
#8    0x00022b00 in resip::SipMessage::~SipMessage() at SipMessage.cxx:132
#9    0x000dae64 in resip::BaseCreator::~BaseCreator() at BaseCreator.cxx:16
#10    0x000dae08 in resip::BaseCreator::~BaseCreator() at 
BaseCreator.cxx:16
#11    0x000c2504 in resip::DialogSet::~DialogSet() at DialogSet.cxx:101
#12    0x000c238c in resip::DialogSet::~DialogSet() at DialogSet.cxx:85
#13    0x000dcbac in resip::DestroyUsage::destroy() at DestroyUsage.cxx:89
#14    0x0007dab8 in 
resip::DialogUsageManager::internalProcess(std::auto_ptr<resip::Message>) 
at DialogUsageManager.cxx:935
#15    0x0008dba0 in resip::DumThread::thread() at DumThread.cxx:24
#16    0x000a3b50 in threadWrapper at ThreadIf.cxx:34

Last log entries

UAC(INVITE): myAppDialogSet: destroyed.
INFO | 1134426681 | SipPhone | RESIP:TRANSACTION | 
resiprocate/TuSelector.cxx:69 | Stats message
WARNING | 1134426681 | SipPhone | RESIP:STATS | 
/Users/johndraper/Documents/SIP/Open_source/resiprocate-0.9.0-5019/resiprocate/StatisticsMessage.cxx:152 
| RESIP:TRANSACTION
TU summary: 4 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
Transaction summary: reqi 0 reqo 3 rspi 13 rspo 0
Details: INVi 0/S0/F0 INVo 1/S7/F1 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 
0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 
OPTo 0/S0/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 
0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0
Retransmissions: INVx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 finx 0 nonx 0 
PUBx 0 SUBx 0 NOTx 0
INFO | 1134426722 | SipPhone | RESIP:DUM | 
resiprocate/dum/DialogUsageManager.cxx:830 | Got: DestroyDialogSet 
42694ac852916552 at am9obi1kcmFwZXJzLWNvbXB1dGVyLmxvY2Fs-08b5529b
INFO | 1134426745 | SipPhone | RESIP:TRANSACTION | 
resiprocate/TuSelector.cxx:69 | Stats message
WARNING | 1134426745 | SipPhone | RESIP:STATS | 
resiprocate/StatisticsMessage.cxx:152 | RESIP:TRANSACTION
TU summary: 3 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
Transaction summary: reqi 0 reqo 3 rspi 13 rspo 0
Details: INVi 0/S0/F0 INVo 1/S7/F1 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 
0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 
OPTo 0/S0/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 
0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0
Retransmissions: INVx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 finx 0 nonx 0 
PUBx 0 SUBx 0 NOTx 0
DEBUG | 1134426773 | SipPhone | RESIP:DUM | 
resiprocate/dum/DialogUsageManager.cxx:934 | Destroying  
42694ac852916552 at am9obi1kcmFwZXJzLWNvbXB1dGVyLmxvY2Fs-08b5529b
Program received signal:  "EXC_BAD_ACCESS".

I presume this is normal for the stack to destroy the 
"usageDestroyDialogSet"?  
I'm not getting any of the "InviteSessionHandler", or "OutOfDialogHandler"
callbacks at all at this stage.

But the Sip server is getting the Invite request and is processing the 
200 OK I'm getting
back from the server.  One other thing I notice,  is that I'm getting 
more then one
200 OK coming back.   Why is this?  Is this normal?  I'm sure the answer 
it hidden in
one of the 275 pages of the RFC,  but help me out please....  I'm sure 
I'm just not
constructing the INvite message properly....   Message and "sdp" I'm 
using is listed below,
am I forgetting something?

INVITE sip:u218055 at whitephone.com SIP/2.0
To: <sip:u218055 at whitephone.com>
From: <sip:u354 at 213.167.79.25:5060>;tag=08b5529b
Via: SIP/2.0/UDP 
192.168.0.4:5060;branch=z9hG4bK-d87543-475b0dae105544ec-1--d87543-;rport
Call-ID: 42694ac852916552 at am9obi1kcmFwZXJzLWNvbXB1dGVyLmxvY2Fs
CSeq: 1 INVITE
Contact: <sip:u354 at 192.168.0.4:5060>
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE
Content-Type: application/sdp
User-Agent: RTC/1.3.5369 (OnInstant/0_0)
Content-Length: 257

v=0
o=- 0 0 IN IP4 192.168.0.4
s=WhitePhone Mac
c=IN IP4 192.168.0.4
t=0 0
m=audio 10976 RTP/AVP 0 8 3 97 101
a=fmtp:101 0-15
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:97 speex/8000
a=rtpmap:101 telephone-event/8000

===================================================

There are some things I'm not doing, but should, but I doubt if it has
anything to do with why I'm getting the above behaviour.

I'm not specifying the Codec count....  Do you think that if I don't
specify it,  that could be causing the crash?    Because the crash
happens when destroying the message, and if that isn't setup,
then the interator may have the wrong count.  

John






More information about the resiprocate-devel mailing list