Skip to content

Replace fake ZeroInit lattice with flat lattice#2035

Open
sim642 wants to merge 3 commits into
masterfrom
blob-zeroinit-join
Open

Replace fake ZeroInit lattice with flat lattice#2035
sim642 wants to merge 3 commits into
masterfrom
blob-zeroinit-join

Conversation

@sim642
Copy link
Copy Markdown
Member

@sim642 sim642 commented May 15, 2026

This is to potentially fix the issue from #2030 (comment).

The added test shows a handcrafted case where a malloc blob is joined with a calloc blob, which requires the joining of their ZeroInit values.
Previously, this raised an exception and even caused unsoundness because of the fake lattice being used.

This PR replaces that with a flat boolean lattice which can represent top.

TODO

@sim642 sim642 added this to the SV-COMP 2027 milestone May 15, 2026
@sim642 sim642 self-assigned this May 15, 2026
Copilot AI review requested due to automatic review settings May 15, 2026 07:57
@sim642 sim642 added bug unsound sv-comp SV-COMP (analyses, results), witnesses labels May 15, 2026
Comment on lines +911 to +914
if x = Bot then
zero_init_value t (* This should be zero initialized *)
else
x (* This already contains some value *)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already existing logic seems suspicious: seems it could be non-monotonic and unsound that zero_init_value isn't always included.
Maybe this was fine because the malloc and calloc cases were mutually exclusive before, but now with the top possibility, I'm not so sure anymore. If an initialized malloc blob (so not bot) is joined with an uninitialized calloc blob, then this doesn't add the zero-initialization.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug sv-comp SV-COMP (analyses, results), witnesses unsound

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants