Skip to content
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

Crucible panic when only one of two overrides modifies ghost state #542

Closed
langston-barrett opened this issue Sep 20, 2019 · 1 comment
Closed
Labels
subsystem: crucible-llvm Issues related to LLVM bitcode verification with crucible-llvm type: bug Issues reporting bugs or unexpected/unwanted behavior
Milestone

Comments

@langston-barrett
Copy link
Contributor

test_ghost_branch_02 in #541 causes Crucible to panic. The gist is that the function f modifies an external global variable (modeled with ghost state) in only one of its two branches. Accordingly, f has two overrides, one where the ghost state gets mutated, and one where it doesn't. If these branches are merged, then the panic occurs.

Quoting from a conversation with @brianhuffman:

That message means that there is a global variable that exists in one branch, but does not exist at all in the other branch. This is not supposed to happen, because you are only supposed to create new global variables at the top-level, and not while inside a branch
It would be better if we would detect that problem when the global is created, instead of later when the merge happens
The reason for the restriction is that global variables are supposed to contain defined values, never partial values. Merging an existing value with a non-existing one would require creating a partial value
Maybe it should declare the other kind of variable instead, by which I mean a RefCell as opposed to a GlobalVar. See module Lang.Crucible.Simulator.GlobalState in package crucible

TL;DR: Ghost state is modeled using Crucible's global variables, it probably shouldn't be due to inherent restrictions on having different sets of globals in different branches.

@langston-barrett langston-barrett added type: bug Issues reporting bugs or unexpected/unwanted behavior subsystem: crucible-llvm Issues related to LLVM bitcode verification with crucible-llvm labels Sep 20, 2019
@atomb atomb added this to the 0.6 milestone May 5, 2020
@atomb
Copy link
Contributor

atomb commented May 15, 2020

It looks like test_ghost_branch_02 is succeeding now, so I'm going to close this.

@atomb atomb closed this as completed May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: crucible-llvm Issues related to LLVM bitcode verification with crucible-llvm type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
Development

No branches or pull requests

2 participants