To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=113679
                 Issue #|113679
                 Summary|bridges: data race in OReaderThread::disposeEnvironmen
                        |t()
               Component|udk
                 Version|DEV300m84
                Platform|All
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|kr
             Reported by|olistraub





------- Additional comments from olistr...@openoffice.org Thu Aug  5 11:39:46 
+0000 2010 -------
The code in disposeEnvironment() does the following:

If pContext->m_pBridgeImpl->m_bDisposed is FALSE, it calls
pEnvRemote->dispose(...) and pEnvRemote->release()

However, the access to m_bDisposed is not guarded by a mutex. So, even if the
bridge has already started to dispose (RemoteEnvironment_thisDispose() has set
m_bDisposed to TRUE, but m_bDisposed in this thread is still seen as FALSE by
the CPU), the code will walk into the if branch.

On the other hand, if the bridge has already been disposed,
pEnvRemote->release() will never be called.

Wouldn't it be more correct to completely remove the check for m_bDisposed, and
just walk into the if-branch every time?

After doing this change, I also found out that I need to clear the mutex in
RemoteEnvironment_thisDispose() directly after setting the m_bDisposed flag.
Otherwise the OReader thread might deadlock waiting on the mutex, while the
thisDispose() method waits for the thread to finish.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@udk.openoffice.org
For additional commands, e-mail: issues-h...@udk.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to