Opened 4 years ago
Last modified 8 days 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 )
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 , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 days ago
Description: | modified (diff) |
---|
comment:3 by , 9 days ago
Keywords: | POSIX pthreads pthread_detach removed |
---|
comment:4 by , 8 days 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:
- Thread is created - no error
- Thread is joined - no error
- Thread terminates - no error
- 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.
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?