Always force the exception in enqueued commands
ClosedPublic

Authored by watashi on Jun 8 2015, 12:35 AM.

Details

Summary

enqueueCommands should always force exception in commands. This fix that
exception thrown in :cmd command (e.g. `:cmd return $ head []) will
cause GHCi to terminate with panic.

Test Plan

cd testsuite/tests/ghci/ && make

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
watashi updated this revision to Diff 3162.Jun 8 2015, 12:35 AM
watashi retitled this revision from to Always force the exception in enqueued commands.
watashi updated this object.
watashi edited the test plan for this revision. (Show Details)
watashi added reviewers: austin, simonmar.
watashi updated the Trac tickets for this revision.
simonmar added inline comments.Jun 8 2015, 5:30 AM
ghc/InteractiveUI.hs
885

Can't we use deepseq here?

austin requested changes to this revision.Jun 8 2015, 9:23 PM
austin edited edge metadata.

Yeah, I say go with deepseq here. Also, great catch! I'll merge Trac #10501 to ghc-7.10 as well.

This revision now requires changes to proceed.Jun 8 2015, 9:23 PM
watashi updated this revision to Diff 3163.Jun 8 2015, 9:33 PM
watashi edited edge metadata.

use deepseq

austin requested changes to this revision.Jun 9 2015, 12:24 AM
austin edited edge metadata.

Right, sorry. You also need to modify ./ghc/ghc-bin.cabal.in to add the deepseq dependency (only when GHCi is built). I think this should work fine:

diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in
index b4fdf10..30eb7a7 100644
--- a/ghc/ghc-bin.cabal.in
+++ b/ghc/ghc-bin.cabal.in
@@ -43,6 +43,7 @@ Executable ghc
 
     GHC-Options: -Wall
     if flag(ghci)
+        Build-depends: deepseq >= 1.4 && < 1.5
         CPP-Options: -DGHCI
         GHC-Options: -fno-warn-name-shadowing
         Other-Modules:
This revision now requires changes to proceed.Jun 9 2015, 12:24 AM
watashi updated this revision to Diff 3171.Jun 9 2015, 2:27 AM
watashi edited edge metadata.

forgot that ghc-bin.cabal is generated

watashi updated this revision to Diff 3172.Jun 9 2015, 2:29 AM
watashi edited edge metadata.

tests

austin accepted this revision.Jun 9 2015, 4:26 AM
austin edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 9 2015, 4:26 AM
This revision was automatically updated to reflect the committed changes.