[GHC] #825: with -threaded, infinite loops run too slowly
GHC
trac at galois.com
Wed Jul 12 21:13:57 EDT 2006
#825: with -threaded, infinite loops run too slowly
-------------------------------+--------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 6.4.2
Severity: normal | Keywords:
Os: Linux | Difficulty: Unknown
Architecture: x86 |
-------------------------------+--------------------------------------------
This program
{{{
a :: ()
a = a
main = print a
}}}
normally dies with a <<loop>> exception. However, when compiled with
-threaded, it just sits, consuming no CPU. While I know this isn't wrong
behavior, it severely confounded my expectation that an undefined value
would either throw an exception or start consuming resources
conspicuously. This caused me to go down the wrong alley debugging.
When watched with strace, I see the program repeatedly doing
{{{
12051 --- SIGALRM (Alarm clock) @ 0 (0) ---
12051 sigreturn() = ? (mask now [])
12051 futex(0x81c0178, FUTEX_WAIT, 1, NULL) = -1 EINTR (Interrupted system
call)
}}}
Another unhappy behavior of this program (compiled with -threaded) is that
it takes two SIGINTs to kill.
I'm using the ghc 6.4.2-2 package in Debian, and I saw the same behavior
with 6.4.1.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/825>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list