Opened 7 years ago

Closed 7 years ago

#3171 closed merge (fixed)

threadDelay causes Ctrl-C to be ignored when running interpreted code

Reported by: chowells Owned by: igloo
Priority: normal Milestone: 6.10 branch
Component: Runtime System Version: 6.10.2
Keywords: runghc Cc:
Operating System: Linux Architecture: x86
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


the following program:

import Control.Concurrent
import Control.Concurrent.MVar
main = threadDelay 0 >> newEmptyMVar >>= takeMVar

will not respond to Ctrl-C when run via runghc, but does respond to Ctrl-C when compiled and executed.

If the threadDelay is removed, it does respond to Ctrl-C both compiled and interpreted.

In 6.10.1, Ctrl-C has the normal effect whether the program is run compiled or interpreted.

The editline segmentation fault bug prevented us from testing the behavior in ghci.

Change History (3)

comment:1 Changed 7 years ago by simonmar

  • difficulty set to Unknown
  • Owner set to simonmar

comment:2 Changed 7 years ago by simonmar

  • Milestone set to 6.10 branch
  • Owner changed from simonmar to igloo
  • Type changed from bug to merge

The new signal handling code in 6.10.2 broke Ctrl-C in GHCi.

The following patches have been pushed to fix it:

Thu Apr 23 04:29:39 PDT 2009  Simon Marlow <[email protected]>
  * don't overwrite io_manager_pipe if it is already set

Thu Apr 23 04:30:02 PDT 2009  Simon Marlow <[email protected]>
  * add getOrSetSignalHandlerStore, much like getOrSetTypeableStore

Fri Apr 24 10:16:10 BST 2009  Simon Marlow <[email protected]>           
  * add missing files (part of #3171 fix)

and in libraries/base:

Thu Apr 23 04:28:37 PDT 2009  Simon Marlow <[email protected]>
  * FIX #3171: make sure we have only one table of signal handlers

comment:3 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

All merged.

Note: See TracTickets for help on using tickets.