fix: tolerate temp dir cleanup failures on Windows#688
Draft
fabiomadge wants to merge 1 commit intostrata-org:mainfrom
Draft
fix: tolerate temp dir cleanup failures on Windows#688fabiomadge wants to merge 1 commit intostrata-org:mainfrom
fabiomadge wants to merge 1 commit intostrata-org:mainfrom
Conversation
5ced8d4 to
5b13503
Compare
Two fixes for Windows z3 compatibility: 1. Replace withTempDir with manual createTempDir + removeDirAll in try/catch, since z3 may exit non-zero and the OS may not release the SMT file handle immediately. 2. Don't emit (get-value) in SMT files. When z3 returns unsat, the subsequent (get-value) causes 'model is not available' error and z3 exits with code 1. This loses counterexample model values but avoids the error entirely. Both fixes are needed because the z3 exit code 1 from (get-value) triggers the temp dir cleanup failure on Windows.
5b13503 to
5e8a582
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, z3 may exit with a non-zero code (e.g., from
get-valueafterunsat), and the OS may not release the SMT file handle immediately. This causedIO.FS.withTempDir's cleanup to throw, crashing the process before diagnostics were emitted.Replace
withTempDirwith manualcreateTempDir+removeDirAllwrapped intry/catch.Root cause:
(get-value)is emitted unconditionally after(check-sat)in the file-based solver. When z3 returnsunsat,(get-value)errors with "model is not available" and z3 exits with code 1. The SMT file handle may remain locked briefly on Windows, causing the temp directory cleanup to fail.