Skip to content

Commit c00de99

Browse files
authored
Merge pull request #58 from RalfJung/threadleak
disable the thread-leaking test instead of allowing leaks
2 parents c4eead8 + bf1c695 commit c00de99

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

ci-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ std)
7070
2>&1 | ts -i '%.s '
7171
echo "::endgroup::"
7272
done
73-
# "sleep" has a thread leak that we have to ignore
73+
# Test the remaining modules only on Linux.
7474
echo "::group::Testing remaining std (all except for $SKIP, ignore leaks)"
75-
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-ignore-leaks -Zmiri-disable-isolation" \
75+
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-disable-isolation" \
7676
./run-test.sh std --lib --tests \
7777
-- $(for M in $CORE; do echo "--skip $M "; done) $(for M in $SKIP; do echo "--skip $M "; done) \
7878
2>&1 | ts -i '%.s '

rust-src.diff

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ index 638f343fb24..0561f49c967 100644
1111
#![feature(btree_extract_if)]
1212
#![feature(iter_next_chunk)]
1313
#![feature(repr_simd)]
14+
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
15+
index 4dea27221b7..6ae52cc7827 100644
16+
--- a/library/alloc/src/sync.rs
17+
+++ b/library/alloc/src/sync.rs
18+
@@ -1062,7 +1062,9 @@ pub fn try_unwrap(this: Self) -> Result<T, Self> {
19+
///
20+
/// // Create a long list and clone it
21+
/// let mut x = LinkedList::new();
22+
- /// for i in 0..100000 {
23+
+ /// let size = 100000;
24+
+ /// # let size = if cfg!(miri) { 100 } else { size };
25+
+ /// for i in 0..size {
26+
/// x.push(i); // Adds i to the front of x
27+
/// }
28+
/// let y = x.clone();
1429
diff --git a/library/core/benches/lib.rs b/library/core/benches/lib.rs
1530
index 4d14b930e41..32d15c386cb 100644
1631
--- a/library/core/benches/lib.rs
@@ -55,3 +70,17 @@ index 27f3e8a9b96..a80f24fcb19 100644
5570

5671
use std::fs::File;
5772
use std::io::{Read, Write};
73+
diff --git a/library/std/tests/thread.rs b/library/std/tests/thread.rs
74+
index 4ce81f2846e..79a981d0b0d 100644
75+
--- a/library/std/tests/thread.rs
76+
+++ b/library/std/tests/thread.rs
77+
@@ -5,7 +5,8 @@
78+
79+
#[test]
80+
#[cfg_attr(target_os = "emscripten", ignore)]
81+
-fn sleep() {
82+
+#[cfg_attr(miri, ignore)] // Miri does not like the thread leak
83+
+fn sleep_very_long() {
84+
let finished = Arc::new(Mutex::new(false));
85+
let t_finished = finished.clone();
86+
thread::spawn(move || {

0 commit comments

Comments
 (0)