-
Notifications
You must be signed in to change notification settings - Fork 31
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
Reads without init events #624
Conversation
- Some changes in CAT models to support uninit reads - Minor other changes
- Automatically add empty(UR;loc;[IW]) axiom to all memory models.
# Conflicts: # dartagnan/src/main/java/com/dat3m/dartagnan/verification/solving/ModelChecker.java
I need some feedback on how far we want to go in this branch. (*) As long as the programs are really memory-safe, there should be no change to our current semantics. For programs that can read memory out-of-bounds, we previously could give a spurious PASS as the read had no possible rf-edges and we always required the existence of one. This has changed in this PR: the out-of-bounds reads are possible. EDIT: I added two new options to (i) toggle between zeroed/non-deterministic default values (only relevant to uninitialized memory) and (ii) to toggle between creating/not creating init events for dynamic allocations. The default values are such that they match our current behaviour. This should also make the above question obsolete. |
…dynamic allocations (both are enabled by default) - Added new test showing that we can read uninit memory.
A few questions / comments that come to my mind
At some point I thought handling out-of-memory would not work out-of-box due to our alias analysis relying on defined behavior
|
I think the alias analysis will prohibit those two from aliasing in both the new and the old version, so you will get unsound results in general. In this particular case I don't know what result you will get (possibly PASS for both, but for the wrong reasons).
Yes,
Of course, but now we have the possibility to defer the discussion/the fixing. A proper fix would likely need a lot of practical testing.
It's the
I don't think a TODO is required specifically for |
Both intrinsics seem to be handled in a similar way. The only diff I see is that
If the option is not compatible with a given model, we should at least check this and throw an exception if the combination is used. From the testing perspective, the minimum would be to fix the cases we already known are wrong. I just run all unit tests and I saw only two problems: (1) related to C11 which might be fixed changing the model as you explained, (2) a timeout on RISCV, maybe related to the
I was under the impression that this was the only remaining non-base relation that reamined there, but you are right we still have a few, e.g. |
That should be straightforward by just adding an extra field to
I don't think this is so straightforward because how would you know that the provided model is incompatible? We could
The question is if the change to the model is a real fix or if it just hides one problem but creates different one's? |
…and dynamically allocated objects. - Added zeroing-out for Calloc.
I changed C11 and reworked |
dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/MemoryAllocation.java
Show resolved
Hide resolved
dartagnan/src/main/java/com/dat3m/dartagnan/wmm/RelationNameRepository.java
Outdated
Show resolved
Hide resolved
dartagnan/src/main/java/com/dat3m/dartagnan/wmm/processing/AddInitReadHandling.java
Outdated
Show resolved
Hide resolved
Out of curiosity (no need to get this done in this PR unless it is trivial): would non-det allocs work out of the box if we simple remove the exception when the size if not constant or what else needs to be implemented to handle those? |
I think it is good to get this option enabled so it is always tested (and I'm trying to come up with an easy way to extend all our test by enabling some options so we get most options tested, maybe not in every PR, but at least in some nightly/weekly job) and we can eventually find problems |
There are two more things: |
- Updated description of what makes c11.cat different from c11-orig.cat
- Some overall cleanup in the tests
This PR attempts to address #623 .
There is some cleanup to do.
There is also a problem with removing init events from litmus tests. I need to debug this (I suppose it is related to co-last memory values?)
EDIT: It also partially addresses #136