Fix segfault in get-value for function default over exhausted finite range (#403) - #655
Merged
ahmed-irfan merged 1 commit intoJul 8, 2026
Conversation
…range (SRI-CSL#403) When building a model, a function/array's default value is a fresh particle of the range type. egraph_concretize_value realized it with make_fresh_value, which returns null_value for a finite range whose values are all already used. The null_value (-1) was passed unchecked to vtbl_mk_function, crashing on get-value in QF_AUFBV. Fall back to vtbl_make_object when no fresh value exists: a function's default outside its explicit domain can be any value of the range type, and distinctness of function variables is enforced separately by force_maps_to_differ (fun_solver.c).
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.
Fixes #403.
get-valueon a function/array term segfaults in QF_AUFBV (CDCL(T) solver).Cause
When building a model, a function/array's default value (its value outside the explicitly-mapped domain) is a fresh particle of the range type.
egraph_concretize_valuerealizes it withmake_fresh_value, which returnsnull_valuefor a finite range whose values are all already used in the value table (in the report, rangeBitVec 2— all 4 values taken). Thatnull_value(-1) was passed unchecked tovtbl_mk_functionas the default, crashing (in debug:assert(good_object(table, def))atconcrete_values.c:2445).Fix
When no fresh value exists, fall back to
vtbl_make_object. This is sound: a function's default outside its explicit domain can be any value of the range type, and distinctness of function variables is enforced separately byforce_maps_to_differ(fun_solver.c). Mirrors the existing mcsatuf_plugin.cpattern (vtbl_make_objectfor finite types,make_fresh_valueonly for infinite ones).Verification
satwith a valid model.tests/regress/iss403.smt2(+.gold).