[commit: ghc] master: rts: Abort if timerfd read fails (c7b1e93)

git at git.haskell.org git at git.haskell.org
Fri Jun 22 19:59:49 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c7b1e93b47915a5276dfdb04f09030f5abaed290/ghc

>---------------------------------------------------------------

commit c7b1e93b47915a5276dfdb04f09030f5abaed290
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Jun 21 17:00:32 2018 -0400

    rts: Abort if timerfd read fails
    
    Currently we belch some output to stderr but fail to abort, resulting in
    a busy loop. Fixes #15292.
    
    Test Plan:
     * Validate
     * try running program under environment without timerfd capabilities;
    ensure we don't busy-loop
    
    Reviewers: simonmar, erikd
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15929
    
    Differential Revision: https://phabricator.haskell.org/D4875


>---------------------------------------------------------------

c7b1e93b47915a5276dfdb04f09030f5abaed290
 rts/posix/itimer/Pthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c
index f591d5e..d8f2497 100644
--- a/rts/posix/itimer/Pthread.c
+++ b/rts/posix/itimer/Pthread.c
@@ -123,7 +123,7 @@ static void *itimer_thread_func(void *_handle_tick)
         if (USE_TIMERFD_FOR_ITIMER) {
             if (read(timerfd, &nticks, sizeof(nticks)) != sizeof(nticks)) {
                 if (errno != EINTR) {
-                    sysErrorBelch("Itimer: read(timerfd) failed");
+                    barf("Itimer: read(timerfd) failed");
                 }
             }
         } else {



More information about the ghc-commits mailing list