miri
miri copied to clipboard
Make it easier to debug weak memory emulation induced bugs
When our weak memory emulation finds a bug, it can be quite hard to figure out the details. Using -Zmiri-disable-weak-memory-emulation is useful to confirm that it is indeed a weak memory bug, but what then?
One thing we could do is offer a flag to print a diagnostic every time an outdated value is returned from a load. One of them must be the cause of the bug. @cbeuw has some draft of that at https://github.com/cbeuw/miri/commit/64d738cb00dbcfbe9cab29c77717f5af62c83ada.
Another idea I had is to have some way that pins a load to the latest value when running on Miri. This would allow the user to debug through elimination and pinpoint the minimal set of outdated loads that triggers a bug