By Date: <-- -->
By Thread: <-- -->

OPAL: SIP Transports deletion, when STUN enabled



Hi,

Excellent debugging!

I have reproduced the problem (which didn't appear on Linux), and I have
fixed it.

Thanks for that excellent report!


Le samedi 28 janvier 2006 à 02:29 +0100, Jacek Stobnicki a écrit :
> Hi again... 
>  
> I'm testing new release of OPAL intensively, as you can observe:>
>  
> Environment: Windows XP, VS.NET 2003
>  
> There is a problem with SIPEndPoint::TransportThreadMain method. When
> I set STUN, and during exit delete OPALManager, program crashes
> (access violation reading location 0xXXXXXXXX) at:
>  
> (sipep.cxx, v2.97, line 664)
>  
> if (stunTransport) {
> natTransportMutex.Wait();    ------> here....
> natTransports.Remove(transport);
> natTransportMutex.Signal();
> }
>  
> This code is after main loop of transport thread, so it runs during
> deletion of it.
>  
> Well, I've started to debug the code, and after some time I have some
> conclusions:
> 1) this problem is connected with NAT binding which Damien implemented
> recently. Because previous versions do not have this piece of code at
> all.
> 2) It seems that there is some kind of race situation between thread
> that deletes SIPEndpoint and transport threads. 
> I've observed that when I'm deleting manager (and implicitly all
> classes connected to it), sometimes:
> A) this code from TransportThreadMain is called before destructor of
> SIPEndpoint (in MY machine very rare situation),
> B) this code runs AFTER destructor of endpoint (most of the cases).
>  
> When A occurs - all is clear, when B: the code use memory which is
> already free (becuase class is already deleted)  -> this is the cause
> of the crash and access violation exception. I don't have neccesary
> knowledge of library threading model to be able to correct this (but
> I'm understanding it better and better....:).
>  
> When I disable STUN, this piece of code is skipped, and program exits
> with no problems.
>  
> In my opinion this is very serious problem, but I must point that I
> didn't test this code on other machines - maybe mine is not
> typical....
>  
> Regards:
> Jacek Stobnicki
>  
-- 
 _      Damien Sandras
(o-     
//\     GnomeMeeting: http://www.gnomemeeting.org/
v_/_    FOSDEM 2006 : http://www.fosdem.org
        SIP Phone   : sip:dsandras (at) gnomemeeting.net 
                      sip:600000 (at) gnomemeeting.net

------------------------------------------------------------------------
Check the FAQ before asking! - http://www.openh323.org/~openh323/fom.cgi
The OpenH323 Project mailing list, using Mailman. To unsubscribe or
change your subscription options, goto
http://www.openh323.org/mailman/listinfo/openh323
Maintained by Quicknet Technologies, Inc - http://www.quicknet.net
------------------------------------------------------------------------