-
Notifications
You must be signed in to change notification settings - Fork 42
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
Explore Miri and Loom for hardening of lock-free code #121
Comments
I tried building a proof of concept for using loom in the lock-free area. I ran into some issues and figured i might share what I learned here.
|
@hippiehunter thanks for looking into this. Do you have experience with loom and know it's limitations? I've only some experience with Miri and it seems to work quite good in general but there are also cases where it either generates false positives or I do not understand the underlying problem. |
I don't have any practical experience with loom, it's been on my todo list for a while and this looked like a good place to start. My understanding of its limitations only comes from what I've read in their documentation/issues and random blogs. I tried running miri on the same test and it seems to be failing for FixedSizeContainer<TestType, CAPACITY> in the same place that loom fails. You might have a better understanding of this error message.
interestingly while trying to feel this error out, I tried switching to
As well as replacing the helper usages where appropriate. This made the tests pass under miri but I don't have any confidence in my ability to reason about Ordering::Relaxed so I fear I might be masking something. Anyway, sorry if I'm just generating noise. |
@hippiehunter Wow, that's awesome. I already have my full focus exactly on this lock-free thing. I have a fixed some parts of your bug-report on the branch: I will try to incorporate your suggestions and let's see if we can get this thing running. |
Right, |
Brief feature description
It's hard to get lock-free code right and one can easily introduce races. Miri and Loom can help to find those races
Detailed information
Miri and Loom can help to harden to lock-free structures. We need to check the limits on these tools and how to integrate them into the CI.
Here is a small example of a FIFO with a wrong memory ordering on line 98: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7e42e80e68c48de09c7615422eea3c00
The text was updated successfully, but these errors were encountered: