View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004884 | libmicrohttpd | portability | public | 2017-02-07 11:26 | 2021-09-02 17:54 |
Reporter | tomasheran | Assigned To | Christian Grothoff | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86 | OS | Solaris | OS Version | 11.next |
Product Version | 0.9.52 | ||||
Target Version | 0.9.53 | Fixed in Version | 0.9.53 | ||
Summary | 0004884: pthread_kill(pid, 0) never returns ESRCH on Solaris 11.next | ||||
Description | src/testcurl/perf_get_concurrent.c depends on pthread_kill(pid, 0) to return ESRCH to detect that given thread finished. On Solaris 11.next, pthread_kill(...) doesn't return ESRCH unless given thread has been detached initially or joined/cancelled. | ||||
Additional Information | This simple fix seems to deal with the issue: --- a/src/testcurl/perf_get_concurrent.c Fri Oct 21 16:28:03 2016 +0200 +++ b/src/testcurl/perf_get_concurrent.c Fri Feb 03 14:25:16 2017 +0100 @@ -330,6 +330,11 @@ MHD_stop_daemon(d); return 512; } + if (0 != pthread_detach(pid)) + { + MHD_stop_daemon(d); + return 512; + } start_timer (); while (ESRCH != pthread_kill (pid, 0)) { | ||||
Tags | No tags attached. | ||||
|
It seems I was a bit too quick with my "fix", which solves the pthread_kill/ESRCH issue, but might cause problems trying to join already detached thread and could eventually cause SIGSEGV trying to fprintf() ret_val, that has never been initialized. |
|
Note that this change in Solaris was triggered by the POSIX / UNIX standards committee ("The Austin Group") clarifying the standard to require this, so this may affect other platforms as they adjust to comply as well. This was done via: http://austingroupbugs.net/view.php?id=765 http://austingroupbugs.net/view.php?id=792 |
|
Pushed a better fix in 2e826fb4..648b65aa that uses a volatile to avoid the ESRCH-issue entirely, even without detach. |
|
Fix committed to master branch. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-02-07 11:26 | tomasheran | New Issue | |
2017-02-07 12:35 | tomasheran | Note Added: 0011700 | |
2017-02-12 01:00 | alanc | Note Added: 0011714 | |
2017-02-12 09:42 | Christian Grothoff | Assigned To | => Christian Grothoff |
2017-02-12 09:42 | Christian Grothoff | Status | new => resolved |
2017-02-12 09:42 | Christian Grothoff | Resolution | open => fixed |
2017-02-12 09:42 | Christian Grothoff | Fixed in Version | => 0.9.53 |
2017-02-12 09:47 | Christian Grothoff | Note Added: 0011719 | |
2017-02-12 09:48 | Christian Grothoff | Target Version | => 0.9.53 |
2017-04-12 00:00 | Christian Grothoff | Status | resolved => closed |
2021-09-02 17:54 | Christian Grothoff | Changeset attached | => libmicrohttpd master 2e826fb4 |
2021-09-02 17:54 | Christian Grothoff | Note Added: 0018185 |