Skip to content

Improve memOutOfBounds precision by querying size/length of particular variable#2057

Merged
sim642 merged 5 commits into
masterfrom
memOutOfBounds-blobsize-var
Jun 17, 2026
Merged

Improve memOutOfBounds precision by querying size/length of particular variable#2057
sim642 merged 5 commits into
masterfrom
memOutOfBounds-blobsize-var

Conversation

@sim642

@sim642 sim642 commented Jun 16, 2026

Copy link
Copy Markdown
Member

This is a continuation of #2030.

It is necessary to make the analysis relational between the address base size and the offset (PR to come) but already on its own reveals some issues.

@sim642 sim642 added this to the SV-COMP 2027 milestone Jun 16, 2026
@sim642 sim642 self-assigned this Jun 16, 2026
sim642 added 2 commits June 16, 2026 14:43
The only true instance now queries a variable without offset.
So argument can be considered implicitly false.
@sim642 sim642 force-pushed the memOutOfBounds-blobsize-var branch from 06643c8 to e6b53bc Compare June 16, 2026 11:54
@sim642 sim642 marked this pull request as ready for review June 16, 2026 12:18
Copilot AI review requested due to automatic review settings June 16, 2026 12:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the memOutOfBounds precision improvements by making size/length queries target a specific base variable (rather than querying over a mixed points-to set), and simplifies the BlobSize query API accordingly.

Changes:

  • Simplify Queries.BlobSize from a {exp; base_address} record parameter to just exp.
  • Update the base analysis’ BlobSize query implementation to require base (no-offset) addresses and to cast blob sizes to ptrdiff for downstream arithmetic.
  • Update memOutOfBounds and base’s pointer-target sizing helpers to query BlobSize/EvalLength on AddrOf (Var v, NoOffset).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/domains/queries.ml Changes the BlobSize query type and related compare/hash/pretty logic.
src/analyses/memOutOfBounds.ml Queries blob size/array length using a base-address expression per pointee to improve precision.
src/analyses/base.ml Adjusts BlobSize query handling (offset handling + casting) and updates callers to use base-address queries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/domains/queries.ml Outdated
Comment thread src/analyses/memOutOfBounds.ml Outdated
Comment thread src/analyses/base.ml Outdated
Comment thread src/analyses/base.ml Outdated
@sim642 sim642 added sv-comp SV-COMP (analyses, results), witnesses precision cleanup Refactoring, clean-up labels Jun 16, 2026
@sim642 sim642 removed their assignment Jun 16, 2026
@sim642

sim642 commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

On sv-benchmarks with level02 and 90s, this makes no difference to verdicts.
Also this makes no difference to the dashboard checks comparison.
But that's expected because the values are joined currently anyway. This just avoids joining the sizes multiple times with themselves.

@sim642 sim642 merged commit 50581ed into master Jun 17, 2026
19 checks passed
@sim642 sim642 deleted the memOutOfBounds-blobsize-var branch June 17, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Refactoring, clean-up precision sv-comp SV-COMP (analyses, results), witnesses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants