Opened 5 years ago

Closed 5 years ago

#2758 closed merge (fixed)

runghc in stdin mode ignores Ctrl-C on Windows, cannot be killed

Reported by: simonmar Owned by: igloo
Priority: normal Milestone: 6.10.2
Component: Runtime System Version: 6.10.1
Keywords: Cc: ndmitchell@…, Deewiant
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Moved from #2743.

Change History (10)

comment:1 Changed 5 years ago by simonmar

  • Architecture changed from Unknown/Multiple to x86
  • Operating System changed from Unknown/Multiple to Windows

comment:2 Changed 5 years ago by NeilMitchell

  • Cc ndmitchell@… added
  • Version changed from 6.8.3 to 6.10.1

I think this is actually a more general bug with GHC, rather than just runghc. Try for example:

main = print =<< getContents

On Windows XP this program cannot be aborted with Ctrl+C. I guess runghc uses code similar to read in the file, which is where the problem is.

This bug has already been reported on mailing lists under a few different guises, so is probably quite critical/

comment:3 Changed 5 years ago by Deewiant

  • Cc Deewiant added

comment:4 Changed 5 years ago by simonmar

  • Component changed from Compiler to Runtime System
  • Owner set to simonmar

In 6.8.3 you had to press C twice to exit the program, which was also wrong. The new bug is actually a result of the way that we now deliver C as an exception. Also, it works with -threaded (we had a dialogue with the darcs folks about making that work a while back).

I think I have a fix for the non-threaded case, will commit when I've validated.

comment:5 Changed 5 years ago by nominolo

FWIW, I have a similar problem with a program that only reads from a socket using the network-bytestring package. I'll test it as soon as the fix hits HEAD.

comment:6 Changed 5 years ago by nominolo

Ok, patch

Thu Nov 13 03:43:42 PST 2008  Simon Marlow <marlowsd@gmail.com>
 * notice ^C exceptions when waiting for I/O

fixes my problem mentioned above.

comment:7 Changed 5 years ago by simonmar

  • Owner changed from simonmar to igloo
  • Type changed from bug to merge

comment:8 Changed 5 years ago by simonmar

  • Owner changed from igloo to simonmar

oops, one more fix is required for runghc. Am validating now.

comment:9 Changed 5 years ago by simonmar

  • Owner changed from simonmar to igloo

These two patches need to be merged:

Thu Nov 13 03:43:42 PST 2008  Simon Marlow <marlowsd@gmail.com>
 * notice ^C exceptions when waiting for I/O

Fri Nov 14 05:09:58 PST 2008  Simon Marlow <marlowsd@gmail.com>
  * close the temporary Handle before removing the file

comment:10 Changed 5 years ago by igloo

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

Merged

Note: See TracTickets for help on using tickets.