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

Add tests for pthread primitives inducing synchronization #2271

Closed
RalfJung opened this issue Jun 26, 2022 · 1 comment · Fixed by #3304
Closed

Add tests for pthread primitives inducing synchronization #2271

RalfJung opened this issue Jun 26, 2022 · 1 comment · Fixed by #3304
Labels
A-concurrency Area: affects our concurrency (multi-thread) support A-data-race Area: data race detector A-tests Area: affects our test suite or CI C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@RalfJung
Copy link
Member

Basically, something similar to #2270 for pthread mutex, rwlock, and condvar (but we can use deterministic scheduling by disabling preemption). Commenting out any of the validate_lock_release, validate_lock_release_shared, validate_lock_acquire in src/sync.rs should give a data race error in some test, and that does not currently happen, at least not for rwlock and condvar -- I assume that's because the standard library has some atomic variables on its own here that induce extra synchronization. So we probably need tests that directly talk to these APIs. (Also note that the pthread primitives are not even used on Linux any more, only on macOS.)

@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-tests Area: affects our test suite or CI E-good-first-issue A good way to start contributing, mentoring is available A-concurrency Area: affects our concurrency (multi-thread) support A-data-race Area: data race detector labels Jun 26, 2022
@RalfJung RalfJung changed the title Add tests for pthread primitives inducting synchronization Add tests for pthread primitives inducing synchronization Jul 25, 2022
@RalfJung RalfJung added E-medium and removed E-good-first-issue A good way to start contributing, mentoring is available labels Aug 22, 2022
@RalfJung
Copy link
Member Author

#3296 does this for mutex and rwlock. It is still pending for other pthread_cond.

@bors bors closed this as completed in 3589059 Feb 17, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: affects our concurrency (multi-thread) support A-data-race Area: data race detector A-tests Area: affects our test suite or CI C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant