Skip to content

Commit

Permalink
Improve message upon getting a premature solver ending
Browse files Browse the repository at this point in the history
Addresses #524
  • Loading branch information
LeventErkok committed May 31, 2020
1 parent 3a5322e commit 2f23664
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Data/SBV/SMT/SMT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import Control.Monad (zipWithM)
import Data.Char (isSpace)
import Data.Maybe (fromMaybe, isJust)
import Data.Int (Int8, Int16, Int32, Int64)
import Data.List (intercalate, isPrefixOf, transpose)
import Data.List (intercalate, isPrefixOf, transpose, isInfixOf)
import Data.Word (Word8, Word16, Word32, Word64)

import Data.IORef (readIORef, writeIORef)
Expand Down Expand Up @@ -711,7 +711,15 @@ runSolver cfg ctx execPath opts pgm continuation
, sbvExceptionExitCode = Nothing
, sbvExceptionConfig = cfg { solver = (solver cfg) { executable = execPath } }
, sbvExceptionReason = Nothing
, sbvExceptionHint = Nothing
, sbvExceptionHint = if "hGetLine: end of file" `isInfixOf` e
then Just [ "Solver process prematurely ended communication."
, ""
, "It is likely it was terminated because of a seg-fault."
, "Run with 'transcript=Just \"bad.smt2\"' option, and feed"
, "the generated \"bad.smt2\" file directly to the solver"
, "outside of SBV for further information."
]
else Nothing
}

SolverTimeout e -> do terminateProcess pid -- NB. Do not *wait* for the process, just quit.
Expand Down

0 comments on commit 2f23664

Please sign in to comment.