[GHC] #12475: GHCi no longer handles stdin being closed gracefully

#12475: GHCi no longer handles stdin being closed gracefully -------------------------------------+------------------------------------- Reporter: rowanblush | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It used to be the case that GHCi handled the user closing stdin gracefully, continuing to accept input and restoring stdin on :reload (as is documented in the GHC Users Guide GHCi FAQ (1)). This was the case in 7.6.3, but at least as of 7.8.4 GHCi now dies immediately after printing the prompt following usage of `getContents`. I'm using NixOs version 16.03.1171.9cb194c (Emu). I don't believe this to be a nix- or nixpkgs-related problem, but I don't have any other machines on which to test. I test 7.6.3, 7.8.4, 7.10.3 and 8.0.1 below. {{{ #!sh [rowanblush@coquelicot:~] +$ nix-shell -p haskell.packages.ghc763.ghc --command "ghci" --pure GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> getContents >> return () Prelude> getLine *** Exception: <stdin>: hGetLine: illegal operation (handle is closed) Prelude> :reload Ok, modules loaded: none. Prelude> getLine echo "echo" Prelude> :q Leaving GHCi. [rowanblush@coquelicot:~] :$ nix-shell -p haskell.packages.ghc784.ghc --command "ghci" --pure GHCi, version 7.8.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> getContents >> return () Prelude> <stdin>: hGetChar: illegal operation (handle is closed) [rowanblush@coquelicot:~] +$ nix-shell -p haskell.packages.ghc7103.ghc --command "ghci" --pure GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help Prelude> getContents >> return () Prelude> <stdin>: hGetChar: illegal operation (handle is closed) [rowanblush@coquelicot:~] +$ nix-shell -p haskell.packages.ghc801.ghc --command "ghci" --pure GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rowanblush/.ghci Prelude> getContents >> return () Prelude> <stdin>: hGetChar: illegal operation (handle is semi-closed) [rowanblush@coquelicot:~] +$ }}} (1): https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html #faq-and-things-to-watch-out-for -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12475 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12475: GHCi no longer handles stdin being closed gracefully -------------------------------------+------------------------------------- Reporter: rowanblush | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Hmm, I really don't know what changed here but indeed I can reproduce this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12475#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC