Thread: [OpenSIPStack] Memory Leak in Proxy and Full Mode
Brought to you by:
joegenbaclor
From: Gustavo C. <cur...@ho...> - 2008-05-29 16:26:53
|
Hi Joegen I found a memory leak when the OpenSBC is configured in Proxy or Full mode. When i send a 200 Ok for example in B2B mode there is no memory leak, but when i send a 200 ok in Proxy or Full mode, some memory is taken and never released. I attach the logs. The OpenSBC (192.168.0.202:5070) is running under Windows. Thanks for your help Gustavo _________________________________________________________________ Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo. http://msn.foxsports.com/fslasc/ |
From: Joegen E. B. <joe...@gm...> - 2008-05-30 03:26:20
|
Hi Gustavo, Take a look at void ProxySession::OnFinalResponse( SIPMessage & message ) method. Can you verify if the object created in: manager.CreateTuple( m_OriginalInvite, m_RoutedInvite, 10 ); Actually expires after 10 seconds? Putting a breakpoint at ProxySessionTupleManager::Tuple::~Tuple() should be enough to confirm it. Also by any chance, did you accidentally think that this tuple is the mem leak because it was created after the transaction? Joegen Gustavo Curetti wrote: > Hi Joegen > > I found a memory leak when the OpenSBC is configured in Proxy or Full mode. When i send a 200 Ok for example in B2B mode there is no memory leak, but when i send a 200 ok in Proxy or Full mode, some memory is taken and never released. I attach the logs. The OpenSBC (192.168.0.202:5070) is running under Windows. > > Thanks for your help > > Gustavo > _________________________________________________________________ > Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo. > http://msn.foxsports.com/fslasc/ > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > ------------------------------------------------------------------------ > > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM > |
From: Gustavo C. <cur...@ho...> - 2008-05-30 15:04:35
|
Hi Joegen: I found that the memory leak is when you create a SIPMessage from other SIPMessage or from a OString and then you delete de message. In the case of the 200 Ok the message is created in: ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent() { SIPMessage * msg = new SIPMessage(message); The memory leak is because the CSeq header. If i comment : SIPMessage::SIPMessage(const SIPMessage & msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void SIPMessage::AssignContents(SIPMessage & msg) { /*if( m_CSeq != NULL ) msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/ } There is no more memory leak. I try to replace: SIPMessage * msg = new SIPMessage(message); ----> SIPMessage * msg = new SIPMessage(message.AsString()); but the memory leak still exist unless i comment: void SIPMessage::Finalize() { /*if( m_CSeq == NULL ) { m_CSeq = new CSeq( h ); }*/ } That's what i found so far. Gustavo > Date: Fri, 30 May 2008 11:26:11 +0800> To: cur...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From: joe...@gm...> > Hi Gustavo,> > Take a look at void ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can you verify if the object created in:> > manager.CreateTuple( m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10 seconds?> > Putting a breakpoint at ProxySessionTupleManager::Tuple::~Tuple() should > be enough to confirm it.> > Also by any chance, did you accidentally think that this tuple is the > mem leak because it was created after the transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > > > I found a memory leak when the OpenSBC is configured in Proxy or Full mode. When i send a 200 Ok for example in B2B mode there is no memory leak, but when i send a 200 ok in Proxy or Full mode, some memory is taken and never released. I attach the logs. The OpenSBC (192.168.0.202:5070) is running under Windows.> > > > Thanks for your help> > > > Gustavo> > _________________________________________________________________> > Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo.> > http://msn.foxsports.com/fslasc/> > ------------------------------------------------------------------------> >> > -------------------------------------------------------------------------> > This SF.net email is sponsored by: Microsoft> > Defy all challenges. Microsoft(R) Visual Studio 2008.> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > ------------------------------------------------------------------------> >> > _______________________________________________> > opensipstack-devel mailing list> > ope...@li...> > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > ------------------------------------------------------------------------> >> > No virus found in this incoming message.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > _________________________________________________________________ Descargá ya gratis y viví la experiencia Windows Live. http://www.descubrewindowslive.com/latam/index.html |
From: Gustavo C. <cur...@ho...> - 2008-05-30 20:14:33
|
Hi Joegen: The memory leak is hard to find. I send the 200 OK repeatedly but the memory leak doesn't appear if i'm debugging with Microsot Visual 2005, but the leak appears if i'm running the OpenSBC like a service. If I comment: void SIPStack::EnqueueTransportWriteEvent( const SIPMessage & message, SIPTransportEvent::Type eventType ) { if( m_IsTerminating ) return; /*SIPMessage * msg = new SIPMessage(message); msg->SetInternalHeader( "TRN-ID", msg->GetTransactionId().AsString()); m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, eventType ) );*/ } there is not leak. But if I modify the code like this: void SIPStack::EnqueueTransportWriteEvent( const SIPMessage & message, SIPTransportEvent::Type eventType ) { if( m_IsTerminating ) return; SIPMessage * msg = new SIPMessage(message); /*msg->SetInternalHeader( "TRN-ID", msg->GetTransactionId().AsString()); m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, eventType ) );*/ delete msg; } the leak shows up. I don't understand why this happens if I'm deleting the msg. What i said in the last mail about CSeq is not seem to be the reason. Any idea? Thanks for your help. Gustavo From: cur...@ho...Subject: RE: [OpenSIPStack] Memory Leak in Proxy and Full ModeDate: Fri, 30 May 2008 17:04:37 +0200 Hi Joegen: I found that the memory leak is when you create a SIPMessage from other SIPMessage or from a OString and then you delete de message. In the case of the 200 Ok the message is created in: ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent(){SIPMessage * msg = new SIPMessage(message); The memory leak is because the CSeq header. If i comment : SIPMessage::SIPMessage(const SIPMessage & msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void SIPMessage::AssignContents(SIPMessage & msg){ /*if( m_CSeq != NULL ) msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/} There is no more memory leak. I try to replace: SIPMessage * msg = new SIPMessage(message); ----> SIPMessage * msg = new SIPMessage(message.AsString()); but the memory leak still exist unless i comment: void SIPMessage::Finalize(){ /*if( m_CSeq == NULL ) { m_CSeq = new CSeq( h ); }*/} That's what i found so far. Gustavo > Date: Fri, 30 May 2008 11:26:11 +0800> To: cur...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From: joe...@gm...> > Hi Gustavo,> > Take a look at void ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can you verify if the object created in:> > manager.CreateTuple( m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10 seconds?> > Putting a breakpoint at ProxySessionTupleManager::Tuple::~Tuple() should > be enough to confirm it.> > Also by any chance, did you accidentally think that this tuple is the > mem leak because it was created after the transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > > > I found a memory leak when the OpenSBC is configured in Proxy or Full mode. When i send a 200 Ok for example in B2B mode there is no memory leak, but when i send a 200 ok in Proxy or Full mode, some memory is taken and never released. I attach the logs. The OpenSBC (192.168.0.202:5070) is running under Windows.> > > > Thanks for your help> > > > Gustavo> > _________________________________________________________________> > Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo.> > http://msn.foxsports.com/fslasc/> > ------------------------------------------------------------------------> >> > -------------------------------------------------------------------------> > This SF.net email is sponsored by: Microsoft> > Defy all challenges. Microsoft(R) Visual Studio 2008.> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > ------------------------------------------------------------------------> >> > _______________________________________________> > opensipstack-devel mailing list> > ope...@li...> > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > ------------------------------------------------------------------------> >> > No virus found in this incoming message.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de tus artistas favoritos. MSN en Concierto _________________________________________________________________ Descargá ya gratis y viví la experiencia Windows Live. http://www.descubrewindowslive.com/latam/index.html |
From: <jo...@op...> - 2008-06-02 02:19:43
|
Try putting a trace before and after the "delete" statement to be sure that its getting called. From what i see, assuming that SIPMessage destructor performs proper cleanup, that a leak here can only be caused by an exception occurring in the SIPMessage constructor; Gustavo Curetti wrote: > Hi Joegen: > > The memory leak is hard to find. I send the 200 OK repeatedly but the memory leak doesn't appear if i'm debugging with Microsot Visual 2005, but the leak appears if i'm running the OpenSBC like a service. > > If I comment: > > > void SIPStack::EnqueueTransportWriteEvent( > const SIPMessage & message, > SIPTransportEvent::Type eventType > ) > { > if( m_IsTerminating ) > return; > > /*SIPMessage * msg = new SIPMessage(message); > > msg->SetInternalHeader( "TRN-ID", msg->GetTransactionId().AsString()); > m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, eventType ) );*/ > } > > there is not leak. But if I modify the code like this: > > > void SIPStack::EnqueueTransportWriteEvent( > const SIPMessage & message, > SIPTransportEvent::Type eventType > ) > { > if( m_IsTerminating ) > return; > > SIPMessage * msg = new SIPMessage(message); > > /*msg->SetInternalHeader( "TRN-ID", msg->GetTransactionId().AsString()); > m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, eventType ) );*/ > delete msg; > } > > the leak shows up. I don't understand why this happens if I'm deleting the msg. > What i said in the last mail about CSeq is not seem to be the reason. > Any idea? Thanks for your help. > Gustavo > > > From: cur...@ho...Subject: RE: [OpenSIPStack] Memory Leak in Proxy and Full ModeDate: Fri, 30 May 2008 17:04:37 +0200 > > > Hi Joegen: I found that the memory leak is when you create a SIPMessage from other SIPMessage or from a OString and then you delete de message. In the case of the 200 Ok the message is created in: ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent(){SIPMessage * msg = new SIPMessage(message); The memory leak is because the CSeq header. If i comment : SIPMessage::SIPMessage(const SIPMessage & msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void SIPMessage::AssignContents(SIPMessage & msg){ /*if( m_CSeq != NULL ) msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/} There is no more memory leak. I try to replace: SIPMessage * msg = new SIPMessage(message); ----> SIPMessage * msg = new SIPMessage(message.AsString()); but the memory leak still exist unless i comment: void SIPMessage::Finalize(){ /*if( m_CSeq == NULL ) { m_CSeq = new CSeq( h ); }*/} That's what i found so far. Gustavo > > >> Date: Fri, 30 May 2008 11:26:11 +0800> To: cur...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From: joe...@gm...> > Hi Gustavo,> > Take a look at void ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can you verify if the object created in:> > manager.CreateTuple( m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10 seconds?> > Putting a breakpoint at ProxySessionTupleManager::Tuple::~Tuple() should > be enough to confirm it.> > Also by any chance, did you accidentally think that this tuple is the > mem leak because it was created after the transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > > > I found a memory leak when the OpenSBC is configured in Proxy or Full mode. When i send a 200 Ok for example in B2B mode there is no memory leak, but when i send a 200 ok in Proxy or Full mode, some memory is taken and never released. I attach the logs. The OpenSBC (192.168.0.202:5070) is running under Windows.> > > > Thanks for your help> > > > Gustavo> > _________________________________________________________________> > Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo.> > http://msn.foxsports.com/fslasc/> > ------------------------------------------------------------------------> >> > -------------------------------------------------------------------------> > This SF.net email is sponsored by: Microsoft> > Defy all challenges. Microsoft(R) Visual Studio 2008.> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > ------------------------------------------------------------------------> >> > _______________________________________________> > opensipstack-devel mailing list> > ope...@li...> > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > ------------------------------------------------------------------------> >> > No virus found in this incoming message.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > >> > > Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de tus artistas favoritos. MSN en Concierto > _________________________________________________________________ > Descargá ya gratis y viví la experiencia Windows Live. > http://www.descubrewindowslive.com/latam/index.html > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > > |
From: Joegen E. B. <joe...@gm...> - 2008-06-19 00:50:12
|
Right! I've found m_MinSE is not getting deleted in SIPMessage::CleanUp(). Patched this in CVS. Joegen Gustavo Curetti wrote: > Hi Joegen > > The modification doesn't solve the memory issues. I continue searching > for the memory leak. > > A new case is attached and this one appear too when debugging with > Microsot Visual. > > Originally, i sent the attached Invite every 250 ms and I set the > timer B and H in 20 ms: > > #define SIP_TIMER_B 20 > > #define SIP_TIMER_H 20 > > Then I change the code > of B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() > for making easier to replicate the leak: > > > void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() > { > while( !m_UpperRegSync.Wait( 250 ) ) > { > OString testRequest = > "INVITE sip:5435155555@192.168.0.5:5060 SIP/2.0\r\nContact: > <sip:4284623@192.168.0.10:5060>\r\nCSeq: 101 INVITE\r\nFrom: > <sip:4284623@192.168.0.10>;tag=5A3745C-2418\r\nTo: > <sip:55555555@192.168.0.206>\r\nVia: SIP/2.0/UDP > 192.168.0.206:5060;branch=z9hG4bK63028de3a6b7743a\r\nVia: SIP/2.0/UDP > 192.168.0.10:5060\r\nRecord-Route: > <sip:192.168.0.206:5060;lr>\r\nAllow: INVITE, OPTIONS, BYE, CANCEL, > ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO\r\nUser-Agent: > Cisco-SIPGateway/IOS-12.x\r\nCall-Id: > 3738EB25-278011DD-B92F90A6-C0EF6BE3@192.168.0.10\r\nMax-Forwards > <mailto:3738EB25-278011DD-B92F90A6-C0EF6BE3@192.168.0.10%5Cr%5CnMax-Forwards>: > 6\r\nExpires: 180\r\nContent-Length: 235\r\ndate: Thu, 22 May 2008 > 21:52:32 GMT\r\nsupported: timer\r\nmin-se: 1800\r\ncisco-guid: > 926237238-662704605-3106705574-3236916195\r\nremote-party-id: > <sip:4284623@192.168.0.10>;party=calling;screen=no;privacy=off\r\ntimestamp: > 1211493152\r\nallow-events: telephone-event\r\ncontent-type: > application/sdp\r\n\r\nv=0\r\no=CiscoSystemsSIP-GW-UserAgent 7402 717 > IN IP4 192.168.0.10\r\ns=SIP Call\r\nc=IN IP4 192.168.0.10\r\nt=0 > 0\r\nm=audio 19298 RTP/AVP 0 19\r\nc=IN IP4 192.168.0.10\r\na=rtpmap:0 > PCMU/8000\r\na=rtpmap:19 CN/8000\r\na=ptime:20"; > testRequest = ParserTools::LineFeedSanityCheck( testRequest ); > SIPMessage * msg = new SIPMessage( testRequest ); > > OString addrStr = "192.168.0.147"; > OString portStr = "10000"; > SIPHeader rcvAddr( "RCVADDR", addrStr ); > SIPHeader rcvPort( "RCVPORT", portStr ); > SIPHeader rcvTran( "RCVTRAN", "udp" ); > > msg->AddInternalHeader( rcvAddr ); > msg->AddInternalHeader( rcvPort ); > msg->AddInternalHeader( rcvTran ); > msg->SetInterfaceAddress( "192.168.0.202" ); > msg->SetInterfacePort( 5070 ); > > OStringStream traceStream; > > traceStream << "<<< " > << msg->GetStartLine() << " " > << " SRC: " << addrStr << ":" << portStr << ":UDP" > << " enc=" << msg->IsEncrypted() > << " bytes=1103"; > > OStringStream strPacket; > strPacket << *msg; > COMPOUND_LOG_CONTEXT( LogInfo(), msg->GetCallId(), > traceStream.str(), LogDebugHigh(), strPacket ); > > SIPTransport::NotifyRead( traceStream.str() ); > > if( msg->IsInvite() ) > { > SIPMessage * trying = new SIPMessage(); > msg->CreateResponse( *trying, SIPMessage::Code100_Trying ); > Via via; > msg->GetViaAt(0, via ); > if( via.IsBehindNAT() ) > { > SIPURI srcURI; > srcURI.SetHost(addrStr); > srcURI.SetPort(portStr); > trying->SetSendAddress(srcURI); > } > if( msg->IsEncrypted() ) > trying->SetEncryption( TRUE ); > GetTransportManager()->ProcessOutbound( trying ); > } > > GetTransportManager()->OnTransportEvent( > new SIPTransportEvent( > msg, > SIPTransportEvent::UDPPacketArrival > ) ); > > /*///process the keep alives here > for( PINDEX i = 0; i < GetRegistrationDB().GetSize(); i++ ) > { > SIPMessage reg; > if( GetRegistrationDB().GetRegistration( i, reg ) ) > { > if( reg.HasInternalHeader( "upper-reg" ) ) > { > /// this is an upper reg, send a keep-alive > /// Check the last via if its from a private IP > Via via; > if( reg.GetViaAt( reg.GetViaSize() - 1, via ) ) > { > if( via.IsBehindNAT() ) > { > SIPURI target; > target.SetHost( via.GetReceiveAddress().AsSTLString() ); > target.SetPort( via.GetRPort() ); > SIPMessage keepAlive; > RequestLine requestLine; > requestLine.SetMethod( "KEEP-ALIVE" ); > requestLine.SetRequestURI( target ); > keepAlive.SetStartLine( requestLine ); > GetUserAgent().TransportWrite( keepAlive ); > } > } > } > } > }*/ > } > } > > > The OpenSBC is in "Proxy Only Mode" and the configuration is in > "OpenSBC.reg" (attached). > > I compile the OpenSBC in Microsoft Visual C++ 2005 obtaining the exe > attached. > > Any idea? > > Thanks for your help. > > Gustavo > > > > ------------------------------------------------------------------------ > > > Date: Thu, 5 Jun 2008 14:18:35 +0800 > > To: cur...@gm... > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode > > From: joe...@gm... > > > > Hi Gustavo, > > > > Yes, i'm able to replicate it. For some reason, the code I #ifdefed in > > AppendVia() below is causing it. Let me know if it solves your issues. > > I've tried looking at what its doing but nothing is evident as to > why it > > would leak. If you find something, let me know > > > > Joegen > > > > BOOL SIPMessage::AppendVia( > > const Via & header > > ) > > { > > GlobalLock(); > > > > ParseViaList(); > > > > if( m_ViaList == NULL ) > > { > > m_ViaList = new Via::Collection(); > > m_ViaList->Append( new Via( header ) ); > > }else > > { > > > > #if 0 // For some reason, this sanity check is leaking mem > > /// sanity check > > if( m_ViaList->GetSize() > 0 ) > > { > > Via & topVia = (*m_ViaList)[0]; > > > > SIPURI topViaURI = topVia.GetURI(); > > > > SIPURI newURI = header.GetURI(); > > > > if( SIPTransport::IsTheSameAddress( topViaURI, newURI, TRUE ) ) > > return FALSE; > > } > > #endif > > > > ///we append it on top > > Via::Collection oldViaList = *m_ViaList; > > oldViaList.MakeUnique(); > > delete m_ViaList; > > > > m_ViaList = new Via::Collection(); > > m_ViaList->Append( new Via( header ) ); > > > > for( PINDEX i = 0; i < oldViaList.GetSize(); i++ ) > > m_ViaList->Append( new Via( oldViaList[i] ) ); > > > > m_ViaList->MakeUnique(); > > } > > > > > > return TRUE; > > } > > > > > > Gustavo Curetti wrote: > > > > > > Hi Joegen > > > > > > The destructor is called. The problem seem to be the headers like > Via, > > > RecordRoute, Contact, Allow, Supported (List headers). > > > > > > The leak is very easy to reproduce. I change the code of > > > B2BUserAgent::Registrar::ProcessUpperRegKeepAlive: > > > > > > > > > void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() > > > { > > > while( !m_UpperRegSync.Wait( 10 ) ) > > > { > > > > > > SIPMessage * msg = new SIPMessage(); > > > > > > msg->AppendVia(Via("SIP/2.0/UDP 192.168.0.10:5060")); > > > msg->AppendVia(Via("SIP/2.0/UDP > > > > 192.168.0.206:5060;branch=z9hG4bK440fdc3e04de9d10;rport=5060;received=192.168.0.206")); > > > msg->AppendRecordRoute(RouteURI("<sip:192.168.0.206:5060;lr>")); > > > msg->AppendContact(ContactURI("<sip:5435155555@192.168.0.5>")); > > > msg->AppendAllow(Allow("INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, > > > SUBSCRIBE, NOTIFY")); > > > msg->AppendSupported(Supported("replaces")); > > > > > > delete msg; > > > } > > > } > > > > > > > > > I compile the OpenSBC in Microsoft Visual C++ 2005 obtaining the exe > > > attached. > > > I execute "OpenSBC Debug" in Windows 2003 or Windows 2000 and the > leak > > > is there. > > > > > > I put traces and SIPMessage::~SIPMessage(), SIPMessage::Cleanup() are > > > called. > > > > > > Any idea? > > > > > > Thanks for your help. > > > > > > Gustavo > > > > > > > ------------------------------------------------------------------------ > > > > > > > Date: Mon, 2 Jun 2008 10:19:08 +0800 > > > > To: cur...@gm...; > ope...@li... > > > > From: joe...@gm... > > > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode > > > > > > > > Try putting a trace before and after the "delete" statement to > be sure > > > > that its getting called. From what i see, assuming that SIPMessage > > > > destructor performs proper cleanup, that a leak here can only be > caused > > > > by an exception occurring in the SIPMessage constructor; > > > > > > > > Gustavo Curetti wrote: > > > > > Hi Joegen: > > > > > > > > > > The memory leak is hard to find. I send the 200 OK repeatedly but > > > the memory leak doesn't appear if i'm debugging with Microsot Visual > > > 2005, but the leak appears if i'm running the OpenSBC like a service. > > > > > > > > > > If I comment: > > > > > > > > > > > > > > > void SIPStack::EnqueueTransportWriteEvent( > > > > > const SIPMessage & message, > > > > > SIPTransportEvent::Type eventType > > > > > ) > > > > > { > > > > > if( m_IsTerminating ) > > > > > return; > > > > > > > > > > /*SIPMessage * msg = new SIPMessage(message); > > > > > > > > > > msg->SetInternalHeader( "TRN-ID", > msg->GetTransactionId().AsString()); > > > > > m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, > > > eventType ) );*/ > > > > > } > > > > > > > > > > there is not leak. But if I modify the code like this: > > > > > > > > > > > > > > > void SIPStack::EnqueueTransportWriteEvent( > > > > > > > const SIPMessage & message, > > > > > SIPTransportEvent::Type eventType > > > > > ) > > > > > { > > > > > if( m_IsTerminating ) > > > > > return; > > > > > > > > > > SIPMessage * msg = new SIPMessage(message); > > > > > > > > > > /*msg->SetInternalHeader( "TRN-ID", > > > msg->GetTransactionId().AsString()); > > > > > m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, > > > eventType ) );*/ > > > > > delete msg; > > > > > } > > > > > > > > > > the leak shows up. I don't understand why this happens if I'm > > > deleting the msg. > > > > > What i said in the last mail about CSeq is not seem to be the > reason. > > > > > Any idea? Thanks for your help. > > > > > Gustavo > > > > > > > > > > > > > > > From: cur...@ho...Subject: RE: [OpenSIPStack] > > > Memory Leak in Proxy and Full ModeDate: Fri, 30 May 2008 17:04:37 > +0200 > > > > > > > > > > > > > > > Hi Joegen: I found that the memory leak is when you create a > > > SIPMessage from other SIPMessage or from a OString and then you > delete > > > de message. In the case of the 200 Ok the message is created in: > > > > ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent(){SIPMessage > > > > * msg = new SIPMessage(message); The memory leak is because the CSeq > > > header. If i comment : SIPMessage::SIPMessage(const SIPMessage & > > > msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void > > > SIPMessage::AssignContents(SIPMessage & msg){ /*if( m_CSeq != NULL ) > > > msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/} There is no more > > > memory leak. I try to replace: SIPMessage * msg = new > > > SIPMessage(message); ----> SIPMessage * msg = new > > > SIPMessage(message.AsString()); but the memory leak still exist > unless > > > i comment: void SIPMessage::Finalize(){ /*if( m_CSeq == NULL ) { > > > m_CSeq = new CSeq( h ); }*/} That's what i found so far. Gustavo > > > > > > > > > > > > > > >> Date: Fri, 30 May 2008 11:26:11 +0800> To: > > > cur...@gm...; ope...@li...> > > > Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From: > > > joe...@gm...> > Hi Gustavo,> > Take a look at void > > > ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can > > > you verify if the object created in:> > manager.CreateTuple( > > > m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10 > > > seconds?> > Putting a breakpoint at > > > ProxySessionTupleManager::Tuple::~Tuple() should > be enough to > > > confirm it.> > Also by any chance, did you accidentally think that > > > this tuple is the > mem leak because it was created after the > > > transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > > > > > > > I found a memory leak when the OpenSBC is configured in Proxy or Full > > > mode. When i send a 200 Ok for example in B2B mode there is no memory > > > leak, but when i send a 200 ok in Proxy or Full mode, some memory is > > > taken and never released. I attach the logs. The OpenSBC > > > (192.168.0.202:5070) is running under Windows.> > > > Thanks for your > > > help> > > > Gustavo> > > > > _________________________________________________________________> > > > > Ingresá ya a MSN Deportes y enterate de las últimas novedades del > > > mundo deportivo.> > http://msn.foxsports.com/fslasc/> > > > > > ------------------------------------------------------------------------> > > > >> > > > > > -------------------------------------------------------------------------> > > > > > This SF.net email is sponsored by: Microsoft> > Defy all > challenges. > > > Microsoft(R) Visual Studio 2008.> > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > > > > > ------------------------------------------------------------------------> > > > >> > _______________________________________________> > > > > opensipstack-devel mailing list> > > > > ope...@li...> > > > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > > > > > > ------------------------------------------------------------------------> > > > >> > No virus found in this incoming message.> > Checked by AVG. > > > > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: > > > 5/23/2008 3:36 PM> > > > > > > > >> > > > > > > > > > > Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de > > > tus artistas favoritos. MSN en Concierto > > > > > _________________________________________________________________ > > > > > Descargá ya gratis y viví la experiencia Windows Live. > > > > > http://www.descubrewindowslive.com/latam/index.html > > > > > > > > > ------------------------------------------------------------------------- > > > > > This SF.net email is sponsored by: Microsoft > > > > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > > > _______________________________________________ > > > > > opensipstack-devel mailing list > > > > > ope...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by: Microsoft > > > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > > _______________________________________________ > > > > opensipstack-devel mailing list > > > > ope...@li... > > > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > > > > > > > > ------------------------------------------------------------------------ > > > Descargá ya gratis y viví la experiencia Windows Live. Descubre > > > Windows Live <http://www.descubrewindowslive.com/latam/index.html> > > > > ------------------------------------------------------------------------ > > > > > > Internal Virus Database is out-of-date. > > > Checked by AVG. > > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: > 5/23/2008 3:36 PM > > > > > > > > > > ------------------------------------------------------------------------ > Ingresá ya a MSN Deportes y enterate de las últimas novedades del > mundo deportivo. MSN Deportes <http://msn.foxsports.com/fslasc/> > ------------------------------------------------------------------------ > > Internal Virus Database is out-of-date. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM > |
From: Joegen E. B. <joe...@gm...> - 2008-06-19 01:02:26
|
Hi Gustavo, I've been tracking this issue in assembla. Feel free to create an account in the tracker so you could comment on the status of the leak. http://www.assembla.com/spaces/opensbc/tickets/22 Joegen Joegen E. Baclor wrote: > Right! I've found m_MinSE is not getting deleted in > SIPMessage::CleanUp(). Patched this in CVS. > > Joegen > > Gustavo Curetti wrote: > >> Hi Joegen >> >> The modification doesn't solve the memory issues. I continue searching >> for the memory leak. >> >> A new case is attached and this one appear too when debugging with >> Microsot Visual. >> >> Originally, i sent the attached Invite every 250 ms and I set the >> timer B and H in 20 ms: >> >> #define SIP_TIMER_B 20 >> >> #define SIP_TIMER_H 20 >> >> Then I change the code >> of B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() >> for making easier to replicate the leak: >> >> >> void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() >> { >> while( !m_UpperRegSync.Wait( 250 ) ) >> { >> OString testRequest = >> "INVITE sip:5435155555@192.168.0.5:5060 SIP/2.0\r\nContact: >> <sip:4284623@192.168.0.10:5060>\r\nCSeq: 101 INVITE\r\nFrom: >> <sip:4284623@192.168.0.10>;tag=5A3745C-2418\r\nTo: >> <sip:55555555@192.168.0.206>\r\nVia: SIP/2.0/UDP >> 192.168.0.206:5060;branch=z9hG4bK63028de3a6b7743a\r\nVia: SIP/2.0/UDP >> 192.168.0.10:5060\r\nRecord-Route: >> <sip:192.168.0.206:5060;lr>\r\nAllow: INVITE, OPTIONS, BYE, CANCEL, >> ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO\r\nUser-Agent: >> Cisco-SIPGateway/IOS-12.x\r\nCall-Id: >> 3738EB25-278011DD-B92F90A6-C0EF6BE3@192.168.0.10\r\nMax-Forwards >> <mailto:3738EB25-278011DD-B92F90A6-C0EF6BE3@192.168.0.10%5Cr%5CnMax-Forwards>: >> 6\r\nExpires: 180\r\nContent-Length: 235\r\ndate: Thu, 22 May 2008 >> 21:52:32 GMT\r\nsupported: timer\r\nmin-se: 1800\r\ncisco-guid: >> 926237238-662704605-3106705574-3236916195\r\nremote-party-id: >> <sip:4284623@192.168.0.10>;party=calling;screen=no;privacy=off\r\ntimestamp: >> 1211493152\r\nallow-events: telephone-event\r\ncontent-type: >> application/sdp\r\n\r\nv=0\r\no=CiscoSystemsSIP-GW-UserAgent 7402 717 >> IN IP4 192.168.0.10\r\ns=SIP Call\r\nc=IN IP4 192.168.0.10\r\nt=0 >> 0\r\nm=audio 19298 RTP/AVP 0 19\r\nc=IN IP4 192.168.0.10\r\na=rtpmap:0 >> PCMU/8000\r\na=rtpmap:19 CN/8000\r\na=ptime:20"; >> testRequest = ParserTools::LineFeedSanityCheck( testRequest ); >> SIPMessage * msg = new SIPMessage( testRequest ); >> >> OString addrStr = "192.168.0.147"; >> OString portStr = "10000"; >> SIPHeader rcvAddr( "RCVADDR", addrStr ); >> SIPHeader rcvPort( "RCVPORT", portStr ); >> SIPHeader rcvTran( "RCVTRAN", "udp" ); >> >> msg->AddInternalHeader( rcvAddr ); >> msg->AddInternalHeader( rcvPort ); >> msg->AddInternalHeader( rcvTran ); >> msg->SetInterfaceAddress( "192.168.0.202" ); >> msg->SetInterfacePort( 5070 ); >> >> OStringStream traceStream; >> >> traceStream << "<<< " >> << msg->GetStartLine() << " " >> << " SRC: " << addrStr << ":" << portStr << ":UDP" >> << " enc=" << msg->IsEncrypted() >> << " bytes=1103"; >> >> OStringStream strPacket; >> strPacket << *msg; >> COMPOUND_LOG_CONTEXT( LogInfo(), msg->GetCallId(), >> traceStream.str(), LogDebugHigh(), strPacket ); >> >> SIPTransport::NotifyRead( traceStream.str() ); >> >> if( msg->IsInvite() ) >> { >> SIPMessage * trying = new SIPMessage(); >> msg->CreateResponse( *trying, SIPMessage::Code100_Trying ); >> Via via; >> msg->GetViaAt(0, via ); >> if( via.IsBehindNAT() ) >> { >> SIPURI srcURI; >> srcURI.SetHost(addrStr); >> srcURI.SetPort(portStr); >> trying->SetSendAddress(srcURI); >> } >> if( msg->IsEncrypted() ) >> trying->SetEncryption( TRUE ); >> GetTransportManager()->ProcessOutbound( trying ); >> } >> >> GetTransportManager()->OnTransportEvent( >> new SIPTransportEvent( >> msg, >> SIPTransportEvent::UDPPacketArrival >> ) ); >> >> /*///process the keep alives here >> for( PINDEX i = 0; i < GetRegistrationDB().GetSize(); i++ ) >> { >> SIPMessage reg; >> if( GetRegistrationDB().GetRegistration( i, reg ) ) >> { >> if( reg.HasInternalHeader( "upper-reg" ) ) >> { >> /// this is an upper reg, send a keep-alive >> /// Check the last via if its from a private IP >> Via via; >> if( reg.GetViaAt( reg.GetViaSize() - 1, via ) ) >> { >> if( via.IsBehindNAT() ) >> { >> SIPURI target; >> target.SetHost( via.GetReceiveAddress().AsSTLString() ); >> target.SetPort( via.GetRPort() ); >> SIPMessage keepAlive; >> RequestLine requestLine; >> requestLine.SetMethod( "KEEP-ALIVE" ); >> requestLine.SetRequestURI( target ); >> keepAlive.SetStartLine( requestLine ); >> GetUserAgent().TransportWrite( keepAlive ); >> } >> } >> } >> } >> }*/ >> } >> } >> >> >> The OpenSBC is in "Proxy Only Mode" and the configuration is in >> "OpenSBC.reg" (attached). >> >> I compile the OpenSBC in Microsoft Visual C++ 2005 obtaining the exe >> attached. >> >> Any idea? >> >> Thanks for your help. >> >> Gustavo >> >> >> >> ------------------------------------------------------------------------ >> >> >>> Date: Thu, 5 Jun 2008 14:18:35 +0800 >>> To: cur...@gm... >>> Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode >>> From: joe...@gm... >>> >>> Hi Gustavo, >>> >>> Yes, i'm able to replicate it. For some reason, the code I #ifdefed in >>> AppendVia() below is causing it. Let me know if it solves your issues. >>> I've tried looking at what its doing but nothing is evident as to >>> >> why it >> >>> would leak. If you find something, let me know >>> >>> Joegen >>> >>> BOOL SIPMessage::AppendVia( >>> const Via & header >>> ) >>> { >>> GlobalLock(); >>> >>> ParseViaList(); >>> >>> if( m_ViaList == NULL ) >>> { >>> m_ViaList = new Via::Collection(); >>> m_ViaList->Append( new Via( header ) ); >>> }else >>> { >>> >>> #if 0 // For some reason, this sanity check is leaking mem >>> /// sanity check >>> if( m_ViaList->GetSize() > 0 ) >>> { >>> Via & topVia = (*m_ViaList)[0]; >>> >>> SIPURI topViaURI = topVia.GetURI(); >>> >>> SIPURI newURI = header.GetURI(); >>> >>> if( SIPTransport::IsTheSameAddress( topViaURI, newURI, TRUE ) ) >>> return FALSE; >>> } >>> #endif >>> >>> ///we append it on top >>> Via::Collection oldViaList = *m_ViaList; >>> oldViaList.MakeUnique(); >>> delete m_ViaList; >>> >>> m_ViaList = new Via::Collection(); >>> m_ViaList->Append( new Via( header ) ); >>> >>> for( PINDEX i = 0; i < oldViaList.GetSize(); i++ ) >>> m_ViaList->Append( new Via( oldViaList[i] ) ); >>> >>> m_ViaList->MakeUnique(); >>> } >>> >>> >>> return TRUE; >>> } >>> >>> >>> Gustavo Curetti wrote: >>> >>>> Hi Joegen >>>> >>>> The destructor is called. The problem seem to be the headers like >>>> >> Via, >> >>>> RecordRoute, Contact, Allow, Supported (List headers). >>>> >>>> The leak is very easy to reproduce. I change the code of >>>> B2BUserAgent::Registrar::ProcessUpperRegKeepAlive: >>>> >>>> >>>> void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() >>>> { >>>> while( !m_UpperRegSync.Wait( 10 ) ) >>>> { >>>> >>>> SIPMessage * msg = new SIPMessage(); >>>> >>>> msg->AppendVia(Via("SIP/2.0/UDP 192.168.0.10:5060")); >>>> msg->AppendVia(Via("SIP/2.0/UDP >>>> >>>> >> 192.168.0.206:5060;branch=z9hG4bK440fdc3e04de9d10;rport=5060;received=192.168.0.206")); >> >>>> msg->AppendRecordRoute(RouteURI("<sip:192.168.0.206:5060;lr>")); >>>> msg->AppendContact(ContactURI("<sip:5435155555@192.168.0.5>")); >>>> msg->AppendAllow(Allow("INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, >>>> SUBSCRIBE, NOTIFY")); >>>> msg->AppendSupported(Supported("replaces")); >>>> >>>> delete msg; >>>> } >>>> } >>>> >>>> >>>> I compile the OpenSBC in Microsoft Visual C++ 2005 obtaining the exe >>>> attached. >>>> I execute "OpenSBC Debug" in Windows 2003 or Windows 2000 and the >>>> >> leak >> >>>> is there. >>>> >>>> I put traces and SIPMessage::~SIPMessage(), SIPMessage::Cleanup() are >>>> called. >>>> >>>> Any idea? >>>> >>>> Thanks for your help. >>>> >>>> Gustavo >>>> >>>> >>>> >> ------------------------------------------------------------------------ >> >>>>> Date: Mon, 2 Jun 2008 10:19:08 +0800 >>>>> To: cur...@gm...; >>>>> >> ope...@li... >> >>>>> From: joe...@gm... >>>>> Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode >>>>> >>>>> Try putting a trace before and after the "delete" statement to >>>>> >> be sure >> >>>>> that its getting called. From what i see, assuming that SIPMessage >>>>> destructor performs proper cleanup, that a leak here can only be >>>>> >> caused >> >>>>> by an exception occurring in the SIPMessage constructor; >>>>> >>>>> Gustavo Curetti wrote: >>>>> >>>>>> Hi Joegen: >>>>>> >>>>>> The memory leak is hard to find. I send the 200 OK repeatedly but >>>>>> >>>> the memory leak doesn't appear if i'm debugging with Microsot Visual >>>> 2005, but the leak appears if i'm running the OpenSBC like a service. >>>> >>>>>> If I comment: >>>>>> >>>>>> >>>>>> void SIPStack::EnqueueTransportWriteEvent( >>>>>> const SIPMessage & message, >>>>>> SIPTransportEvent::Type eventType >>>>>> ) >>>>>> { >>>>>> if( m_IsTerminating ) >>>>>> return; >>>>>> >>>>>> /*SIPMessage * msg = new SIPMessage(message); >>>>>> >>>>>> msg->SetInternalHeader( "TRN-ID", >>>>>> >> msg->GetTransactionId().AsString()); >> >>>>>> m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, >>>>>> >>>> eventType ) );*/ >>>> >>>>>> } >>>>>> >>>>>> there is not leak. But if I modify the code like this: >>>>>> >>>>>> >>>>>> void SIPStack::EnqueueTransportWriteEvent( >>>>>> >>>>>> const SIPMessage & message, >>>>>> SIPTransportEvent::Type eventType >>>>>> ) >>>>>> { >>>>>> if( m_IsTerminating ) >>>>>> return; >>>>>> >>>>>> SIPMessage * msg = new SIPMessage(message); >>>>>> >>>>>> /*msg->SetInternalHeader( "TRN-ID", >>>>>> >>>> msg->GetTransactionId().AsString()); >>>> >>>>>> m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, >>>>>> >>>> eventType ) );*/ >>>> >>>>>> delete msg; >>>>>> } >>>>>> >>>>>> the leak shows up. I don't understand why this happens if I'm >>>>>> >>>> deleting the msg. >>>> >>>>>> What i said in the last mail about CSeq is not seem to be the >>>>>> >> reason. >> >>>>>> Any idea? Thanks for your help. >>>>>> Gustavo >>>>>> >>>>>> >>>>>> From: cur...@ho...Subject: RE: [OpenSIPStack] >>>>>> >>>> Memory Leak in Proxy and Full ModeDate: Fri, 30 May 2008 17:04:37 >>>> >> +0200 >> >>>>>> Hi Joegen: I found that the memory leak is when you create a >>>>>> >>>> SIPMessage from other SIPMessage or from a OString and then you >>>> >> delete >> >>>> de message. In the case of the 200 Ok the message is created in: >>>> >>>> >> ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent(){SIPMessage >> >> >>>> * msg = new SIPMessage(message); The memory leak is because the CSeq >>>> header. If i comment : SIPMessage::SIPMessage(const SIPMessage & >>>> msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void >>>> SIPMessage::AssignContents(SIPMessage & msg){ /*if( m_CSeq != NULL ) >>>> msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/} There is no more >>>> memory leak. I try to replace: SIPMessage * msg = new >>>> SIPMessage(message); ----> SIPMessage * msg = new >>>> SIPMessage(message.AsString()); but the memory leak still exist >>>> >> unless >> >>>> i comment: void SIPMessage::Finalize(){ /*if( m_CSeq == NULL ) { >>>> m_CSeq = new CSeq( h ); }*/} That's what i found so far. Gustavo >>>> >>>>>> >>>>>>> Date: Fri, 30 May 2008 11:26:11 +0800> To: >>>>>>> >>>> cur...@gm...; ope...@li...> >>>> Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From: >>>> joe...@gm...> > Hi Gustavo,> > Take a look at void >>>> ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can >>>> you verify if the object created in:> > manager.CreateTuple( >>>> m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10 >>>> seconds?> > Putting a breakpoint at >>>> ProxySessionTupleManager::Tuple::~Tuple() should > be enough to >>>> confirm it.> > Also by any chance, did you accidentally think that >>>> this tuple is the > mem leak because it was created after the >>>> transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > >>>> >>>> I found a memory leak when the OpenSBC is configured in Proxy or Full >>>> mode. When i send a 200 Ok for example in B2B mode there is no memory >>>> leak, but when i send a 200 ok in Proxy or Full mode, some memory is >>>> taken and never released. I attach the logs. The OpenSBC >>>> (192.168.0.202:5070) is running under Windows.> > > > Thanks for your >>>> help> > > > Gustavo> > >>>> _________________________________________________________________> > >>>> Ingresá ya a MSN Deportes y enterate de las últimas novedades del >>>> mundo deportivo.> > http://msn.foxsports.com/fslasc/> > >>>> >>>> >> ------------------------------------------------------------------------> >> >> -------------------------------------------------------------------------> >> >> >>>>> This SF.net email is sponsored by: Microsoft> > Defy all >>>>> >> challenges. >> >>>> Microsoft(R) Visual Studio 2008.> > >>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > >>>> >>>> >> ------------------------------------------------------------------------> >> >>>>>>> _______________________________________________> > >>>>>>> >>>> opensipstack-devel mailing list> > >>>> ope...@li...> > >>>> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > >>>> >>>> >>>> >> ------------------------------------------------------------------------> >> >>>>>>> No virus found in this incoming message.> > Checked by AVG. > > >>>>>>> >>>> Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: >>>> 5/23/2008 3:36 PM> > > > >>>> >>>>>> Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de >>>>>> >>>> tus artistas favoritos. MSN en Concierto >>>> >>>>>> _________________________________________________________________ >>>>>> Descargá ya gratis y viví la experiencia Windows Live. >>>>>> http://www.descubrewindowslive.com/latam/index.html >>>>>> >>>>>> >> ------------------------------------------------------------------------- >> >>>>>> This SF.net email is sponsored by: Microsoft >>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>>>>> _______________________________________________ >>>>>> opensipstack-devel mailing list >>>>>> ope...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >> ------------------------------------------------------------------------- >> >>>>> This SF.net email is sponsored by: Microsoft >>>>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>>>> _______________________________________________ >>>>> opensipstack-devel mailing list >>>>> ope...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >>>>> >>>> >>>> >> ------------------------------------------------------------------------ >> >>>> Descargá ya gratis y viví la experiencia Windows Live. Descubre >>>> Windows Live <http://www.descubrewindowslive.com/latam/index.html> >>>> >>>> >> ------------------------------------------------------------------------ >> >>>> Internal Virus Database is out-of-date. >>>> Checked by AVG. >>>> Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: >>>> >> 5/23/2008 3:36 PM >> >>> >> ------------------------------------------------------------------------ >> Ingresá ya a MSN Deportes y enterate de las últimas novedades del >> mundo deportivo. MSN Deportes <http://msn.foxsports.com/fslasc/> >> ------------------------------------------------------------------------ >> >> Internal Virus Database is out-of-date. >> Checked by AVG. >> Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM >> >> > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > |
From: voice <vo...@ne...> - 2008-12-06 16:07:57
|
Hi Joegen In the Sip-trunk config i have selected Send-Reg=NO I am using Broadvox wholesale, which means i have 2 SIP TRUNK'1 One for Termination x.x.x.10 One for Orgination x.x.x.20 I do not need username and password settings in <account> and maybe <Transient*> if i knew what Transient was used for* In light of these facts How should the Sip-Trunk Configure be setup or constructed and what is the bear minimum needed? r |
From: <jo...@op...> - 2008-12-08 01:02:27
|
If you do not need to authenticate with your trunk provider, then you not need to use SIP Trunking Module to place your calls. You may simply treat your Provider as a normal PSTN Gateway. Get rid of you SIP-Trunk config and use B2BUA-Routes instead. I have given an example of a route below. Rewrite-To-URI= true Route= [sip:*@yourinternal-domain*;from=provider-domain] sip:your-internal-domain.com - the from parameter in the filter will become the from domain in the outbound invite-voice wrote: - Rewrite-To-URI will force the To-URI to be rewritten based on the Route. Joegen > Hi Joegen > > In the Sip-trunk config i have selected > > Send-Reg=NO > > I am using Broadvox wholesale, which means i have 2 SIP TRUNK'1 > > One for Termination x.x.x.10 > One for Orgination x.x.x.20 > > I do not need username and password settings in <account> and maybe > <Transient*> if i knew what Transient was used for* > > In light of these facts How should the Sip-Trunk Configure be setup or > constructed and what is the bear minimum needed? > > r > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.176 / Virus Database: 270.9.15/1834 - Release Date: 12/6/2008 4:55 PM > > |
From: voice <vo...@ne...> - 2008-12-09 20:07:05
|
Hi Joegen download CVS opensipstack and opensbc ./confgure opensipstack then opensbc In the opensbc do make bothnoshared I reinstalled a fresh copy of CVS to see if this would fix the Listener ***Error*** and ran into this problem No rule to make libpt_linux_x86_r_s.a What is this error? r |
From: Joegen E. B. <joe...@gm...> - 2008-12-10 14:38:25
|
Hi Robert, You need to compile OpenSIPStack first and then OpenSBC. You error indicates that the library file is missing. Joegen voice wrote: > Hi Joegen > > download CVS opensipstack and opensbc > ./confgure opensipstack then opensbc > In the opensbc do make bothnoshared > > I reinstalled a fresh copy of CVS to see if this would fix the Listener > ***Error*** and ran into this problem > > No rule to make libpt_linux_x86_r_s.a > > What is this error? > > r > > |
From: voice <vo...@ne...> - 2008-12-10 15:27:47
|
Hi Anyone How do i fix Error ***Address already in use***** in the User Agent Name/Listener address? Your instruction were very clear about the possible causes. But other then several instances of OSBC what else could cause this problem. I get this ***error** in both NIC's viewed from the OSBC Transport Status. Does the OSBC see the sipX install or does OSBC see the Linux network settings or is it reading something twice? r |
From: OpenSIPStack F. <ope...@op...> - 2008-12-10 16:48:00
|
Hi Robert, By default, OSBC will listen to pot 5060 of all IP addresses configured on the box . If SIPX (or any opther application) is listening on port 5060 as well, then OSBC will detect it and give the error you have encountered. To avoid this, just configure OSBC to listen on a specific port and IP address. You can do this in the General Parameters > Interface Address section. For example, you can set it to listen to sip : 10.0.0.1 : 5060 which will cause it to use that IP address and port only. As a general rule, if you are going to run SIPX and OSBC on the same box, it simplifies things to have two IP address (each plumbed to a separate NIC) and to force each application to listen only on its allocated IP address. HTH |
From: voice <vo...@ne...> - 2008-12-10 19:39:24
|
Hi HTH Thanks for observations. I set in sipX Gateway/DialPlan too listen on :5080 i set OSBC to listen on :5060 in osbc NIC1 pointing to OSBC ipaddr == 69.x.x.50 i set OSBC to listen on :5080 in osbc NIC2 pointing to sipX ipaddr == 69.x.x.100 also in the B2BUA and UpperRegistration settings. Both nics share the same public network 69.x.x./24. Do you mean they should not share but run on different networks like 40.x.x.x and 69.x.x.x? NIC2 shows NO more **ERROR** now running on port:5080 but NIC1 still shows Error ***Address already in use***** You know the guy who said he got OSBC and sipX on one box to work should have run into the same problem. If you are listening please pipe up. I set B2BUA to pass To and From 5060 to 5080 vis versa. I set Upper Registration from sip:* to :5080 How does OSBC sense sipX use of Ports? maybe i can un-sense it? kidding.... r ----- Original Message ----- From: "OpenSIPStack Forum" <ope...@op...> To: <ope...@li...> Sent: Wednesday, December 10, 2008 10:47 AM Subject: Re: [OpenSIPStack] Error ***Address already in use***** 2 > > Hi Robert, > > > By default, OSBC will listen to pot 5060 of all IP addresses configured on the box . If SIPX (or any opther application) is listening on port 5060 as well, then OSBC will detect it and give the error you have encountered. To avoid this, just configure OSBC to listen on a specific port and IP address. You can do this in the General Parameters > Interface Address section. For example, you can set it to listen to sip : 10.0.0.1 : 5060 which will cause it to use that IP address and port only. > > > As a general rule, if you are going to run SIPX and OSBC on the same box, it simplifies things to have two IP address (each plumbed to a separate NIC) and to force each application to listen only on its allocated IP address. > > > HTH > > > > -------------------------------------------------------------------------- ---- > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel |
From: <jo...@op...> - 2008-12-10 23:40:45
|
If OpenSBC instances now listen on different ports, your culprit is definitely another application which has already grabbed port 5060 prior to OpenSBC. If you are running sipX in port 5060 then it is sipX. You need to bind sipX to other ports or you may bind it to a different IP address other than 69.x.x.50. Here is the rule. NO TWO listeners, be it from two distinct applications, could share a common port/ip binding. The only time this may happen is if the applications are using different transports. For example, two listeners can share a common port if one is using TCP and the other is using UDP. This is why a SIP UA can listen on 5060 for both UDP and TCP simultaneously. HTH - (H)ope (T)hat (H)elps. :-) Joegen voice wrote: > Hi HTH > > Thanks for observations. > > I set in sipX Gateway/DialPlan too listen on :5080 > > i set OSBC to listen on :5060 in osbc NIC1 pointing to OSBC ipaddr == > 69.x.x.50 > i set OSBC to listen on :5080 in osbc NIC2 pointing to sipX ipaddr == > 69.x.x.100 > also in the B2BUA and UpperRegistration settings. > > Both nics share the same public network 69.x.x./24. Do you mean they should > not share but run on different networks like 40.x.x.x and 69.x.x.x? > > NIC2 shows NO more **ERROR** now running on port:5080 > > but > > NIC1 still shows Error ***Address already in use***** > > You know the guy who said he got OSBC and sipX on one box to work should > have run into the same problem. If you are listening please pipe up. > > I set B2BUA to pass To and From 5060 to 5080 vis versa. > I set Upper Registration from sip:* to :5080 > > How does OSBC sense sipX use of Ports? maybe i can un-sense it? kidding.... > > r > ----- Original Message ----- > From: "OpenSIPStack Forum" <ope...@op...> > To: <ope...@li...> > Sent: Wednesday, December 10, 2008 10:47 AM > Subject: Re: [OpenSIPStack] Error ***Address already in use***** 2 > > > >> Hi Robert, >> >> >> By default, OSBC will listen to pot 5060 of all IP addresses configured >> > on the box . If SIPX (or any opther application) is listening on port > 5060 as well, then OSBC will detect it and give the error you have > encountered. To avoid this, just configure OSBC to listen on a specific > port and IP address. You can do this in the General Parameters > > Interface Address section. For example, you can set it to listen to sip : > 10.0.0.1 : 5060 which will cause it to use that IP address and port only. > >> As a general rule, if you are going to run SIPX and OSBC on the same box, >> > it simplifies things to have two IP address (each plumbed to a separate NIC) > and to force each application to listen only on its allocated IP address. > >> HTH >> >> >> >> -------------------------------------------------------------------------- >> > ---- > |
From: voice <vo...@ne...> - 2008-12-15 16:26:42
|
Hi Joegen Is there a way for OSBC to turn off if from grabing all port:5060 and just have it grab the NIC:5060 that it has been manually set to in the Admin Param's? It seems that OSBC is grabing all the ports reguardless of of ipaddr settings in a duel NIC box. It does not matter is if set each NIC to same or different network addresses. I have tried to isolate OSBC and sipX from each other by manually seting the OSBC only to NIC1. This i believe should isloated the second NIC2 which is set to be used by sipX. OSBC and sipX both want to default to port:5060 for interal to both reasons. I have set OSBC to B2BusUpperRegister and. In this mode OSBC is passing registration and B2Bua is routing inbound calls to sipX. Why does it still want to manage all port:5060? Shouldn't manually setting NIC1 also shield NIC2 and applications using that NIC from OSBC? In sipX's config.defs defaults proxy setting is port:5060 and i have manually set MY_IP_ADDDR to ip of NIC2. This isolate the 2nd NIC1 from NIC2. OSBC still see's NIC2 and sipX and it's port:5060 settings. Could you please contact the guy who said he has OSBC and sipX running on the same box using 2 NIC's using Public addressing and ask him to publish his settings. There is something missing, a trick that is not immediately clear. OSBC is not documented and i guess the only way to get documentation is to buy Solegy but then that defeats the reason for this OpenSource. Also if both NIC's are set to public addressing then remote phones don't need to go through OSBC UpperRegistation to register the UA to sipX. And in this configuration i believe OSBC is broken. when calls are coming in from ITSP because there is no UA hy-jacking of registration, right? Your explanation below assumes that OSBC is configured to talk to an PSTN and not a ITSP (Internet SIP Trunk). ITSP:5060 and can't be ask to rewrite their gateway to listen on some other port. OSBC is setting between ITSP and sipX. Thus. ITSP:5060 <==> 5060:OSBC:5060 <==> 5060:sipX:5060 <==> 5060:UA. I have tried ITSP:5060 <==> 5060:OSBC:6060 <==> 6060:sipX:6060 <==> 6060:UA also but sipX fails even when remote phones are using sip port:6060 and something is gettign lost when making and recieving calls going thru sipX when it is NOT set port:5060. OSBC and sipX use additional progressive SIP related ports that may also overlap with OSBC which normally would not be a problem if OSBCdid not grab all ports:5060 and their direvitives like 5062, 5064 etc... OSBC should key in on NIC's and not PORTs. Is there a way to toggle OSBC off from looking beyound it's own Relm? t ----- Original Message ----- From: "OpenSIPStack Forum" <ope...@op...> To: <ope...@li...> Sent: Wednesday, December 10, 2008 10:47 AM Subject: Re: [OpenSIPStack] Error ***Address already in use***** 2 > > Hi Robert, > > > By default, OSBC will listen to pot 5060 of all IP addresses configured on the box . If SIPX (or any opther application) is listening on port 5060 as well, then OSBC will detect it and give the error you have encountered. To avoid this, just configure OSBC to listen on a specific port and IP address. You can do this in the General Parameters > Interface Address section. For example, you can set it to listen to sip : 10.0.0.1 : 5060 which will cause it to use that IP address and port only. > > > As a general rule, if you are going to run SIPX and OSBC on the same box, it simplifies things to have two IP address (each plumbed to a separate NIC) and to force each application to listen only on its allocated IP address. > > > HTH > > > > -------------------------------------------------------------------------- ---- > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel |
From: Joegen E. B. <joe...@gm...> - 2008-12-15 18:28:30
|
voice wrote: > Hi Joegen > > Is there a way for OSBC to turn off if from grabing all port:5060 and just > have it grab the NIC:5060 that it has been manually set to in the Admin > Param's? > Yes OpenSBC binds to a NIC if you set it so. > It seems that OSBC is grabing all the ports reguardless of of ipaddr > settings in a duel NIC box. NO > It does not matter is if set each NIC to same > or different network addresses. NO > I have tried to isolate OSBC and sipX from > each other by manually seting the OSBC only to NIC1. This i believe should > isloated the second NIC2 which is set to be used by sipX. OSBC and sipX > both want to default to port:5060 for interal to both reasons. > > YES > I have set OSBC to B2BusUpperRegister and. In this mode OSBC is passing > registration and B2Bua is routing inbound calls to sipX. Why does it still > want to manage all port:5060? Shouldn't manually setting NIC1 also shield > NIC2 and applications using that NIC from OSBC? > YES > In sipX's config.defs defaults proxy setting is port:5060 and i have > manually set MY_IP_ADDDR to ip of NIC2. This isolate the 2nd NIC1 from > NIC2. > Should be. > OSBC still see's NIC2 and sipX and it's port:5060 settings. > Send proof of this by giving logs. netstat should also tell whats happening with the current bindings. > Could you please contact the guy who said he has OSBC and sipX running on > the same box using 2 NIC's using Public addressing and ask him to publish > his settings. Huh? > There is something missing, a trick that is not immediately > clear. OSBC is not documented and i guess the only way to get documentation > is to buy Solegy but then that defeats the reason for this OpenSource. Defeats opensource? Isn't the source open? > Also > if both NIC's are set to public addressing then remote phones don't need to > go through OSBC UpperRegistation to register the UA to sipX. And in this > configuration i believe OSBC is broken. when calls are coming in from ITSP > because there is no UA hy-jacking of registration, right? > Who said the NICS have to be both public? > Your explanation below assumes that OSBC is configured to talk to an PSTN > and not a ITSP (Internet SIP Trunk). ITSP:5060 and can't be ask to rewrite > their gateway to listen on some other port. OSBC is setting between ITSP > and sipX. Thus. ITSP:5060 <==> 5060:OSBC:5060 <==> 5060:sipX:5060 <==> > 5060:UA. > Can you point what part of my explanation indicated what you state here exactly? > I have tried ITSP:5060 <==> 5060:OSBC:6060 <==> 6060:sipX:6060 <==> 6060:UA > also but sipX fails even when remote phones are using sip port:6060 and > something is gettign lost when making and recieving calls going thru sipX > when it is NOT set port:5060. > Help us debug application if there is indeed a bug by providing your call flow and the log that violates the call flow > OSBC and sipX use additional progressive SIP related ports that may also > overlap with OSBC which normally would not be a problem if OSBCdid not grab > all ports:5060 and their direvitives like 5062, 5064 etc... > OpenSBC binds to a specific NIC. > OSBC should key in on NIC's and not PORTs. Is there a way to toggle OSBC > off from looking beyound it's own Relm? > > YES. sip:ipaddress:5060. Did it occur to you that OpenSBC is the one complaining about address already in use and that this indicates that somebody else grabbed the interface? > t > > > ----- Original Message ----- > From: "OpenSIPStack Forum" <ope...@op...> > To: <ope...@li...> > Sent: Wednesday, December 10, 2008 10:47 AM > Subject: Re: [OpenSIPStack] Error ***Address already in use***** 2 > > > >> Hi Robert, >> >> >> By default, OSBC will listen to pot 5060 of all IP addresses configured >> > on the box . If SIPX (or any opther application) is listening on port > 5060 as well, then OSBC will detect it and give the error you have > encountered. To avoid this, just configure OSBC to listen on a specific > port and IP address. You can do this in the General Parameters > > Interface Address section. For example, you can set it to listen to sip : > 10.0.0.1 : 5060 which will cause it to use that IP address and port only. > >> As a general rule, if you are going to run SIPX and OSBC on the same box, >> > it simplifies things to have two IP address (each plumbed to a separate NIC) > and to force each application to listen only on its allocated IP address. > >> HTH >> >> >> >> -------------------------------------------------------------------------- >> > ---- > >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >> > Nevada. > >> The future of the web can't happen without you. Join us at MIX09 to help >> pave the way to the Next Web now. Learn more and register at >> >> > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > >> _______________________________________________ >> opensipstack-devel mailing list >> ope...@li... >> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >> > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.176 / Virus Database: 270.9.18/1848 - Release Date: 12/14/2008 12:28 PM > > |
From: voice <vo...@ne...> - 2008-12-15 16:28:44
|
Hi Joegen Is there a way for OSBC to turn off if from grabing all port:5060 and just have it grab the NIC:5060 that it has been manually set to in the Admin Param's? It seems that OSBC is grabing all the ports reguardless of of ipaddr settings in a duel NIC box. It does not matter is if set each NIC to same or different network addresses. I have tried to isolate OSBC and sipX from each other by manually seting the OSBC only to NIC1. This i believe should isloated the second NIC2 which is set to be used by sipX. OSBC and sipX both want to default to port:5060 for interal to both reasons. I have set OSBC to B2BusUpperRegister and. In this mode OSBC is passing registration and B2Bua is routing inbound calls to sipX. Why does it still want to manage all port:5060? Shouldn't manually setting NIC1 also shield NIC2 and applications using that NIC from OSBC? In sipX's config.defs defaults proxy setting is port:5060 and i have manually set MY_IP_ADDDR to ip of NIC2. This isolate the 2nd NIC1 from NIC2. OSBC still see's NIC2 and sipX and it's port:5060 settings. Could you please contact the guy who said he has OSBC and sipX running on the same box using 2 NIC's using Public addressing and ask him to publish his settings. There is something missing, a trick that is not immediately clear. OSBC is not documented and i guess the only way to get documentation is to buy Solegy but then that defeats the reason for this OpenSource. Also if both NIC's are set to public addressing then remote phones don't need to go through OSBC UpperRegistation to register the UA to sipX. And in this configuration i believe OSBC is broken. when calls are coming in from ITSP because there is no UA hy-jacking of registration, right? Your explanation below assumes that OSBC is configured to talk to an PSTN and not a ITSP (Internet SIP Trunk). ITSP:5060 and can't be ask to rewrite their gateway to listen on some other port. OSBC is setting between ITSP and sipX. Thus. ITSP:5060 <==> 5060:OSBC:5060 <==> 5060:sipX:5060 <==> 5060:UA. I have tried ITSP:5060 <==> 5060:OSBC:6060 <==> 6060:sipX:6060 <==> 6060:UA also but sipX fails even when remote phones are using sip port:6060 and something is gettign lost when making and recieving calls going thru sipX when it is NOT set port:5060. OSBC and sipX use additional progressive SIP related ports that may also overlap with OSBC which normally would not be a problem if OSBCdid not grab all ports:5060 and their direvitives like 5062, 5064 etc... OSBC should key in on NIC's and not PORTs. Is there a way to toggle OSBC off from looking beyound it's own Relm? t ----- Original Message ----- From: "OpenSIPStack Forum" <ope...@op...> To: <ope...@li...> Sent: Wednesday, December 10, 2008 10:47 AM Subject: Re: [OpenSIPStack] Error ***Address already in use***** 2 > > Hi Robert, > > > By default, OSBC will listen to pot 5060 of all IP addresses configured on the box . If SIPX (or any opther application) is listening on port 5060 as well, then OSBC will detect it and give the error you have encountered. To avoid this, just configure OSBC to listen on a specific port and IP address. You can do this in the General Parameters > Interface Address section. For example, you can set it to listen to sip : 10.0.0.1 : 5060 which will cause it to use that IP address and port only. > > > As a general rule, if you are going to run SIPX and OSBC on the same box, it simplifies things to have two IP address (each plumbed to a separate NIC) and to force each application to listen only on its allocated IP address. > > > HTH > > > > -------------------------------------------------------------------------- ---- > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel |
From: <jo...@op...> - 2008-12-08 01:48:42
|
Ok lets use more descriptive domain naming. Outbound calls flow = UA1 -> SIPX -> OSBC -> Provider-GW UA Dialstring = sip:121...@si... SipX = sipx01.mydomain.com. OpenSBC = osbc01.mydomain.com Provider = gw01.myprovider.com In this sample, The call will reach OpenSBC with the following INVITE INVITE sip:121...@os... SIP/UDP From: "foo"<sip:fo...@si...>;tag=123 To: sip:121...@si... B2BUA-Route = [sip:*mydomain.com*;from=gw01.myprovider.com] sip:gw01.myprovider.com INVITE sip:121...@si... SIP/UDP From: "foo"<sip:fo...@si...>;tag=123 To: sip:121...@si... Now just reverse this process for you egress traffic and you are all set. voice wrote: > Hi Joegen > > [sip:*@yourinternal-domain*;from=provider-domain] > sip:your-internal-domain.com > > provider-domain == Termination > yourinternal-domain == OSBC > your-internal0domain == sipX > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > provider-domain == Origination > yourinternal-domain == sipX > your-internal0domain == OSBC > > Is this what you mean? > > r > > ----- Original Message ----- > From: "jo...@op..." <joe...@gm...> > To: "voice" <vo...@ne...>; > <ope...@li...> > Sent: Sunday, December 07, 2008 7:02 PM > Subject: Re: [OpenSIPStack] OSBC <==> sipX Send-Reg-NO > > > >> If you do not need to authenticate with your trunk provider, then you >> not need to use SIP Trunking Module to place your calls. You may simply >> treat your Provider as a normal PSTN Gateway. Get rid of you SIP-Trunk >> config and use B2BUA-Routes instead. I have given an example of a route >> below. >> >> Rewrite-To-URI= true >> Route= [sip:*@yourinternal-domain*;from=provider-domain] >> sip:your-internal-domain.com >> >> - the from parameter in the filter will become the from domain in the >> outbound invite-voice wrote: >> - Rewrite-To-URI will force the To-URI to be rewritten based on the Route. >> >> Joegen >> >>> Hi Joegen >>> >>> In the Sip-trunk config i have selected >>> >>> Send-Reg=NO >>> >>> I am using Broadvox wholesale, which means i have 2 SIP TRUNK'1 >>> >>> One for Termination x.x.x.10 >>> One for Orgination x.x.x.20 >>> >>> I do not need username and password settings in <account> and maybe >>> <Transient*> if i knew what Transient was used for* >>> >>> In light of these facts How should the Sip-Trunk Configure be setup or >>> constructed and what is the bear minimum needed? >>> >>> r >>> >>> >>> >>> >> -------------------------------------------------------------------------- >> > ---- > >>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >>> > Nevada. > >>> The future of the web can't happen without you. Join us at MIX09 to >>> > help > >>> pave the way to the Next Web now. Learn more and register at >>> >>> > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > >>> _______________________________________________ >>> opensipstack-devel mailing list >>> ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >>> >>> ------------------------------------------------------------------------ >>> >>> >>> No virus found in this incoming message. >>> Checked by AVG - http://www.avg.com >>> Version: 8.0.176 / Virus Database: 270.9.15/1834 - Release Date: >>> > 12/6/2008 4:55 PM > >>> >> > > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.176 / Virus Database: 270.9.15/1835 - Release Date: 12/7/2008 4:56 PM > > |
From: Gustavo C. <cur...@ho...> - 2008-06-19 13:41:31
|
Hi Joegen, Thanks for your help. The other header which is missing in the SIPMessage::CleanUp() is the m_SessionExpires ("session-expires"). I will continue with my tests and let you know. Gustavo > Date: Thu, 19 Jun 2008 08:38:42 +0800> From: joe...@gm...> To: cur...@gm...> CC: jo...@op...; ope...@li...; jb...@so...> Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > Right! I've found m_MinSE is not getting deleted in > SIPMessage::CleanUp(). Patched this in CVS.> > Joegen> > Gustavo Curetti wrote:> > Hi Joegen> > > > The modification doesn't solve the memory issues. I continue searching > > for the memory leak. > > > > A new case is attached and this one appear too when debugging with > > Microsot Visual.> > > > Originally, i sent the attached Invite every 250 ms and I set the > > timer B and H in 20 ms:> > > > #define SIP_TIMER_B 20> > > > #define SIP_TIMER_H 20> > > > Then I change the code > > of B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() > > for making easier to replicate the leak:> > > > > > void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive()> > {> > while( !m_UpperRegSync.Wait( 250 ) )> > {> > OString testRequest => > "INVITE sip:5435155555@192.168.0.5:5060 SIP/2.0\r\nContact: > > <sip:4284623@192.168.0.10:5060>\r\nCSeq: 101 INVITE\r\nFrom: > > <sip:4284623@192.168.0.10>;tag=5A3745C-2418\r\nTo: > > <sip:55555555@192.168.0.206>\r\nVia: SIP/2.0/UDP > > 192.168.0.206:5060;branch=z9hG4bK63028de3a6b7743a\r\nVia: SIP/2.0/UDP > > 192.168.0.10:5060\r\nRecord-Route: > > <sip:192.168.0.206:5060;lr>\r\nAllow: INVITE, OPTIONS, BYE, CANCEL, > > ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO\r\nUser-Agent: > > Cisco-SIPGateway/IOS-12.x\r\nCall-Id: > > 3738EB25-278011DD-B92F90A6-C0EF6BE3@192.168.0.10\r\nMax-Forwards > > <mailto:3738EB25-278011DD-B92F90A6-C0EF6BE3@192.168.0.10%5Cr%5CnMax-Forwards>: > > 6\r\nExpires: 180\r\nContent-Length: 235\r\ndate: Thu, 22 May 2008 > > 21:52:32 GMT\r\nsupported: timer\r\nmin-se: 1800\r\ncisco-guid: > > 926237238-662704605-3106705574-3236916195\r\nremote-party-id: > > <sip:4284623@192.168.0.10>;party=calling;screen=no;privacy=off\r\ntimestamp: > > 1211493152\r\nallow-events: telephone-event\r\ncontent-type: > > application/sdp\r\n\r\nv=0\r\no=CiscoSystemsSIP-GW-UserAgent 7402 717 > > IN IP4 192.168.0.10\r\ns=SIP Call\r\nc=IN IP4 192.168.0.10\r\nt=0 > > 0\r\nm=audio 19298 RTP/AVP 0 19\r\nc=IN IP4 192.168.0.10\r\na=rtpmap:0 > > PCMU/8000\r\na=rtpmap:19 CN/8000\r\na=ptime:20";> > testRequest = ParserTools::LineFeedSanityCheck( testRequest );> > SIPMessage * msg = new SIPMessage( testRequest );> > > > OString addrStr = "192.168.0.147";> > OString portStr = "10000";> > SIPHeader rcvAddr( "RCVADDR", addrStr );> > SIPHeader rcvPort( "RCVPORT", portStr );> > SIPHeader rcvTran( "RCVTRAN", "udp" );> > > > msg->AddInternalHeader( rcvAddr );> > msg->AddInternalHeader( rcvPort );> > msg->AddInternalHeader( rcvTran );> > msg->SetInterfaceAddress( "192.168.0.202" );> > msg->SetInterfacePort( 5070 );> > > > OStringStream traceStream;> > > > traceStream << "<<< "> > << msg->GetStartLine() << " "> > << " SRC: " << addrStr << ":" << portStr << ":UDP"> > << " enc=" << msg->IsEncrypted()> > << " bytes=1103";> > > > OStringStream strPacket;> > strPacket << *msg;> > COMPOUND_LOG_CONTEXT( LogInfo(), msg->GetCallId(), > > traceStream.str(), LogDebugHigh(), strPacket );> > > > SIPTransport::NotifyRead( traceStream.str() );> > > > if( msg->IsInvite() )> > {> > SIPMessage * trying = new SIPMessage();> > msg->CreateResponse( *trying, SIPMessage::Code100_Trying );> > Via via;> > msg->GetViaAt(0, via );> > if( via.IsBehindNAT() )> > {> > SIPURI srcURI;> > srcURI.SetHost(addrStr);> > srcURI.SetPort(portStr);> > trying->SetSendAddress(srcURI);> > }> > if( msg->IsEncrypted() )> > trying->SetEncryption( TRUE );> > GetTransportManager()->ProcessOutbound( trying );> > }> > > > GetTransportManager()->OnTransportEvent(> > new SIPTransportEvent(> > msg,> > SIPTransportEvent::UDPPacketArrival> > ) );> >> > /*///process the keep alives here> > for( PINDEX i = 0; i < GetRegistrationDB().GetSize(); i++ )> > {> > SIPMessage reg;> > if( GetRegistrationDB().GetRegistration( i, reg ) )> > {> > if( reg.HasInternalHeader( "upper-reg" ) )> > {> > /// this is an upper reg, send a keep-alive> > /// Check the last via if its from a private IP> > Via via;> > if( reg.GetViaAt( reg.GetViaSize() - 1, via ) )> > {> > if( via.IsBehindNAT() )> > {> > SIPURI target;> > target.SetHost( via.GetReceiveAddress().AsSTLString() );> > target.SetPort( via.GetRPort() );> > SIPMessage keepAlive;> > RequestLine requestLine;> > requestLine.SetMethod( "KEEP-ALIVE" );> > requestLine.SetRequestURI( target );> > keepAlive.SetStartLine( requestLine );> > GetUserAgent().TransportWrite( keepAlive );> > }> > }> > }> > }> > }*/> > }> > }> >> > > > The OpenSBC is in "Proxy Only Mode" and the configuration is in > > "OpenSBC.reg" (attached).> > > > I compile the OpenSBC in Microsoft Visual C++ 2005 obtaining the exe > > attached.> > > > Any idea?> > > > Thanks for your help.> > > > Gustavo> >> >> >> > ------------------------------------------------------------------------> >> > > Date: Thu, 5 Jun 2008 14:18:35 +0800> > > To: cur...@gm...> > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > > From: joe...@gm...> > >> > > Hi Gustavo,> > >> > > Yes, i'm able to replicate it. For some reason, the code I #ifdefed in> > > AppendVia() below is causing it. Let me know if it solves your issues.> > > I've tried looking at what its doing but nothing is evident as to > > why it> > > would leak. If you find something, let me know> > >> > > Joegen> > >> > > BOOL SIPMessage::AppendVia(> > > const Via & header> > > )> > > {> > > GlobalLock();> > >> > > ParseViaList();> > >> > > if( m_ViaList == NULL )> > > {> > > m_ViaList = new Via::Collection();> > > m_ViaList->Append( new Via( header ) );> > > }else> > > {> > >> > > #if 0 // For some reason, this sanity check is leaking mem> > > /// sanity check> > > if( m_ViaList->GetSize() > 0 )> > > {> > > Via & topVia = (*m_ViaList)[0];> > >> > > SIPURI topViaURI = topVia.GetURI();> > >> > > SIPURI newURI = header.GetURI();> > >> > > if( SIPTransport::IsTheSameAddress( topViaURI, newURI, TRUE ) )> > > return FALSE;> > > }> > > #endif> > >> > > ///we append it on top> > > Via::Collection oldViaList = *m_ViaList;> > > oldViaList.MakeUnique();> > > delete m_ViaList;> > >> > > m_ViaList = new Via::Collection();> > > m_ViaList->Append( new Via( header ) );> > >> > > for( PINDEX i = 0; i < oldViaList.GetSize(); i++ )> > > m_ViaList->Append( new Via( oldViaList[i] ) );> > >> > > m_ViaList->MakeUnique();> > > }> > >> > >> > > return TRUE;> > > }> > >> > >> > > Gustavo Curetti wrote:> > > >> > > > Hi Joegen> > > >> > > > The destructor is called. The problem seem to be the headers like > > Via,> > > > RecordRoute, Contact, Allow, Supported (List headers).> > > >> > > > The leak is very easy to reproduce. I change the code of> > > > B2BUserAgent::Registrar::ProcessUpperRegKeepAlive:> > > >> > > >> > > > void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive()> > > > {> > > > while( !m_UpperRegSync.Wait( 10 ) )> > > > {> > > >> > > > SIPMessage * msg = new SIPMessage();> > > >> > > > msg->AppendVia(Via("SIP/2.0/UDP 192.168.0.10:5060"));> > > > msg->AppendVia(Via("SIP/2.0/UDP> > > > > > 192.168.0.206:5060;branch=z9hG4bK440fdc3e04de9d10;rport=5060;received=192.168.0.206"));> > > > msg->AppendRecordRoute(RouteURI("<sip:192.168.0.206:5060;lr>"));> > > > msg->AppendContact(ContactURI("<sip:5435155555@192.168.0.5>"));> > > > msg->AppendAllow(Allow("INVITE, ACK, CANCEL, OPTIONS, BYE, REFER,> > > > SUBSCRIBE, NOTIFY"));> > > > msg->AppendSupported(Supported("replaces"));> > > >> > > > delete msg;> > > > }> > > > }> > > >> > > >> > > > I compile the OpenSBC in Microsoft Visual C++ 2005 obtaining the exe> > > > attached.> > > > I execute "OpenSBC Debug" in Windows 2003 or Windows 2000 and the > > leak> > > > is there.> > > >> > > > I put traces and SIPMessage::~SIPMessage(), SIPMessage::Cleanup() are> > > > called.> > > >> > > > Any idea?> > > >> > > > Thanks for your help.> > > >> > > > Gustavo> > > >> > > > > > ------------------------------------------------------------------------> > > >> > > > > Date: Mon, 2 Jun 2008 10:19:08 +0800> > > > > To: cur...@gm...; > > ope...@li...> > > > > From: joe...@gm...> > > > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > > > >> > > > > Try putting a trace before and after the "delete" statement to > > be sure> > > > > that its getting called. From what i see, assuming that SIPMessage> > > > > destructor performs proper cleanup, that a leak here can only be > > caused> > > > > by an exception occurring in the SIPMessage constructor;> > > > >> > > > > Gustavo Curetti wrote:> > > > > > Hi Joegen:> > > > > >> > > > > > The memory leak is hard to find. I send the 200 OK repeatedly but> > > > the memory leak doesn't appear if i'm debugging with Microsot Visual> > > > 2005, but the leak appears if i'm running the OpenSBC like a service.> > > > > >> > > > > > If I comment:> > > > > >> > > > > >> > > > > > void SIPStack::EnqueueTransportWriteEvent(> > > > > > const SIPMessage & message,> > > > > > SIPTransportEvent::Type eventType> > > > > > )> > > > > > {> > > > > > if( m_IsTerminating )> > > > > > return;> > > > > >> > > > > > /*SIPMessage * msg = new SIPMessage(message);> > > > > >> > > > > > msg->SetInternalHeader( "TRN-ID", > > msg->GetTransactionId().AsString());> > > > > > m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg,> > > > eventType ) );*/> > > > > > }> > > > > >> > > > > > there is not leak. But if I modify the code like this:> > > > > >> > > > > >> > > > > > void SIPStack::EnqueueTransportWriteEvent(> > >> > > > > > const SIPMessage & message,> > > > > > SIPTransportEvent::Type eventType> > > > > > )> > > > > > {> > > > > > if( m_IsTerminating )> > > > > > return;> > > > > >> > > > > > SIPMessage * msg = new SIPMessage(message);> > > > > >> > > > > > /*msg->SetInternalHeader( "TRN-ID",> > > > msg->GetTransactionId().AsString());> > > > > > m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg,> > > > eventType ) );*/> > > > > > delete msg;> > > > > > }> > > > > >> > > > > > the leak shows up. I don't understand why this happens if I'm> > > > deleting the msg.> > > > > > What i said in the last mail about CSeq is not seem to be the > > reason.> > > > > > Any idea? Thanks for your help.> > > > > > Gustavo> > > > > >> > > > > >> > > > > > From: cur...@ho...Subject: RE: [OpenSIPStack]> > > > Memory Leak in Proxy and Full ModeDate: Fri, 30 May 2008 17:04:37 > > +0200> > > > > >> > > > > >> > > > > > Hi Joegen: I found that the memory leak is when you create a> > > > SIPMessage from other SIPMessage or from a OString and then you > > delete> > > > de message. In the case of the 200 Ok the message is created in:> > > > > > ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent(){SIPMessage > >> > > > * msg = new SIPMessage(message); The memory leak is because the CSeq> > > > header. If i comment : SIPMessage::SIPMessage(const SIPMessage &> > > > msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void> > > > SIPMessage::AssignContents(SIPMessage & msg){ /*if( m_CSeq != NULL )> > > > msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/} There is no more> > > > memory leak. I try to replace: SIPMessage * msg = new> > > > SIPMessage(message); ----> SIPMessage * msg = new> > > > SIPMessage(message.AsString()); but the memory leak still exist > > unless> > > > i comment: void SIPMessage::Finalize(){ /*if( m_CSeq == NULL ) {> > > > m_CSeq = new CSeq( h ); }*/} That's what i found so far. Gustavo> > > > > >> > > > > >> > > > > >> Date: Fri, 30 May 2008 11:26:11 +0800> To:> > > > cur...@gm...; ope...@li...>> > > > Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From:> > > > joe...@gm...> > Hi Gustavo,> > Take a look at void> > > > ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can> > > > you verify if the object created in:> > manager.CreateTuple(> > > > m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10> > > > seconds?> > Putting a breakpoint at> > > > ProxySessionTupleManager::Tuple::~Tuple() should > be enough to> > > > confirm it.> > Also by any chance, did you accidentally think that> > > > this tuple is the > mem leak because it was created after the> > > > transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > > > > >> > > > I found a memory leak when the OpenSBC is configured in Proxy or Full> > > > mode. When i send a 200 Ok for example in B2B mode there is no memory> > > > leak, but when i send a 200 ok in Proxy or Full mode, some memory is> > > > taken and never released. I attach the logs. The OpenSBC> > > > (192.168.0.202:5070) is running under Windows.> > > > Thanks for your> > > > help> > > > Gustavo> >> > > > _________________________________________________________________> >> > > > Ingresá ya a MSN Deportes y enterate de las últimas novedades del> > > > mundo deportivo.> > http://msn.foxsports.com/fslasc/> >> > > > > > ------------------------------------------------------------------------>> > > > >> >> > > > > > -------------------------------------------------------------------------> > >> > > > > This SF.net email is sponsored by: Microsoft> > Defy all > > challenges.> > > > Microsoft(R) Visual Studio 2008.> >> > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> >> > > > > > ------------------------------------------------------------------------>> > > > >> > _______________________________________________> >> > > > opensipstack-devel mailing list> >> > > > ope...@li...> >> > > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > > >> > > > > > ------------------------------------------------------------------------>> > > > >> > No virus found in this incoming message.> > Checked by AVG. > >> > > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date:> > > > 5/23/2008 3:36 PM> > > >> > > > > >>> > > > > >> > > > > > Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de> > > > tus artistas favoritos. MSN en Concierto> > > > > > _________________________________________________________________> > > > > > Descargá ya gratis y viví la experiencia Windows Live.> > > > > > http://www.descubrewindowslive.com/latam/index.html> > > > > >> > > > > > -------------------------------------------------------------------------> > > > > > This SF.net email is sponsored by: Microsoft> > > > > > Defy all challenges. Microsoft(R) Visual Studio 2008.> > > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > > > > > _______________________________________________> > > > > > opensipstack-devel mailing list> > > > > > ope...@li...> > > > > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > > >> > > > > >> > > > > >> > > > > >> > > > >> > > > >> > > > >> > > > >> > > > > > -------------------------------------------------------------------------> > > > > This SF.net email is sponsored by: Microsoft> > > > > Defy all challenges. Microsoft(R) Visual Studio 2008.> > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > > > > _______________________________________________> > > > > opensipstack-devel mailing list> > > > > ope...@li...> > > > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Descargá ya gratis y viví la experiencia Windows Live. Descubre> > > > Windows Live <http://www.descubrewindowslive.com/latam/index.html>> > > > > > ------------------------------------------------------------------------> > > >> > > > Internal Virus Database is out-of-date.> > > > Checked by AVG.> > > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: > > 5/23/2008 3:36 PM> > > >> > >> > >> >> >> > ------------------------------------------------------------------------> > Ingresá ya a MSN Deportes y enterate de las últimas novedades del > > mundo deportivo. MSN Deportes <http://msn.foxsports.com/fslasc/>> > _________________________________________________________________ Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo. http://msn.foxsports.com/fslasc/ |
From: Joegen E. B. <joe...@gm...> - 2008-06-20 01:33:21
|
Right! Patch is in CVS. Joegen Gustavo Curetti wrote: > Hi Joegen, > > Thanks for your help. The other header which is missing in the SIPMessage::CleanUp() is the m_SessionExpires ("session-expires"). I will continue with my tests and let you know. > > Gustavo > > > |
From: <jo...@op...> - 2008-06-21 03:57:44
|
Hi Gustavo, This time, I am not sure if what you are seeing in perfmon is actually a leak or simply transactions waiting for timers to fire so it could transition from Completed to Terminated state. I tried to fire the same in my perfmon and the private mem leveled at around 80 in the graph. Same place where yours leveled to a straight line. Can you share more info why you think this is a leak? Joegen Gustavo Curetti wrote: > Hi Joegen, > > Another case of memory leak is attached. (no debugging mode). > I send 5000 messages with 40 ms delay between each message. > A jpg of the perfmon is attached too. (Private Bytes) > > Thanks for your help > > Gustavo Curetti > > > ------------------------------------------------------------------------ > > > Date: Fri, 20 Jun 2008 09:33:12 +0800 > > To: cur...@gm...; ope...@li... > > From: joe...@gm... > > CC: joe...@gm... > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode > > > > Right! Patch is in CVS. > > > > Joegen > > > > Gustavo Curetti wrote: > > > Hi Joegen, > > > > > > Thanks for your help. The other header which is missing in the > SIPMessage::CleanUp() is the m_SessionExpires ("session-expires"). I > will continue with my tests and let you know. > > > > > > Gustavo > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://sourceforge.net/services/buy/index.php > > _______________________________________________ > > opensipstack-devel mailing list > > ope...@li... > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > ------------------------------------------------------------------------ > ¿Aburrido? Ingresá ya y divertite como nunca en MSN Juegos. MSN Juegos > <http://juegos.ar.msn.com/> > ------------------------------------------------------------------------ > > Internal Virus Database is out-of-date. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM > |
From: Gustavo C. <cur...@ho...> - 2008-06-26 13:27:38
|
Hi Joegen I found something really weird. If I change the order of headers in SIPMessage::Cleanup() the memory leak varies. For example, if I clean m_AllowList and m_ViaList first of all the memory leak decrease: void SIPMessage::Cleanup(){ GlobalLock(); if( m_AllowList != NULL ){ delete m_AllowList; m_AllowList = NULL; } /// special headers if( m_ViaList != NULL ){ delete m_ViaList; m_ViaList = NULL; } ..... I will continue searching. ¿Is there a way to configure PMEMORY_CHECK for release? Thanks for your help. Gustavo Curetti From: cur...@ho...To: jo...@op...; joe...@gm...; ope...@li...Subject: RE: [OpenSIPStack] FW: Memory Leak in Proxy and Full ModeDate: Mon, 23 Jun 2008 21:42:45 +0200 Hi Joegen I think this is a memory leak because after all messages are sent the memory never go down.The code added in B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() waits 5 seconds and sends the first Invite, then waits 5 seconds , sends the second Invite, waits 5 seconds more and finally sends 4998 Invites with a 40 ms delay between each one. void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive(){ DWORD delay = 5000; DWORD numberOfPackets = 0; while( !m_UpperRegSync.Wait( delay ) ) { if(numberOfPackets < 5000) { OString testRequest = "INVITE sip:5435155555@192.168.0.5:5060 SIP/2.0\r\nContact: <sip:4284623@192.168.0.10:5060>\r\nCSeq: 101 INVITE\r\nFrom: <sip:4284623@192.168.0.10>;tag=5A3745C-2418\r\nTo: <sip:55555555@192.168.0.206>\r\nVia: SIP/2.0/UDP 192.168.0.206:5060;branch=z9hG4bK63028de3a6b7743a\r\nVia: SIP/2.0/UDP 192.168.0.10:5060\r\nRecord-Route: <sip:192.168.0.206:5060;lr>\r\nAllow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO\r\nUser-Agent: Cisco-SIPGateway/IOS-12.x\r\nCall-Id: " + OString(numberOfPackets) + "@192.168.0.10\r\nMax-Forwards: 6\r\nExpires: 180\r\nContent-Length: 235\r\ndate: Thu, 22 May 2008 21:52:32 GMT\r\nsupported: timer\r\nmin-se: 1800\r\ncisco-guid: 926237238-662704605-3106705574-3236916195\r\nremote-party-id: <sip:4284623@192.168.0.10>;party=calling;screen=no;privacy=off\r\ntimestamp: 1211493152\r\nallow-events: telephone-event\r\ncontent-type: application/sdp\r\n\r\nv=0\r\no=CiscoSystemsSIP-GW-UserAgent 7402 717 IN IP4 192.168.0.10\r\ns=SIP Call\r\nc=IN IP4 192.168.0.10\r\nt=0 0\r\nm=audio 19298 RTP/AVP 0 19\r\nc=IN IP4 192.168.0.10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:19 CN/8000\r\na=ptime:20"; testRequest = ParserTools::LineFeedSanityCheck( testRequest ); SIPMessage * msg = new SIPMessage( testRequest ); OString addrStr = "192.168.0.147"; OString portStr = "10000"; SIPHeader rcvAddr( "RCVADDR", addrStr ); SIPHeader rcvPort( "RCVPORT", portStr ); SIPHeader rcvTran( "RCVTRAN", "udp" ); msg->AddInternalHeader( rcvAddr ); msg->AddInternalHeader( rcvPort ); msg->AddInternalHeader( rcvTran ); msg->SetInterfaceAddress( "192.168.0.202" ); msg->SetInterfacePort( 5070 ); OStringStream traceStream; traceStream << "<<< " << msg->GetStartLine() << " " << " SRC: " << addrStr << ":" << portStr << ":UDP" << " enc=" << msg->IsEncrypted() << " bytes=1103"; OStringStream strPacket; strPacket << *msg; COMPOUND_LOG_CONTEXT( LogInfo(), msg->GetCallId(), traceStream.str(), LogDebugHigh(), strPacket ); SIPTransport::NotifyRead( traceStream.str() ); if( msg->IsInvite() ) { SIPMessage * trying = new SIPMessage(); msg->CreateResponse( *trying, SIPMessage::Code100_Trying ); Via via; msg->GetViaAt(0, via ); if( via.IsBehindNAT() ) { SIPURI srcURI; srcURI.SetHost(addrStr); srcURI.SetPort(portStr); trying->SetSendAddress(srcURI); } if( msg->IsEncrypted() ) trying->SetEncryption( TRUE ); GetTransportManager()->ProcessOutbound( trying ); } GetTransportManager()->OnTransportEvent( new SIPTransportEvent( msg, SIPTransportEvent::UDPPacketArrival ) ); if (numberOfPackets > 1) delay = 40; numberOfPackets++; } }} The SIP timers B and H are set to 20 ms. #define SIP_TIMER_B 20 #define SIP_TIMER_H 20 After all messages are sent, I wait for a long time but the memory used doesn't decrease. I tried different settings: Case 1 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (40 ms) -> 5 min1)Mem Usage 8332k 8940k 9080k 9400k2)Mem Usage 8364k 8952k 8976k 9416k3)Mem Usage 8300k 8888k 8908k 9368k Case 2 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 9998 Invite (40 ms) -> 5 min1)Mem Usage 8308k 8900k 9000k 9696k2)Mem Usage 8320k 8908k 8928k 9760k The leak is bigger when the amount of messages are higher.Case 3 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (30 ms) -> 5 min1)Mem Usage 8252k 8832k 8852k 9532k 2)Mem Usage 8256k 8844k 8872k 9536k Case 4 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (20 ms) -> 5 min1)Mem Usage 8276k 8864k 8884k 9728k 2)Mem Usage 8240k 8828k 8848k 9728k The leak is bigger when the delay is shorter. Case 5 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (80 ms) -> 5 min1)Mem Usage 8344k 8932k 8952k 9332k2)Mem Usage 8376k 8968k 8992k 9276k The only type of error in the log is : 102:42:36.691 ERR: [CID=0x0000] UDP Socket Read Error (Socket not connected) in case 1 appears 5219 times. I don't know if this error is linked with the leak. The log is attached. This behavior doesn't seem to be because of transactions waiting for timers. Maybe is because some type of conflict with shared resources or mutexs, but I really don't know. Any idea? If you need more info, please let me know. One more thing, I suggest to increase MAX_SIP_MESSAGE_LENGTH because i had problems with Invites with a lot of headers (record-routes, vias, etc) and long bodies. #define MAX_SIP_MESSAGE_LENGTH 2048 ----> #define MAX_SIP_MESSAGE_LENGTH 4000 Thanks for your help. Gustavo Curetti > Date: Sat, 21 Jun 2008 10:17:22 +0800> To: cur...@gm...> From: joe...@gm...> CC: joe...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > Hi Gustavo,> > This time, I am not sure if what you are seeing in perfmon is actually a > leak or simply transactions waiting for timers to fire so it could > transition from Completed to Terminated state. I tried to fire the same > in my perfmon and the private mem leveled at around 80 in the graph. > Same place where yours leveled to a straight line. Can you share more > info why you think this is a leak?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen,> > > > Another case of memory leak is attached. (no debugging mode).> > I send 5000 messages with 40 ms delay between each message.> > A jpg of the perfmon is attached too. (Private Bytes)> > > > Thanks for your help> >> > Gustavo Curetti> >> >> > ------------------------------------------------------------------------> >> > > Date: Fri, 20 Jun 2008 09:33:12 +0800> > > To: cur...@gm...; ope...@li...> > > From: joe...@gm...> > > CC: joe...@gm...> > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > >> > > Right! Patch is in CVS.> > >> > > Joegen> > >> > > Gustavo Curetti wrote:> > > > Hi Joegen,> > > >> > > > Thanks for your help. The other header which is missing in the > > SIPMessage::CleanUp() is the m_SessionExpires ("session-expires"). I > > will continue with my tests and let you know.> > > >> > > > Gustavo> > > >> > > >> > > >> > >> > >> > > > > -------------------------------------------------------------------------> > > Check out the new SourceForge.net Marketplace.> > > It's the best place to buy or sell services for> > > just about anything Open Source.> > > http://sourceforge.net/services/buy/index.php> > > _______________________________________________> > > opensipstack-devel mailing list> > > ope...@li...> > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> >> >> > ------------------------------------------------------------------------> > ¿Aburrido? Ingresá ya y divertite como nunca en MSN Juegos. MSN Juegos > > <http://juegos.ar.msn.com/>> > ------------------------------------------------------------------------> >> > Internal Virus Database is out-of-date.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > > > -------------------------------------------------------------------------> Check out the new SourceForge.net Marketplace.> It's the best place to buy or sell services for> just about anything Open Source.> http://sourceforge.net/services/buy/index.php> _______________________________________________> opensipstack-devel mailing list> ope...@li...> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel Descargá GRATIS el poder del nuevo Internet Explorer 7. Internet Explorer 7 _________________________________________________________________ Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de tus artistas favoritos. http://msninconcert.msn.com/music/archive/es-la/archive.aspx |
From: <jo...@op...> - 2008-06-28 03:17:08
|
Weird indeed. I will create a new status page that dumps memory snap-shot via the admin pages. I will keep you posted. Joegen Gustavo Curetti wrote: > Hi Joegen > > I found something really weird. If I change the order of headers in SIPMessage::Cleanup() the memory leak varies. > For example, if I clean m_AllowList and m_ViaList first of all the memory leak decrease: > > void SIPMessage::Cleanup(){ GlobalLock(); > > if( m_AllowList != NULL ){ delete m_AllowList; m_AllowList = NULL; } /// special headers if( m_ViaList != NULL ){ delete m_ViaList; m_ViaList = NULL; } > ..... > > I will continue searching. ¿Is there a way to configure PMEMORY_CHECK for release? > > Thanks for your help. > > Gustavo Curetti > > > From: cur...@ho...To: jo...@op...; joe...@gm...; ope...@li...Subject: RE: [OpenSIPStack] FW: Memory Leak in Proxy and Full ModeDate: Mon, 23 Jun 2008 21:42:45 +0200 > > > Hi Joegen I think this is a memory leak because after all messages are sent the memory never go down.The code added in B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() waits 5 seconds and sends the first Invite, then waits 5 seconds , sends the second Invite, waits 5 seconds more and finally sends 4998 Invites with a 40 ms delay between each one. void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive(){ DWORD delay = 5000; DWORD numberOfPackets = 0; while( !m_UpperRegSync.Wait( delay ) ) { if(numberOfPackets < 5000) { OString testRequest = "INVITE sip:5435155555@192.168.0.5:5060 SIP/2.0\r\nContact: <sip:4284623@192.168.0.10:5060>\r\nCSeq: 101 INVITE\r\nFrom: <sip:4284623@192.168.0.10>;tag=5A3745C-2418\r\nTo: <sip:55555555@192.168.0.206>\r\nVia: SIP/2.0/UDP 192.168.0.206:5060;branch=z9hG4bK63028de3a6b7743a\r\nVia: SIP/2.0/UDP 192.168.0.10:5060\r\nRecord-Route: <sip:192.168.0.206:5060;lr>\r\nAllow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO\r\nUser-Agent: Cisco-SIPGateway/IOS-12.x\r\nCall-Id: " + OString(numberOfPackets) + "@192.168.0.10\r\nMax-Forwards: 6\r\nExpires: 180\r\nContent-Length: 235\r\ndate: Thu, 22 May 2008 21:52:32 GMT\r\nsupported: timer\r\nmin-se: 1800\r\ncisco-guid: 926237238-662704605-3106705574-3236916195\r\nremote-party-id: <sip:4284623@192.168.0.10>;party=calling;screen=no;privacy=off\r\ntimestamp: 1211493152\r\nallow-events: telephone-event\r\ncontent-type: application/sdp\r\n\r\nv=0\r\no=CiscoSystemsSIP-GW-UserAgent 7402 717 IN IP4 192.168.0.10\r\ns=SIP Call\r\nc=IN IP4 192.168.0.10\r\nt=0 0\r\nm=audio 19298 RTP/AVP 0 19\r\nc=IN IP4 192.168.0.10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:19 CN/8000\r\na=ptime:20"; testRequest = ParserTools::LineFeedSanityCheck( testRequest ); SIPMessage * msg = new SIPMessage( testRequest ); OString addrStr = "192.168.0.147"; OString portStr = "10000"; SIPHeader rcvAddr( "RCVADDR", addrStr ); SIPHeader rcvPort( "RCVPORT", portStr ); SIPHeader rcvTran( "RCVTRAN", "udp" ); msg->AddInternalHeader( rcvAddr ); msg->AddInternalHeader( rcvPort ); msg->AddInternalHeader( rcvTran ); msg->SetInterfaceAddress( "192.168.0.202" ); msg->SetInterfacePort( 5070 ); OStringStream traceStream; traceStream << "<<< " << msg->GetStartLine() << " " << " SRC: " << addrStr << ":" << portStr << ":UDP" << " enc=" << msg->IsEncrypted() << " bytes=1103"; OStringStream strPacket; strPacket << *msg; COMPOUND_LOG_CONTEXT( LogInfo(), msg->GetCallId(), traceStream.str(), LogDebugHigh(), strPacket ); SIPTransport::NotifyRead( traceStream.str() ); if( msg->IsInvite() ) { SIPMessage * trying = new SIPMessage(); msg->CreateResponse( *trying, SIPMessage::Code100_Trying ); Via via; msg->GetViaAt(0, via ); if( via.IsBehindNAT() ) { SIPURI srcURI; srcURI.SetHost(addrStr); srcURI.SetPort(portStr); trying->SetSendAddress(srcURI); } if( msg->IsEncrypted() ) trying->SetEncryption( TRUE ); GetTransportManager()->ProcessOutbound( trying ); } GetTransportManager()->OnTransportEvent( new SIPTransportEvent( msg, SIPTransportEvent::UDPPacketArrival ) ); if (numberOfPackets > 1) delay = 40; numberOfPackets++; } }} The SIP timers B and H are set to 20 ms. #define SIP_TIMER_B 20 #define SIP_TIMER_H 20 After all messages are sent, I wait for a long time but the memory used doesn't decrease. I tried different settings: Case 1 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (40 ms) -> 5 min1)Mem Usage 8332k 8940k 9080k 9400k2)Mem Usage 8364k 8952k 8976k 9416k3)Mem Usage 8300k 8888k 8908k 9368k Case 2 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 9998 Invite (40 ms) -> 5 min1)Mem Usage 8308k 8900k 9000k 9696k2)Mem Usage 8320k 8908k 8928k 9760k The leak is bigger when the amount of messages are higher.Case 3 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (30 ms) -> 5 min1)Mem Usage 8252k 8832k 8852k 9532k 2)Mem Usage 8256k 8844k 8872k 9536k Case 4 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (20 ms) -> 5 min1)Mem Usage 8276k 8864k 8884k 9728k 2)Mem Usage 8240k 8828k 8848k 9728k The leak is bigger when the delay is shorter. Case 5 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (80 ms) -> 5 min1)Mem Usage 8344k 8932k 8952k 9332k2)Mem Usage 8376k 8968k 8992k 9276k The only type of error in the log is : 102:42:36.691 ERR: [CID=0x0000] UDP Socket Read Error (Socket not connected) in case 1 appears 5219 times. I don't know if this error is linked with the leak. The log is attached. This behavior doesn't seem to be because of transactions waiting for timers. Maybe is because some type of conflict with shared resources or mutexs, but I really don't know. Any idea? If you need more info, please let me know. One more thing, I suggest to increase MAX_SIP_MESSAGE_LENGTH because i had problems with Invites with a lot of headers (record-routes, vias, etc) and long bodies. #define MAX_SIP_MESSAGE_LENGTH 2048 ----> #define MAX_SIP_MESSAGE_LENGTH 4000 Thanks for your help. Gustavo Curetti > > >> Date: Sat, 21 Jun 2008 10:17:22 +0800> To: cur...@gm...> From: joe...@gm...> CC: joe...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > Hi Gustavo,> > This time, I am not sure if what you are seeing in perfmon is actually a > leak or simply transactions waiting for timers to fire so it could > transition from Completed to Terminated state. I tried to fire the same > in my perfmon and the private mem leveled at around 80 in the graph. > Same place where yours leveled to a straight line. Can you share more > info why you think this is a leak?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen,> > > > Another case of memory leak is attached. (no debugging mode).> > I send 5000 messages with 40 ms delay between each message.> > A jpg of the perfmon is attached too. (Private Bytes)> > > > Thanks for your help> >> > Gustavo Curetti> >> >> > ------------------------------------------------------------------------> >> > > Date: Fri, 20 Jun 2008 09:33:12 +0800> > > To: cur...@gm...; ope...@li...> > > From: joe...@gm...> > > CC: joe...@gm...> > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > >> > > Right! Patch is in CVS.> > >> > > Joegen> > >> > > Gustavo Curetti wrote:> > > > Hi Joegen,> > > >> > > > Thanks for your help. The other header which is missing in the > > SIPMessage::CleanUp() is the m_SessionExpires ("session-expires"). I > > will continue with my tests and let you know.> > > >> > > > Gustavo> > > >> > > >> > > >> > >> > >> > > > > -------------------------------------------------------------------------> > > Check out the new SourceForge.net Marketplace.> > > It's the best place to buy or sell services for> > > just about anything Open Source.> > > http://sourceforge.net/services/buy/index.php> > > _______________________________________________> > > opensipstack-devel mailing list> > > ope...@li...> > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> >> >> > ------------------------------------------------------------------------> > ¿Aburrido? Ingresá ya y divertite como nunca en MSN Juegos. MSN Juegos > > <http://juegos.ar.msn.com/>> > ------------------------------------------------------------------------> >> > Internal Virus Database is out-of-date.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > > > -------------------------------------------------------------------------> Check out the new SourceForge.net Marketplace.> It's the best place to buy or sell services for> just about anything Open Source.> http://sourceforge.net/services/buy/index.php> _______________________________________________> opensipstack-devel mailing list> ope...@li...> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >> > > Descargá GRATIS el poder del nuevo Internet Explorer 7. Internet Explorer 7 > _________________________________________________________________ > Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de tus artistas favoritos. > http://msninconcert.msn.com/music/archive/es-la/archive.aspx > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > > |
From: Joegen E. B. <joe...@gm...> - 2008-07-01 06:23:11
|
Hi Gustavo, I have re-instated PMEMORY_CHECK enabling for release builds. Just define PMEMORY_CHECK=1. Let me know if you find out something Joegen jo...@op... wrote: > Weird indeed. I will create a new status page that dumps memory > snap-shot via the admin pages. I will keep you posted. > > Joegen > > Gustavo Curetti wrote: > >> Hi Joegen >> >> I found something really weird. If I change the order of headers in SIPMessage::Cleanup() the memory leak varies. >> For example, if I clean m_AllowList and m_ViaList first of all the memory leak decrease: >> >> void SIPMessage::Cleanup(){ GlobalLock(); >> >> if( m_AllowList != NULL ){ delete m_AllowList; m_AllowList = NULL; } /// special headers if( m_ViaList != NULL ){ delete m_ViaList; m_ViaList = NULL; } >> ..... >> >> I will continue searching. ¿Is there a way to configure PMEMORY_CHECK for release? >> >> Thanks for your help. >> >> Gustavo Curetti >> >> >> From: cur...@ho...To: jo...@op...; joe...@gm...; ope...@li...Subject: RE: [OpenSIPStack] FW: Memory Leak in Proxy and Full ModeDate: Mon, 23 Jun 2008 21:42:45 +0200 >> >> >> Hi Joegen I think this is a memory leak because after all messages are sent the memory never go down.The code added in B2BUserAgent::Registrar::ProcessUpperRegKeepAlive() waits 5 seconds and sends the first Invite, then waits 5 seconds , sends the second Invite, waits 5 seconds more and finally sends 4998 Invites with a 40 ms delay between each one. void B2BUserAgent::Registrar::ProcessUpperRegKeepAlive(){ DWORD delay = 5000; DWORD numberOfPackets = 0; while( !m_UpperRegSync.Wait( delay ) ) { if(numberOfPackets < 5000) { OString testRequest = "INVITE sip:5435155555@192.168.0.5:5060 SIP/2.0\r\nContact: <sip:4284623@192.168.0.10:5060>\r\nCSeq: 101 INVITE\r\nFrom: <sip:4284623@192.168.0.10>;tag=5A3745C-2418\r\nTo: <sip:55555555@192.168.0.206>\r\nVia: SIP/2.0/UDP 192.168.0.206:5060;branch=z9hG4bK63028de3a6b7743a\r\nVia: SIP/2.0/UDP 192.168.0.10:5060\r\nRecord-Route: <sip:192.168.0.206:5060;lr>\r\nAllow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO\r\nUser-Agent: Cisco-SIPGateway/IOS-12.x\r\nCall-Id: " + OString(numberOfPackets) + "@192.168.0.10\r\nMax-Forwards: 6\r\nExpires: 180\r\nContent-Length: 235\r\ndate: Thu, 22 May 2008 21:52:32 GMT\r\nsupported: timer\r\nmin-se: 1800\r\ncisco-guid: 926237238-662704605-3106705574-3236916195\r\nremote-party-id: <sip:4284623@192.168.0.10>;party=calling;screen=no;privacy=off\r\ntimestamp: 1211493152\r\nallow-events: telephone-event\r\ncontent-type: application/sdp\r\n\r\nv=0\r\no=CiscoSystemsSIP-GW-UserAgent 7402 717 IN IP4 192.168.0.10\r\ns=SIP Call\r\nc=IN IP4 192.168.0.10\r\nt=0 0\r\nm=audio 19298 RTP/AVP 0 19\r\nc=IN IP4 192.168.0.10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:19 CN/8000\r\na=ptime:20"; testRequest = ParserTools::LineFeedSanityCheck( testRequest ); SIPMessage * msg = new SIPMessage( testRequest ); OString addrStr = "192.168.0.147"; OString portStr = "10000"; SIPHeader rcvAddr( "RCVADDR", addrStr ); SIPHeader rcvPort( "RCVPORT", portStr ); SIPHeader rcvTran( "RCVTRAN", "udp" ); msg->AddInternalHeader( rcvAddr ); msg->AddInternalHeader( rcvPort ); msg->AddInternalHeader( rcvTran ); msg->SetInterfaceAddress( "192.168.0.202" ); msg->SetInterfacePort( 5070 ); OStringStream traceStream; traceStream << "<<< " << msg->GetStartLine() << " " << " SRC: " << addrStr << ":" << portStr << ":UDP" << " enc=" << msg->IsEncrypted() << " bytes=1103"; OStringStream strPacket; strPacket << *msg; COMPOUND_LOG_CONTEXT( LogInfo(), msg->GetCallId(), traceStream.str(), LogDebugHigh(), strPacket ); SIPTransport::NotifyRead( traceStream.str() ); if( msg->IsInvite() ) { SIPMessage * trying = new SIPMessage(); msg->CreateResponse( *trying, SIPMessage::Code100_Trying ); Via via; msg->GetViaAt(0, via ); if( via.IsBehindNAT() ) { SIPURI srcURI; srcURI.SetHost(addrStr); srcURI.SetPort(portStr); trying->SetSendAddress(srcURI); } if( msg->IsEncrypted() ) trying->SetEncryption( TRUE ); GetTransportManager()->ProcessOutbound( trying ); } GetTransportManager()->OnTransportEvent( new SIPTransportEvent( msg, SIPTransportEvent::UDPPacketArrival ) ); if (numberOfPackets > 1) delay = 40; numberOfPackets++; } }} The SIP timers B and H are set to 20 ms. #define SIP_TIMER_B 20 #define SIP_TIMER_H 20 After all messages are sent, I wait for a long time but the memory used doesn't decrease. I tried different settings: Case 1 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (40 ms) -> 5 min1)Mem Usage 8332k 8940k 9080k 9400k2)Mem Usage 8364k 8952k 8976k 9416k3)Mem Usage 8300k 8888k 8908k 9368k Case 2 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 9998 Invite (40 ms) -> 5 min1)Mem Usage 8308k 8900k 9000k 9696k2)Mem Usage 8320k 8908k 8928k 9760k The leak is bigger when the amount of messages are higher.Case 3 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (30 ms) -> 5 min1)Mem Usage 8252k 8832k 8852k 9532k 2)Mem Usage 8256k 8844k 8872k 9536k Case 4 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (20 ms) -> 5 min1)Mem Usage 8276k 8864k 8884k 9728k 2)Mem Usage 8240k 8828k 8848k 9728k The leak is bigger when the delay is shorter. Case 5 5 sec -> 1 Invite -> 5 sec -> 1 Invite -> 5 sec -> 4998 Invite (80 ms) -> 5 min1)Mem Usage 8344k 8932k 8952k 9332k2)Mem Usage 8376k 8968k 8992k 9276k The only type of error in the log is : 102:42:36.691 ERR: [CID=0x0000] UDP Socket Read Error (Socket not connected) in case 1 appears 5219 times. I don't know if this error is linked with the leak. The log is attached. This behavior doesn't seem to be because of transactions waiting for timers. Maybe is because some type of conflict with shared resources or mutexs, but I really don't know. Any idea? If you need more info, please let me know. One more thing, I suggest to increase MAX_SIP_MESSAGE_LENGTH because i had problems with Invites with a lot of headers (record-routes, vias, etc) and long bodies. #define MAX_SIP_MESSAGE_LENGTH 2048 ----> #define MAX_SIP_MESSAGE_LENGTH 4000 Thanks for your help. Gustavo Curetti >> >> >> >>> Date: Sat, 21 Jun 2008 10:17:22 +0800> To: cur...@gm...> From: joe...@gm...> CC: joe...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > Hi Gustavo,> > This time, I am not sure if what you are seeing in perfmon is actually a > leak or simply transactions waiting for timers to fire so it could > transition from Completed to Terminated state. I tried to fire the same > in my perfmon and the private mem leveled at around 80 in the graph. > Same place where yours leveled to a straight line. Can you share more > info why you think this is a leak?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen,> > > > Another case of memory leak is attached. (no debugging mode).> > I send 5000 messages with 40 ms delay between each message.> > A jpg of the perfmon is attached too. (Private Bytes)> > > > Thanks for your help> >> > Gustavo Curetti> >> >> > ------------------------------------------------------------------------> >> > > Date: Fri, 20 Jun 2008 09:33:12 +0800> > > To: cur...@gm...; ope...@li...> > > From: joe...@gm...> > > CC: joe...@gm...> > > Subject: Re: [OpenSIPStack] FW: Memory Leak in Proxy and Full Mode> > >> > > Right! Patch is in CVS.> > >> > > Joegen> > >> > > Gustavo Curetti wrote:> > > > Hi Joegen,> > > >> > > > Thanks for your help. The other header which is missing in the > > SIPMessage::CleanUp() is the m_SessionExpires ("session-expires"). I > > will continue with my tests and let you know.> > > >> > > > Gustavo> > > >> > > >> > > >> > >> > >> > > > > -------------------------------------------------------------------------> > > Check out the new SourceForge.net Marketplace.> > > It's the best place to buy or sell services for> > > just about anything Open Source.> > > http://sourceforge.net/services/buy/index.php> > > _______________________________________________> > > opensipstack-devel mailing list> > > ope...@li...> > > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> >> >> > ------------------------------------------------------------------------> > ¿Aburrido? Ingresá ya y divertite como nunca en MSN Juegos. MSN Juegos > > <http://juegos.ar.msn.com/>> > ------------------------------------------------------------------------> >> > Internal Virus Database is out-of-date.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > > > -------------------------------------------------------------------------> Check out the new SourceForge.net Marketplace.> It's the best place to buy or sell services for> just about anything Open Source.> http://sourceforge.net/services/buy/index.php> _______________________________________________> opensipstack-devel mailing list> ope...@li...> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >>> >>> >> Descargá GRATIS el poder del nuevo Internet Explorer 7. Internet Explorer 7 >> _________________________________________________________________ >> Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de tus artistas favoritos. >> http://msninconcert.msn.com/music/archive/es-la/archive.aspx >> ------------------------------------------------------------------------- >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://sourceforge.net/services/buy/index.php >> _______________________________________________ >> opensipstack-devel mailing list >> ope...@li... >> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >> >> >> >> >> > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG. > Version: 8.0.101 / Virus Database: 270.4.2/1523 - Release Date: 6/28/2008 7:00 AM > |