Ticket #1671 (closed bug: duplicate)

Opened 6 years ago

Last modified 5 years ago

Cannot ^C out of certain computations in GHCi

Reported by: lepsmith@… Owned by:
Priority: normal Milestone:
Component: GHCi Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by Isaac Dupree) (diff)

   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6.1, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Prelude> let a = 1 : a
Prelude> last a
^C
^C
^C

Change History

Changed 6 years ago by Isaac Dupree

  • description modified (diff)

Maybe this is related to (in compiled code, which last is) loops that do no allocation not being pre-emptible. Possibly it is a simplified version of #1583 where the computation never terminates, so GHCi never gets around to the <interactive>: exception :: GhcException state (I couldn't get ghci to respond in any way, even after lots of Control-C's, in this last example).

Changed 6 years ago by Isaac Dupree

Doing it purely in GHCi does not suffer this problem:

Prelude> let a = 1 : a
Prelude> let last [x] = x; last (_:xs) = last xs
Prelude> last a
^C
Interrupted.

Changed 6 years ago by guest

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to duplicate

duplicate of #367. Or at least the cause is the same, and fixing this would involve fixing #367.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.