Duncan Coutts pushed to branch wip/io-manager-deadlock-detection at Glasgow Haskell Compiler / GHC Commits: 11004739 by Duncan Coutts at 2026-07-22T10:39:13+01:00 FIXUP Make signal handling be a respondibility of the I/O manager(s) In select, we need to check for signals when we poll for I/O, as well as when select itself gets interupted by a signal. This matches what we do in the poll I/O manager. - - - - - 46bb53d6 by Duncan Coutts at 2026-07-22T10:55:06+01:00 FIXUP: Clean up the RTS internal signal handling API - - - - - 2 changed files: - rts/posix/Select.c - rts/posix/Signals.c Changes: ===================================== rts/posix/Select.c ===================================== @@ -277,8 +277,16 @@ awaitCompletedTimeoutsOrIOSelect(CapIOManager *iomgr, bool wait) do { now = getLowResTimeOfDay(); - if (wakeUpSleepingThreads(iomgr, now)) { - return true; + wakeUpSleepingThreads(iomgr, now); +#if defined(RTS_USER_SIGNALS) + startPendingSignalHandlers(iomgr->cap); +#endif + /* If either of the above (checking for timers or signal) caused threads + * to be started (or if the run queue was non-empty in the first place), + * then poll for I/O but don't block waiting. + */ + if (!emptyRunQueue(iomgr->cap)) { + wait = false; } /* ===================================== rts/posix/Signals.c ===================================== @@ -340,6 +340,9 @@ startPendingSignalHandlers(Capability *cap) // freed by runHandler memcpy(info, next_pending_handler, sizeof(siginfo_t)); + debugTrace(DEBUG_iomanager, + "Handling pending signal, no %d", info->si_signo); + StgTSO *t = createIOThread(cap, RtsFlags.GcFlags.initialStkSize, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8c458d21e0f9406160c6d278a777777... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8c458d21e0f9406160c6d278a777777... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Duncan Coutts (@dcoutts)