[GHC] #8938: Should fallback instead of EXIT_FAILURE on clock_gettime failure

#8938: Should fallback instead of EXIT_FAILURE on clock_gettime failure -------------------------------------------+------------------------------- Reporter: uznx | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.6.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- In GHC 7.6, `rts/posix/GetTime.c, Time getProcessCPUTime(void)`: if the result of `clock_gettime` is not zero (success), then the function should fall back to getrusage below instead of aborting with {{{ sysErrorBelch("clock_gettime"); stg_exit(EXIT_FAILURE); }}} The following patch demonstrates a possible fix: {{{ --- pre/rts/posix/GetTime.c 2013-04-18 17:22:47.000000000 -0400 +++ ghc-7.6.3/rts/posix/GetTime.c 2014-03-28 09:52:08.537125998 -0400 @@ -64,10 +64,8 @@ res = clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts); if (res == 0) { return SecondsToTime(ts.tv_sec) + NSToTime(ts.tv_nsec); - } else { - sysErrorBelch("clock_gettime"); - stg_exit(EXIT_FAILURE); } + // else fallback } #endif }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8938 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8938: Should fallback instead of EXIT_FAILURE on clock_gettime failure -------------------------------+------------------------------------------- Reporter: uznx | Owner: simonmar Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Runtime | Version: 7.6.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by simonmar): * status: new => infoneeded Comment: Did you actually encounter a problem? I'm not convinced that falling back to getrusage is the correct thing to do. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8938#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8938: Should fallback instead of EXIT_FAILURE on clock_gettime failure -------------------------------+------------------------------------------- Reporter: uznx | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: Component: Runtime | Version: 7.6.3 System | Keywords: Resolution: wontfix | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by simonmar): * status: infoneeded => closed * resolution: => wontfix -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8938#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC