View Issue Details

IDProjectCategoryView StatusLast Update
0004884libmicrohttpdportabilitypublic2021-09-02 15:54
Reportertomasheran Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86OSSolarisOS Version11.next
Product Version0.9.52 
Target Version0.9.53Fixed in Version0.9.53 
Summary0004884: pthread_kill(pid, 0) never returns ESRCH on Solaris 11.next
Descriptionsrc/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 InformationThis 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))
     {
TagsNo tags attached.

Activities

tomasheran

2017-02-07 11:35

reporter   ~0011700

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.

alanc

2017-02-12 00:00

reporter   ~0011714

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

Christian Grothoff

2017-02-12 08:47

manager   ~0011719

Pushed a better fix in 2e826fb4..648b65aa that uses a volatile to avoid the ESRCH-issue entirely, even without detach.

Christian Grothoff

2021-09-02 15:54

manager   ~0018185

Fix committed to master branch.

Issue History

Date ModifiedUsernameFieldChange
2017-02-07 10:26tomasheranNew Issue
2017-02-07 11:35tomasheranNote Added: 0011700
2017-02-12 00:00alancNote Added: 0011714
2017-02-12 08:42Christian GrothoffAssigned To => Christian Grothoff
2017-02-12 08:42Christian GrothoffStatusnew => resolved
2017-02-12 08:42Christian GrothoffResolutionopen => fixed
2017-02-12 08:42Christian GrothoffFixed in Version => 0.9.53
2017-02-12 08:47Christian GrothoffNote Added: 0011719
2017-02-12 08:48Christian GrothoffTarget Version => 0.9.53
2017-04-11 22:00Christian GrothoffStatusresolved => closed
2021-09-02 15:54Christian Grothoff
2021-09-02 15:54Christian GrothoffNote Added: 0018185