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

fix: port fix discard all message on receiver droped #1121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

driftluo
Copy link

fix #1102

I think this fix should be done on the crossbeam channel

@driftluo driftluo force-pushed the port-fix-discard-all-message branch from 331102b to bbff85d Compare June 26, 2024 03:11
@taiki-e
Copy link
Member

taiki-e commented Dec 8, 2024

@taiki-e taiki-e added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author label Dec 8, 2024
@driftluo driftluo force-pushed the port-fix-discard-all-message branch from bb15d37 to 65e7ecf Compare December 25, 2024 07:12
@driftluo
Copy link
Author

driftluo commented Dec 25, 2024

Thanks for the PR. It seems that Miri and sanitizer reports memory leak: https://github.com/crossbeam-rs/crossbeam/actions/runs/12221429705/job/34090460906?pr=1121#step:4:168 https://github.com/crossbeam-rs/crossbeam/actions/runs/12221429705/job/34090462020?pr=1121#step:5:186

The memory leak reported by miri is the panic_on_drop test case, which seems to be the expected behavior, because https://github.com/rust-lang/rust/blob/master/library/std/src/sync/mpmc/array.rs#L487-L489 The comment here indicates that if there is a panic, a memory leak will occur

I think std seems to assume that this behavior is expected. Do we need to make some extra efforts for this?

If necessary, should panic::catch_unwind be used to catch the assume_init_drop? can't do this

@ryoqun
Copy link
Contributor

ryoqun commented Jan 23, 2025

@taiki-e hi, is there some timeline for merging this bug-fix pr? is there some blocker? my pr #1114 is touching same area of code and i'd rather to rework my pr once after this pr landed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crossbeam-channel S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author
Development

Successfully merging this pull request may close these issues.

Potential deadlock and resource leak when Receiver is dropped in crossbeam_channel's bounded channel
3 participants