[haiku-bugs] Re: [Haiku] #8836: pthread_join on a detached pthread crashes

  • From: "leavengood" <trac@xxxxxxxxxxxx>
  • Date: Sun, 05 Aug 2012 14:14:57 -0000

#8836: pthread_join on a detached pthread crashes
----------------------------+----------------------------
   Reporter:  0x0dev        |      Owner:  nobody
       Type:  bug           |     Status:  closed
   Priority:  normal        |  Milestone:  R1
  Component:  System/POSIX  |    Version:  R1/Development
 Resolution:  invalid       |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  1             |   Platform:  All
----------------------------+----------------------------

Comment (by leavengood):

 As far as style of your latest patch, it isn't quite right. The space goes
 after the if but before the parenthesis, see the line right above your
 added one.

 As for the substance of the patch, it seems from Ingo that a detached
 thread passed in to pthread_join may no longer be valid, so I'm surprised
 that it works to check for the flags. In your tests that may only work
 because the memory used for the thread has not yet been written over, but
 that is certainly not always going to be the case. The fact that the free
 throws an error without your patch does point to this being the case.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8836#comment:8>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: