Ticket #4504 (closed bug: fixed)
"awaitSignal Nothing" does not block thread with -threaded
| Reported by: | adept | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.2 |
| Component: | Runtime System | Version: | 7.0.1 |
| Keywords: | Cc: | kazu@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Incorrect result at runtime | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Consider the following code:
module Main where import System.Posix.Signals import Control.Concurrent main :: IO () main = do awaitSignal Nothing >> yield
According to the System.Posix.Signals haddock, "awaitSignal Nothing" should call pause(2), causing main thread to block until some signal has arrived. This is indeed what happens when this code is compiled by GHC 7.0.1 like so: "ghc --make awaitSignal.hs".
However, when compiled with -threaded, this code exits immediately when run. I think this is a bug in -threaded runtime.
I've tested with GHC 6.12.1, and this behavior is present there as well. Maybe I'm missing something non-obvious here?
My environment: x86, Debian sid, GHC 6.12.1 from Debian packages, GHC 7.0.1 from binary packages from GHC site.

