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

Two minor Miri issues with unit tests #251

Closed
m-ou-se opened this issue Oct 3, 2020 · 1 comment · Fixed by #252
Closed

Two minor Miri issues with unit tests #251

m-ou-se opened this issue Oct 3, 2020 · 1 comment · Fixed by #252

Comments

@m-ou-se
Copy link
Contributor

m-ou-se commented Oct 3, 2020

I was running parking_lot's tests with (a futex-aware version of) Miri, and ran into two minor unit test 'bugs' that are not really bugs. I figured it might be good to have a quick look at them anyway:

  1. test_condvar_requeue gets stuck on a single-core system with a non-preemptive scheduler, such as Miri, because the spawned thread never gets the chance to do anything. I'm assuming this is not really a normal use case for parking_lot, but adding a simple std::thread::yield_now() in the loop fixes this.

  2. test_rwlock_recursive leaks a thread: it spawns a thread that's blocked forever and outlives the main thread. That's not really a problem, because exiting the main thread exits the whole process, but simply dropping the locks and joining the thread at the end of the test would fix this leak.

I'm guessing both are probably fine and working as intended, so feel free to just close this issue. :) If you think it's worth 'fixing' these, let me know and I'll send a PR.

@Amanieu
Copy link
Owner

Amanieu commented Oct 3, 2020

We run Miri on CI so this will break when Miri is updated in the future. We might as well fix these issues now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants