To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=74137
                 Issue #|74137
                 Summary|osl::Thread objects are not safe
               Component|porting
                 Version|OOo 2.0.4
                Platform|All
                     URL|
              OS/Version|Windows, all
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|PATCH
                Priority|P3
            Subcomponent|code
             Assigned to|mh
             Reported by|tml





------- Additional comments from [EMAIL PROTECTED] Fri Feb  2 15:49:50 +0000 
2007 -------
If one allocates an osl::Thread object (well, an object of a subclass of
osl::Thread) on the stack and it goes out of scope and its memory gets reused
for some other random data before its run() or onTerminated() methods have been
called, one gets a crash. I assume the same happens if one calls delete on a
heap allocated osl::Thread too early.

In retrospect, this is rather obvious I guess, one should not destruct
implicitly or explicitly an osl::Thread object that is still running. Is there
any way to prevent this? Or should the destructor call join()? Then threadFunc()
should probably set m_hThread to zero once the run() function has returned.

I'll attach a minimal sample program that tries to reproduce the problem we saw
in OOo itself (with a patch not in the upstream sources). It was rather hard to
reproduce in a simple program, and one might need to tweak the delays in the
sample program to get it to crash repeatably.

---------------------------------------------------------------------
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to