Skip to content

Commit

Permalink
Revert "Fix the zombie solver processes mentioned in #477"
Browse files Browse the repository at this point in the history
  • Loading branch information
LeventErkok authored May 10, 2024
1 parent 3c04d86 commit 2970dd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 1 addition & 7 deletions Data/SBV/Control/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ module Data.SBV.Control.Utils (
, timeout, queryDebug, retrieveResponse, recoverKindedValue, runProofOn, executeQuery
) where

import Control.Exception (finally)
import Data.List (sortBy, sortOn, elemIndex, partition, groupBy, tails, intercalate, nub, sort, isPrefixOf, isSuffixOf)

import Data.Char (isPunctuation, isSpace, isDigit)
Expand Down Expand Up @@ -1899,12 +1898,7 @@ executeQuery queryContext (QueryT userQuery) = do

liftIO $ writeIORef (runMode st) $ SMTMode qc IRun isSAT cfg

lift $ join $ liftIO $
finally (extractIO $ join $ liftIO $ backend cfg' st (show pgm) $ extractIO . runReaderT userQuery) $ do
qs <- readIORef $ rQueryState st
case qs of
Nothing -> return ()
Just QueryState{queryTerminate} -> queryTerminate
lift $ join $ liftIO $ backend cfg' st (show pgm) $ extractIO . runReaderT userQuery

-- Already in a query, in theory we can just continue, but that causes use-case issues
-- so we reject it. TODO: Review if we should actually support this. The issue arises with
Expand Down
7 changes: 7 additions & 0 deletions Data/SBV/Core/Symbolic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,13 @@ runSymbolicInState st (SymbolicT c) = do
= contextMismatchError (sbvContext st) ctx Nothing Nothing

mapM_ check $ nub $ G.universeBi res

-- Clean-up after ourselves
qs <- liftIO $ readIORef $ rQueryState st
case qs of
Nothing -> return ()
Just QueryState{queryTerminate} -> liftIO queryTerminate

return (r, res)

-- | Grab the program from a running symbolic simulation state.
Expand Down

0 comments on commit 2970dd4

Please sign in to comment.