Fix CBMC output parser panic when using SMT solvers#4540
Open
tautschnig wants to merge 2 commits intomodel-checking:mainfrom
Open
Fix CBMC output parser panic when using SMT solvers#4540tautschnig wants to merge 2 commits intomodel-checking:mainfrom
tautschnig wants to merge 2 commits intomodel-checking:mainfrom
Conversation
Add Error variant to CheckStatus enum to handle the ERROR status returned by CBMC when using SMT solvers (z3, bitwuzla, cvc5). Previously this caused a deserialization panic. Resolves model-checking#4519
There was a problem hiding this comment.
Pull request overview
This PR fixes a panic in the CBMC output parser when using SMT solvers (z3, bitwuzla, cvc5) by adding a new Error variant to the CheckStatus enum. When SMT solvers encounter errors, CBMC returns an "ERROR" status that was not previously handled, causing deserialization to panic.
Changes:
- Added
Errorvariant toCheckStatusenum in bothkani-driverandkani-covmodules - Added
Errorvariant toFailedPropertiesenum and updated verification logic to treat ERROR status as a verification failure - Added regression test to ensure ERROR status is properly handled
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| kani-driver/src/cbmc_output_parser.rs | Added Error variant to CheckStatus enum with appropriate display formatting (red color) |
| tools/kani-cov/src/coverage.rs | Added Error variant to CheckStatus enum (duplicate maintained for issue #3541) with matching display implementation |
| kani-driver/src/call_cbmc.rs | Added Error variant to FailedProperties enum and updated logic to prioritize ERROR status and treat it as verification failure |
| kani-driver/src/cbmc_property_renderer.rs | Added message for solver errors in should_panic case |
| tests/expected/smt-solver-error-status/test.rs | Added regression test using bitwuzla solver with failing assertion |
| tests/expected/smt-solver-error-status/expected | Added expected output pattern for the regression test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Add Error variant to CheckStatus enum to handle the ERROR status returned by CBMC when using SMT solvers (z3, bitwuzla, cvc5). Previously this caused a deserialization panic.
Resolves #4519
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.