Re: [Ekiga-devel-list] Crash on... startup!



Julien Puydt schrieb:
Julien Puydt a écrit :
I had a nice surprise this morning, trying to launch ekiga :
I'll try to update my ptlib&opal to see if I have just been unlucky.

I retried this evening : still crashing :-(

Snark
_______________________________________________

I tried this evening on WIN32 : still crashing.
I guess we will have to exercise patience.
I made shure that the reason for the crash is mainly in Opal's handlers.cxx index maps and not in Ekiga's heap. With attached patch Ekiga works.
Michael
diff -ur src/opal/include/sip/handlers.h opal/include/sip/handlers.h
--- src/opal/include/sip/handlers.h	2009-10-09 14:40:45.000000000 +0200
+++ opal/include/sip/handlers.h	2009-10-13 18:00:33.000000000 +0200
@@ -166,8 +166,9 @@
   OpalProductInfo             m_productInfo;
 
   // Keep a copy of the keys used for easy removal on destruction
-  typedef std::map<PString, PSafePtr<SIPHandler> > IndexMap;
+  typedef std::multimap<PString, PSafePtr<SIPHandler> > IndexMap;
   IndexMap::iterator m_byCallID;
+  IndexMap::iterator m_byAOR;
   IndexMap::iterator m_byAorAndPackage;
   IndexMap::iterator m_byAuthIdAndRealm;
   IndexMap::iterator m_byAorUserAndRealm;
@@ -417,6 +418,7 @@
     PSafePtr<SIPHandler> FindBy(IndexMap & by, const PString & key, PSafetyMode m);
 
     IndexMap m_byCallID;
+    IndexMap m_byAOR;
     IndexMap m_byAorAndPackage;
     IndexMap m_byAuthIdAndRealm;
     IndexMap m_byAorUserAndRealm;
diff -ur src/opal/src/sip/handlers.cxx opal/src/sip/handlers.cxx
--- src/opal/src/sip/handlers.cxx	2009-10-09 14:40:46.000000000 +0200
+++ opal/src/sip/handlers.cxx	2009-10-13 18:01:48.000000000 +0200
@@ -89,7 +89,7 @@
   transactions.DisallowDeleteObjects();
   expireTimer.SetNotifier(PCREATE_NOTIFIER(OnExpireTimeout));
 
-  PTRACE(4, "SIP\tConstructed handler for " << params.m_addressOfRecord);
+  PTRACE(4, "SIP\tConstructed handler\n" << params);
 }
 
 
@@ -1621,16 +1621,19 @@
   PSafePtr<SIPHandler> handler = m_handlersList.Append(obj, PSafeReference);
 
   // add entry to call to handler map
-  handler->m_byCallID = m_byCallID.insert(IndexMap::value_type(handler->GetCallID(), handler)).first;
+  handler->m_byCallID = m_byCallID.insert(IndexMap::value_type(handler->GetCallID(), handler));
+
+  // add entry to url map
+  handler->m_byAOR = m_byAOR.insert(IndexMap::value_type(MakeUrlKey(handler->GetAddressOfRecord(), handler->GetMethod()), handler));
 
   // add entry to url and package map
-  handler->m_byAorAndPackage = m_byAorAndPackage.insert(IndexMap::value_type(MakeUrlKey(handler->GetAddressOfRecord(), handler->GetMethod(), handler->GetEventPackage()), handler)).first;
+  handler->m_byAorAndPackage = m_byAorAndPackage.insert(IndexMap::value_type(MakeUrlKey(handler->GetAddressOfRecord(), handler->GetMethod(), handler->GetEventPackage()), handler));
 
   // add entry to username/realm map
   if (!handler->GetUsername().IsEmpty())
-    handler->m_byAuthIdAndRealm = m_byAuthIdAndRealm.insert(IndexMap::value_type(handler->GetUsername() + '\n' + handler->GetRealm(), handler)).first;
+    handler->m_byAuthIdAndRealm = m_byAuthIdAndRealm.insert(IndexMap::value_type(handler->GetUsername() + '\n' + handler->GetRealm(), handler));
 
-  handler->m_byAorUserAndRealm = m_byAorUserAndRealm.insert(IndexMap::value_type(handler->GetAddressOfRecord().GetUserName() + '\n' + handler->GetRealm(), handler)).first;
+  handler->m_byAorUserAndRealm = m_byAorUserAndRealm.insert(IndexMap::value_type(handler->GetAddressOfRecord().GetUserName() + '\n' + handler->GetRealm(), handler));
 }
 
 
@@ -1646,6 +1649,7 @@
 
   if (m_handlersList.Remove(handler)) {
     m_byCallID.erase(handler->m_byCallID);
+    m_byAOR.erase(handler->m_byAOR);
     m_byAorAndPackage.erase(handler->m_byAorAndPackage);
     m_byAuthIdAndRealm.erase(handler->m_byAuthIdAndRealm);
     m_byAorUserAndRealm.erase(handler->m_byAorUserAndRealm);
@@ -1686,7 +1690,7 @@
 
 PSafePtr<SIPHandler> SIPHandlersList::FindSIPHandlerByUrl(const PURL & aor, SIP_PDU::Methods method, PSafetyMode mode)
 {
-  return FindBy(m_byAorAndPackage, MakeUrlKey(aor, method), mode);
+  return FindBy(m_byAOR, MakeUrlKey(aor, method), mode);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]