< Previous by Date | Date Index | Next by Date > |
< Previous in Thread | Thread Index | Next in Thread > |
Ah – I think I see what’s happening. The code in the destructor is just wrong: QueuedNIT *qn; while (qn=mNITQueue.front()) { mNITQueue.pop(); delete qn; } Should
be re-written to be: while (mNITQueue.size()) { delete mNITQueue.front(); mNITQueue.pop(); } mNITQueue.front() will return an undefined value if queue is
empty. The auto_ptr solution is a reasonable solution as well. Scott From: Kobi Eshun
[mailto:kobi@xxxxxxxxxxxxxx] You're right about the copying -- I see that the
InviteSession copy constructors are in fact disabled. But there's definitely something rattling around in there.
Here's a stack trace from a reliable crash from a test application.
(Ignore the apparently different reSIProcate header/source paths
-- they're a coherent set.) The app establishes a call with a UAS, fires off a
bunch of in-dialog NITs, and then tears down the call. It crashes while
destroying the InviteSession. Replacing the raw pointers in the NIT queue with SharedPtr's
fixes the problem, but I don't understand why. Any ideas? -- kobi Program received signal: "EXC_BAD_ACCESS". [Switching to process 17993 thread 0xb90f] (gdb) where #0 0x003a0d81 in resip::shared_count::~shared_count
(this=0x2e747273) at
/Users/ss-kobi/source/client/mp2/resiprocate-1.2/rutil/SharedCount.hxx:247 #1 0x003a0f34 in
resip::SharedPtr<resip::SipMessage>::~SharedPtr (this=0x2e74726f) at
/Users/ss-kobi/source/client/mp2/resiprocate-1.2/rutil/SharedPtr.hxx:73 #2 0x004212bd in
resip::InviteSession::QueuedNIT::~QueuedNIT (this=0x2e74726f) at
../resip/dum/InviteSession.hxx:352 #3 0x001fae2a in resip::InviteSession::~InviteSession
(this=0xe352200) at
/Users/ss-kobi/source/resiprocate-1.2.2/resip/dum/InviteSession.cxx:86 #4 0x0044c091 in
resip::ClientInviteSession::~ClientInviteSession (this=0xe352200) at ../resip/dum/ClientInviteSession.hxx:13 #5 0x002486d5 in resip::DestroyUsage::destroy
(this=0xdcdf9d0) at
/Users/ss-kobi/source/resiprocate-1.2.2/resip/dum/DestroyUsage.cxx:87 #6 0x001afcd5 in
resip::DialogUsageManager::internalProcess (this=0xe197200, msg=@0xb02d97e4) at
/Users/ss-kobi/source/resiprocate-1.2.2/resip/dum/DialogUsageManager.cxx:1123 #7 0x001b03f8 in resip::DialogUsageManager::process
(this=0xe197200, mutex=0x0) at
/Users/ss-kobi/source/resiprocate-1.2.2/resip/dum/DialogUsageManager.cxx:1388 #8 0x0011adf4 in SipEP::run (this=0x286f8cb0) at
/Users/ss-kobi/source/client/xcode/../QvixApp/AppSrc/pstn/SipEP.cxx:3011 #9 0x00114341 in SipEP::staticSDLThread
(arg=0x286f8cb0) at
/Users/ss-kobi/source/client/xcode/../QvixApp/AppSrc/pstn/SipEP.cxx:817 #10 0x3002d649 in SDL_RunThread () #11 0x3002f1e8 in RunThread () #12 0x90024227 in _pthread_body () Current language: auto; currently c++ On Feb 1, 2008, at 10:06 PM, Scott Godin wrote:
When is an InviteSession ever copied? I don’t think
this is a problem. From: Kobi
Eshun [mailto:kobi@xxxxxxxxxxxxxx] Hi Scott, I found an issue with the
implementation: the elements of mNITQueue are not correctly duplicated on an
InviteSession copy as currently implemented (my bad, not yours). I changed it to be a queue of
shared rather than raw pointers. -- kobi
On Feb 1, 2008, at 9:07 AM, Scott
Godin wrote:
Thanks Kobi! I think this patch
is a good idea - I've had to do the same thing at the app level in many of the
applications I've created. <resiprocate_queued_NITs-scott.diff> |