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

Revert "Fix the zombie solver processes mentioned in #477" #693

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading