[Git][ghc/ghc][master] rts: Ignore EINTR while polling in timerfd itimer implementation
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Wed Apr 17 00:12:20 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00
rts: Ignore EINTR while polling in timerfd itimer implementation
While the RTS does attempt to mask signals, it may be that a foreign
library unmasks them. This previously caused benign warnings which we
now ignore.
See #24610.
- - - - -
1 changed file:
- rts/posix/ticker/TimerFd.c
Changes:
=====================================
rts/posix/ticker/TimerFd.c
=====================================
@@ -112,7 +112,12 @@ static void *itimer_thread_func(void *_handle_tick)
TSAN_ANNOTATE_BENIGN_RACE(&exited, "itimer_thread_func");
while (!RELAXED_LOAD(&exited)) {
if (poll(pollfds, 2, -1) == -1) {
- sysErrorBelch("Ticker: poll failed: %s", strerror(errno));
+ // While the RTS attempts to mask signals, some foreign libraries
+ // may rely on signal delivery may unmask them. Consequently we may
+ // see EINTR. See #24610.
+ if (errno != -EINTR) {
+ sysErrorBelch("Ticker: poll failed: %s", strerror(errno));
+ }
}
// We check the pipe first, even though the timerfd may also have triggered.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3a0642eada4086360b329dde07045661d90a495f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3a0642eada4086360b329dde07045661d90a495f
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240416/9275afdb/attachment.html>
More information about the ghc-commits
mailing list