Skip to content

Commit

Permalink
Set crucible timeout in saw-remote-api.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreistefanescu committed Nov 24, 2021
1 parent 2c05dbc commit d927726
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions saw-remote-api/src/SAWServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import Verifier.SAW.TypedTerm (TypedTerm, CryptolModule)

import SAWScript.Crucible.LLVM.Builtins (CheckPointsToType)
import SAWScript.Crucible.LLVM.X86 (defaultStackBaseAlign)
import qualified SAWScript.Crucible.Common as CC (defaultSAWCoreBackendTimeout)
import qualified SAWScript.Crucible.Common.MethodSpec as CMS (ProvedSpec, GhostGlobal)
import qualified SAWScript.Crucible.LLVM.MethodSpecIR as CMS (SomeLLVM, LLVMModule)
import SAWScript.Options (Options(..), processEnv, defaultOptions)
Expand Down Expand Up @@ -224,6 +225,7 @@ initialState readFileFn =
, rwStackBaseAlign = defaultStackBaseAlign
, rwProofs = []
, rwPreservedRegs = []
, rwCrucibleTimeout = defaultSAWCoreBackendTimeout
}
return (SAWState emptyEnv bic [] ro rw M.empty)

Expand Down
4 changes: 4 additions & 0 deletions src/SAWScript/Crucible/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module SAWScript.Crucible.Common
, SAWCruciblePersonality(..)
, newSAWCoreBackend
, newSAWCoreBackendWithTimeout
, defaultSAWCoreBackendTimeout
, sawCoreState
) where

Expand Down Expand Up @@ -50,6 +51,9 @@ data SAWCruciblePersonality sym = SAWCruciblePersonality
newSAWCoreBackend :: SC.SharedContext -> IO Sym
newSAWCoreBackend sc = newSAWCoreBackendWithTimeout sc 0

defaultSAWCoreBackendTimeout :: Integer
defaultSAWCoreBackendTimeout = 10000

newSAWCoreBackendWithTimeout :: SC.SharedContext -> Integer -> IO Sym
newSAWCoreBackendWithTimeout sc timeout =
do st <- newSAWCoreState sc
Expand Down
3 changes: 2 additions & 1 deletion src/SAWScript/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import qualified Verifier.SAW.Cryptol.Prelude as CryptolSAW

-- Crucible
import qualified Lang.Crucible.JVM as CJ
import qualified SAWScript.Crucible.Common as CC
import qualified SAWScript.Crucible.Common.MethodSpec as CMS
import qualified SAWScript.Crucible.JVM.BuiltinsJVM as CJ
import SAWScript.Crucible.LLVM.Builtins
Expand Down Expand Up @@ -486,7 +487,7 @@ buildTopLevelEnv proxy opts =
, rwWhat4Eval = False
, rwPreservedRegs = []
, rwStackBaseAlign = defaultStackBaseAlign
, rwCrucibleTimeout = 10000
, rwCrucibleTimeout = CC.defaultSAWCoreBackendTimeout
}
return (bic, ro0, rw0)

Expand Down

0 comments on commit d927726

Please sign in to comment.