Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal sandbox + cabal repl + haskeline doesn't handle Ctrl-C #1560

Closed
spl opened this issue Oct 25, 2013 · 4 comments
Closed

cabal sandbox + cabal repl + haskeline doesn't handle Ctrl-C #1560

spl opened this issue Oct 25, 2013 · 4 comments

Comments

@spl
Copy link

spl commented Oct 25, 2013

This bug looks like #1448. I'm told that that issue is supposedly fixed, so I'm reporting this as a new issue.

Relevant versions:

  • Mac OS X 10.8.5 (Mountain Lion)
  • Haskell Platform 2013.2.0.0 (64 bit)
  • GHC 7.6.3
  • Cabal 1.18.1.1
  • cabal-install 1.18.0.2
  • process 1.1.0.2

Steps to reproduce:

  1. Download/clone this small ib package and enter the repository directory
  2. cabal sandbox init
  3. cabal install --only-dependencies (installs terminfo-0.3.2.5 and haskeline-0.7.0.3)
  4. cabal repl
  5. *Main> main
  6. Ctrl-C
  7. After the program exits, hit Enter a few times

Resulting output:

$ cabal repl
Preprocessing executable 'ib' for ib-0.0.0.0...
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.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package terminfo-0.3.2.5 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package haskeline-0.7.0.3 ... linking ... done.
[1 of 1] Compiling Main             ( Main.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
0:
line 0:Caught interrupted
1:

$

$ *** Exception: <stdin>: hGetChar: hardware fault (Input/output error)
*Main>

<stdin>: hGetChar: hardware fault (Input/output error)

Notes:

  • If I install the dependencies (same version) locally without sandboxing, I see the expected behavior for Ctrl-C (i.e. the interrupt exception is caught):
$ ghci Main.hs
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.
[1 of 1] Compiling Main             ( Main.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package terminfo-0.3.2.5 ... linking ... done.
Loading package haskeline-0.7.0.3 ... linking ... done.
0:
line 0:Caught interrupted
1:
line 1:Caught interrupted
2:
@23Skidoo
Copy link
Member

Reproducible on Linux:

Ok, modules loaded: Main.
*Main> main
0:
line 0:
1:2
line 1:2
2:

line 2:Caught interrupted
$ 

*** Exception: <stdin>: hGetChar: hardware fault (Input/output error)                                                                                                                                                                                                                                                          
$ 

<stdin>: hGetChar: hardware fault (Input/output error)

@23Skidoo
Copy link
Member

Interestingly enough, this seems to work just fine if I run rawSystem "ghci" [...] from ghci.

@23Skidoo
Copy link
Member

@spl

Should be fixed now.

@tibbe

I've also pushed this fix to the 1.18 branch.

@spl
Copy link
Author

spl commented Oct 28, 2013

@23Skidoo It worked for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants