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

Race condition when JoinHandle is dropped concurrently #292

Closed
NKID00 opened this issue Aug 24, 2024 · 0 comments · Fixed by #293
Closed

Race condition when JoinHandle is dropped concurrently #292

NKID00 opened this issue Aug 24, 2024 · 0 comments · Fixed by #293

Comments

@NKID00
Copy link
Contributor

NKID00 commented Aug 24, 2024

Version

latest commit on branch master (e7a6dc1)

Platform

Linux 6.6

Description

There is a non-atomic compare-and-swap operation in monoio::task::state::State::drop_join_handle_fast, which can lead to race condition and use-after-free when JoinHandle is dropped concurrently.

Proof-of-concept that can cause segmentation fault.

This issue originates from my attempt to integrate monoio into OpenDAL (apache/opendal#4944), where a ci fails at random.

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.

1 participant