Opened 4 years ago

Last modified 6 weeks ago

#16707 new bug

THR: Test FAILED - conformance/interfaces/pthread_detach/4-2.test

Reported by: cocobean Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by cocobean)

pthread_create and pthread_detach implementations in Haiku R1b5 must pass these OpenPOSIX tests for UNIX 03/POSIX.1-2008 mandatory compliance:

conformance/interfaces/pthread_create/2-1: execution: FAILED 
conformance/interfaces/pthread_detach/4-2: execution: FAILED

Tested on: Haiku hrev58305 x86 with Open POSIX Test Suite 1.5.2

Change History (4)

comment:1 by cocobean, 4 years ago

Description: modified (diff)

comment:2 by cocobean, 6 weeks ago

Description: modified (diff)

comment:3 by waddlesplash, 6 weeks ago

Keywords: POSIX pthreads pthread_detach removed

pthread_create/2-1 now works.

4-2 fails because it wants ESRCH not EINVAL. But EINVAL can be returned for non-joinable threads, so I think that's OK?

comment:4 by cocobean, 6 weeks ago

Looked at POSIX.1-2024 for updated info...

 * Upon failure, it shall return an error number:
 * -[EINVAL] The implemenation has detected that the value specified by
 * 'thread' does not refer to a joinable thread.
 * -[ESRCH] No thread could be found corresponding to that thread

~/open_posix_testsuite/conformance/interfaces/pthread_detach> 4-2.test Test FAILED: Incorrect return code: 2147483643 instead of ESRCH

What seems to happen:

  1. Thread is created - no error
  2. Thread is joined - no error (i.e. no deadlocking)
  3. Thread terminates - no error
  4. Try and detach created thread - ESRCH (thread (ID) not found)

Key: "The point is to make sure the (created) thread has ended execution."

So the code is looking for the right condition/value of ESRCH when the created thread ID has terminated and no thread is found corresponding to that thread ID.

EINVAL seems reserved, in this case, for a non-joinable thread condition versus a 'requested thread to detach does not exist (or has terminated)" condition.

Last edited 6 weeks ago by cocobean (previous) (diff)
Note: See TracTickets for help on using tickets.