-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Memory leak in LocalWaker
#122180
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Mar 8, 2024
I guess this is not too surprising... #[stable(feature = "futures_api", since = "1.36.0")]
impl Drop for Waker {
#[inline]
fn drop(&mut self) {
// SAFETY: This is safe because `Waker::from_raw` is the only way
// to initialize `drop` and `data` requiring the user to acknowledge
// that the contract of `RawWaker` is upheld.
unsafe { (self.waker.vtable.drop)(self.waker.data) }
}
} but |
Noratrieb
added
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
I-memleak
Issue: Runtime memory leak without `mem::forget`.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Mar 8, 2024
Oh, that's may bad. I assumed that RawWaker handled ownership. I can push a PR today in the evening. |
This leads to a miri-test-libstd failure every day, would be nice to get a fix soon. :) |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 9, 2024
…=Nilstrieb fix: LocalWaker memory leak and some stability attributes fixes rust-lang#122180.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 10, 2024
…=Nilstrieb fix: LocalWaker memory leak and some stability attributes fixes rust-lang#122180.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 10, 2024
…=Nilstrieb fix: LocalWaker memory leak and some stability attributes fixes rust-lang#122180.
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Mar 10, 2024
…=Nilstrieb fix: LocalWaker memory leak and some stability attributes fixes rust-lang#122180.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 10, 2024
Rollup merge of rust-lang#122244 - tvallotton:local_waker_leak_fix, r=Nilstrieb fix: LocalWaker memory leak and some stability attributes fixes rust-lang#122180.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code leaks memory:
Miri error:
The equivalent code with
Waker
is fine, so I think this is a bug.Cc @dtolnay @tvallotton
The text was updated successfully, but these errors were encountered: