Skip to content

Add explicit W set to base protection privatization #1693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Feb 20, 2025

Regarding #1636 (comment).

Surprisingly, there was even a TODO about it:

let unlock ask getg sideg (st: BaseComponents (D).t) m =
let sideg = Wrapper.sideg ask sideg in
let atomic = Param.handle_atomic && LockDomain.MustLock.equal m (LockDomain.MustLock.of_var LibraryFunctions.verifier_atomic_var) in
(* TODO: what about G_m globals in cpa that weren't actually written? *)

@michael-schwarz michael-schwarz self-requested a review February 24, 2025 10:15
Copy link
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

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

This looks reasonable! Could you maybe add a regression test where this make a difference?

I will try if this also behaves the intended way in the context of #1636. If it does and after adding a test, we should be good to go!

Copy link
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

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

It falls short of what the snippet in #1636 achieves, likely because that one encodes a cheap path-sensitivity like behavior.

I pushed the merged verison to https://github.com/goblint/analyzer/tree/tmp_dn_1693 so we can play around with it.

@sim642
Copy link
Member Author

sim642 commented Mar 4, 2025

Hmm, I suppose keeping separate CPA maps for written and refined values could be more precise indeed.
Although that doesn't seem like it should to be specific to Protection-Based Reading, but potentially all/many privatizations?

@michael-schwarz
Copy link
Member

Although that doesn't seem like it should to be specific to Protection-Based Reading, but potentially all/many privatizations?

Sure! I think for base we know that it pays off. Not sure whether it's worth adding it to all privatizations?

@sim642
Copy link
Member Author

sim642 commented Mar 4, 2025

To each one individually, probably not. I was thinking more along the lines of some kind of generic lifting with the dual CPAs or something. I don't have a specific idea though, so it might not really be possible so generally.

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

Successfully merging this pull request may close these issues.

2 participants