[MDEV-17200] pthread_detach called for already detached threads Created: 2018-09-14 Updated: 2018-10-05 Resolved: 2018-10-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server, Storage Engine - Aria |
| Affects Version/s: | 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.3.11, 10.1.37, 10.2.19 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kaarle Ritvanen | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Alpine Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
In several places, pthread_detach is called for threads that have been created as detached according to the attributes initialized in function init_thread_environment. According to POSIX, the behavior of such a call is undefined. These calls cause the server to crash with the latest version of musl libc. |
| Comments |
| Comment by Sergey Vojtovich [ 2018-09-21 ] |
|
kunkku, Looks like all MariaDB versions are affected. However I'm yet uncertain if we should fix this in old version like 5.5. In which versions are you interested to have this fixed? |
| Comment by Sergey Vojtovich [ 2018-09-21 ] |
|
OTOH it may happen so that it got broken by https://github.com/MariaDB/server/commit/0f01bf267680244ec488adaf65a42838756ed48e |
| Comment by Kaarle Ritvanen [ 2018-09-21 ] |
|
Personally, I am interested in 10.3 and 10.4. |
| Comment by Sergey Vojtovich [ 2018-09-21 ] |
|
kunkku, it may take a while before fix gets into release. Meanwhile feel free to try my patch at https://github.com/MariaDB/server/commit/c45b4a774b6d1404a080a1c1759f780fa78f223b |
| Comment by Sergey Vojtovich [ 2018-09-21 ] |
|
serg, please review fix for this bug. Do you think it still makes sense to keep this half-broken pthread_detach_this_thread()? |
| Comment by Sergei Golubchik [ 2018-10-05 ] |
|
You mean, under #if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT) ? I don't think we have this in buildbot, so it's practically a dead code. If it's old an not in buildbot, I'd say it doesn't make much sense to keep it. |