about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPetros Angelatos <petrosagg@gmail.com>2025-04-08 22:37:25 +0300
committerPetros Angelatos <petrosagg@gmail.com>2025-04-11 15:33:09 +0300
commitb9e2ac5c7b1d6bb3b6f5fdfe0819eaf7e95bf7ff (patch)
tree3d19b5912895726f087c1ae5a2462714ba288345 /src
parent9eb6a5446a4e35f48ad22a5b70a74a8badb9fa0d (diff)
downloadrust-b9e2ac5c7b1d6bb3b6f5fdfe0819eaf7e95bf7ff.tar.gz
rust-b9e2ac5c7b1d6bb3b6f5fdfe0819eaf7e95bf7ff.zip
sync::mpsc: prevent double free on `Drop`
This PR is fixing a regression introduced by #121646 that can lead to a
double free when dropping the channel.

The details of the bug can be found in the corresponding crossbeam PR
https://github.com/crossbeam-rs/crossbeam/pull/1187

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass/issues/issue-139553.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass/issues/issue-139553.rs b/src/tools/miri/tests/pass/issues/issue-139553.rs
index 97cb9e1a805..119d589d1ea 100644
--- a/src/tools/miri/tests/pass/issues/issue-139553.rs
+++ b/src/tools/miri/tests/pass/issues/issue-139553.rs
@@ -38,7 +38,7 @@ fn main() {
     //    call returns the channel state has tail.index = head.index, tail.block = NULL, and
     //    head.block != NULL.
     t1.join().unwrap();
-    // 6. The last sender (s1) is dropped here which also attempts to cleanup any data in the
+    // 6. The last sender (s2) is dropped here which also attempts to cleanup any data in the
     //    channel. It observes `tail.index = head.index` and so it doesn't attempt to cleanup any
     //    messages but it also observes that `head.block != NULL` and attempts to deallocate it.
     //    This is however already deallocated by `discard_all_messages`, leading to a double free.