[Git][ghc/ghc][wip/io-manager-deadlock-detection] DEBUG: attempts to debug wasm poll failures
Duncan Coutts pushed to branch wip/io-manager-deadlock-detection at Glasgow Haskell Compiler / GHC Commits: bae911f5 by Duncan Coutts at 2026-08-29T21:39:32+01:00 DEBUG: attempts to debug wasm poll failures - - - - - 1 changed file: - rts/posix/Poll.c Changes: ===================================== rts/posix/Poll.c ===================================== @@ -424,13 +424,13 @@ void pollCompletedTimeoutsOrIOPoll(CapIOManager *iomgr) int res = ppoll(poll_table, nfds, &tv, NULL); debugTrace(DEBUG_iomanager, - "ppoll(nfds = %d, timeout.sec = 0, timeout.nsec = 0) = %d", + "ppoll(nfds = %lu, timeout.sec = 0, timeout.nsec = 0) = %d", nfds, res); #else int res = poll(poll_table, nfds, 0); debugTrace(DEBUG_iomanager, - "poll(nfds = %d, timeout_ms = 0) = %d", + "poll(nfds = %lu, timeout_ms = 0) = %d", nfds, res); #endif if (res == 0) { @@ -510,15 +510,26 @@ bool awaitCompletedTimeoutsOrIOPoll(CapIOManager *iomgr) int res = ppoll(poll_table, nfds, timeout_ns, NULL); debugTrace(DEBUG_iomanager, - "ppoll(nfds = %d, timeout.sec = %d, timeout.nsec = %d) = %d", + "ppoll(nfds = %lu, timeout.sec = %d, timeout.nsec = %d) = %d", nfds, timeout_ns == NULL ? -1 : timeout_ns->tv_sec, timeout_ns == NULL ? 0 : timeout_ns->tv_nsec, res); +#elif defined(wasm32_HOST_ARCH) + /* Debug hack: on wasm CI we observe failures like + * T5866: poll res = -1: Not supported + * We want to get more detail. + */ + int res = poll(poll_table, nfds, timeout_ms); + if (res < 0) { + sysErrorBelch("poll res = %d, errno = %d (ENOTSUP == %d), nfds = %lu, timeout_ms = %d", + res, errno, ENOTSUP, nfds, timeout_ms); + stg_exit(EXIT_FAILURE); + } #else int res = poll(poll_table, nfds, timeout_ms); debugTrace(DEBUG_iomanager, - "poll(nfds = %d, timeout_ms = %d) = %d", + "poll(nfds = %lu, timeout_ms = %d) = %d", nfds, timeout_ms, res); #endif @@ -579,7 +590,7 @@ static void reportPollError(int res, nfds_t nfds) // as soon as we get thread submitting an operation that would exceed // the limit. } else { - sysErrorBelch("poll res = %d", res); + sysErrorBelch("poll res = %d, errno = %d, nfds = %lu ", res, errno, nfds); stg_exit(EXIT_FAILURE); } } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bae911f54bfcc4431c1da755d556e390... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bae911f54bfcc4431c1da755d556e390... 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)