mailing list of musl libc
 help / color / mirror / code / Atom feed
* sem_wait and EINTR
@ 2018-12-05 19:16 Orivej Desh
  2018-12-05 19:47 ` Markus Wichmann
  2018-12-05 22:03 ` Rich Felker
  0 siblings, 2 replies; 19+ messages in thread
From: Orivej Desh @ 2018-12-05 19:16 UTC (permalink / raw)
  To: musl

Hi,

musl differs from glibc in that it does not return from sem_wait() on EINTR.
This mail [1] explains that this is useful to safeguard the software that does
not check sem_wait() return code. However, since glibc does return EINTR, such
bugs in the open source software seem to be eventually noticed and fixed.

The musl behaviour has a disadvantage in that it makes sem_wait() difficult to
interrupt (and delays the return from sem_timedwait() until the timeout), which
is relied upon in particular by multithreaded fuse for breaking out of the
main thread waiting loop [2]. IMHO the fuse implementation is sensible, since it
looks better than the alternatives I could imagine, and I'm inclined to patch
musl like this [3] to meet its expectations.

Am I missing some implications? Would you reconsider returning from sem_wait()
on EINTR? Could you suggest a good fix for fuse that does not change musl?

[1] https://www.openwall.com/lists/musl/2018/02/24/3
[2] https://github.com/libfuse/libfuse/blob/fuse-3.3.0/lib/fuse_loop_mt.c#L332
[3] https://github.com/orivej/musl/commit/c4c38aaab4fc55c23669f7b81386b615609cc3e1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-12-15  9:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 19:16 sem_wait and EINTR Orivej Desh
2018-12-05 19:47 ` Markus Wichmann
2018-12-05 21:27   ` Ondřej Jirman
2018-12-05 21:58     ` Rich Felker
2018-12-06  2:43       ` Orivej Desh
2018-12-06  3:17         ` Rich Felker
2018-12-06 15:57           ` Markus Wichmann
2018-12-06 16:23             ` Rich Felker
2018-12-06 17:03               ` Markus Wichmann
2018-12-06 17:33                 ` Markus Wichmann
2018-12-06 20:31                   ` Orivej Desh
2018-12-09  2:51                   ` Rich Felker
2018-12-09  6:50                     ` Markus Wichmann
2018-12-12  0:32                       ` Rich Felker
2018-12-12  5:15                         ` Markus Wichmann
2018-12-14 19:45                           ` Rich Felker
2018-12-15  9:45                             ` Markus Wichmann
2018-12-05 22:03 ` Rich Felker
2018-12-06  2:43   ` Orivej Desh

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).