Bug 100490
Summary: | pthread_detach in tls lib fails with more than 5 threads | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Sebastien Hensgen <hensgen> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 9 | CC: | fweimer | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2003-07-22 21:49:58 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Sebastien Hensgen
2003-07-22 21:24:20 UTC
Created attachment 93061 [details]
The code to compile and run to see the Segfmentation faults.
The code launch <n> threads, wait for they all exited, and call pthread_detach
on each of them.
<n> can be given as a parameter to the binary. 5 is default.
Your testcase is bogus. A pthread_t handle is not valid after pthread_join, it is like accessing memory after free or FILE * stream after fclose. The implementation may fail with EINVAL if it detects invalid handle, but is not required to do so. Doing so in all cases would be extremely expensive, would mean on every pthread_detach walking down all currently joinable threads and compare pthread_detach argument with them. Furthermore, even that doesn't handle the case when a pthread_t handle is reused for another thread after pthread_join (h1, ...); pthread_create (&h2, ...); pthread_detach (h1); if h2 == h1. |