-
Notifications
You must be signed in to change notification settings - Fork 63
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
Array copy set prep #1515
Array copy set prep #1515
Conversation
…W, instead of an uninterpreted function without parameters.
e565c3f
to
2087c0e
Compare
2087c0e
to
c3f2bbe
Compare
c3f2bbe
to
42899bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments on the code. Let's add changelogs and documentation and such for these new options.
@@ -220,6 +220,7 @@ initialState readFileFn = | |||
, rwDebugIntrinsics = True | |||
, rwWhat4HashConsing = False | |||
, rwWhat4HashConsingX86 = False | |||
, rwWhat4Eval = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's open ticket about plumbing this new option through the RPC server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, it's fairly easy to add support for toggling options like this in saw-remote-api
. You basically just add a new constructor here, and then update the code in setOption
, parseOption
, and instance Doc.DescribedMethod SetOptionParams OK
accordingly.
d927726
to
31321c2
Compare
@@ -220,6 +220,7 @@ initialState readFileFn = | |||
, rwDebugIntrinsics = True | |||
, rwWhat4HashConsing = False | |||
, rwWhat4HashConsingX86 = False | |||
, rwWhat4Eval = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, it's fairly easy to add support for toggling options like this in saw-remote-api
. You basically just add a new constructor here, and then update the code in setOption
, parseOption
, and instance Doc.DescribedMethod SetOptionParams OK
accordingly.
lty | ||
|
||
llvm_alloc_sym_init :: L.Type -> LLVMCrucibleSetupM (AllLLVM SetupValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious: does this work in practice when you apply in an a specification that is assumed with llvm_unsafe_assume_spec
? The reason I ask is that I'm doing something quite similar to this as part of ongoing work in #1461, and I couldn't make it work without making some nontrivial changes to the way doInvalidate
works in crucible
.
I suppose this is a long-winded way of asking for some more test cases using llvm_alloc_sym_init
. I'm not sure if you plan to do this as part of this PR or as part of a later PR, however.
@@ -763,7 +770,7 @@ enforcePointerValidity sc cc loc ss = | |||
addAssert c $ Crucible.SimError loc $ | |||
Crucible.AssertFailureSimError msg "" | |||
|
|||
| (LLVMAllocSpec mut _pty alignment psz _ploc fresh, ptr) <- mems | |||
| (LLVMAllocSpec mut _pty alignment psz _ploc fresh _sym_init, ptr) <- mems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to fix this case; or perhaps the proper fix is elsewhere, I'm not sure exactly.
At any rate, if we assume in a specification that an allocation is backed by symbolic bytes, then that incurs a proof obligation at call sites to ensure that the affected memory can actually be read, and I don't see where that is being checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is by design. Similar to what @RyanGlScott is working on, this changes the semantics of memory reads such that there are always some bytes. This is not the same as the combination of llvm_alloc
and llvm_points_to_array_prefix
. I will update the description to make it more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem right. This isn't a global option, it's a per-spec and per-allocation. I can use llvm_alloc
in some places and llvm_alloc_sym_init
in some other places, right?
In that case, llvm_alloc_sym_init
incurs an obligation we have to check for, because it isn't universal.
Consider the following program:
And the following script:
On this branch, the verification of However, if I pass it the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest patch addresses my soundness concern; the user must take deliberate action to weaken the check.
I'd like to see a little more information in the documentation about what disabling that check means, but otherwise I am happy.
No description provided.