Racecondition deteced which leads to crash of vncviewer.exe

Racecondition deteced which leads to crash of vncviewer.exe

Postby kamik-aze » 2010-02-16 06:42

This problem is reproducible on different machines and different Operating Systems - it occurs in the released version and also with earlier versions. Tested with WinXP 32Bit and Win2008 Server R2 64Bit (both directions server running one one machine and then on the other).

You can reproduce it by trying to connect with a wrong password - but its quite hard to reproduce.

The crash occurs in ClientConnection.cpp svn revision 495 on line 5574 looks like that: if (_this->m_nStatusTimer != 0)

Sometimes the local variable _this seems to be already destroyed, probably by another thread.

Because I didn't want to change a lot of code I inserted a try/ catch block around that region. As long as the exception is just caught and not rethrown the error doesn't occur anymore. I just did that for me because thats not critical, it only happens when an user provided a wrong password. Maybe you can implement a better solution.

Here is what I did, maybe you want to keep that until a better solution is implemented:

Code: Select all
   case WM_DESTROY:
            // sf@2002 - Destroy the status timer... TODO: improve this
            if (_this->m_nStatusTimer != 0)
               KillTimer(hwnd, _this->m_nStatusTimer);         
               _this->m_nStatusTimer = 0;
            _this->OldEncodingStatusWindow = -1;
            _this->m_fStatusOpen = false;
         catch( ... )
         return TRUE;

But you need to enable C++ Exception with the /EHa compiler flag in the project file in order to catch these kind of exceptions.
Posts: 1
Joined: 2009-09-23 14:59

Return to 1.0.8.X (stable)

Who is online

Users browsing this forum: No registered users and 2 guests