-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
By writing two short strings with separate write! invocations we can trigger an infinite process
that will continue writing the start of the second string until the process is killed or the disk is full.
println!("starting ...");
let mut file = OpenOptions::new()
.append(true)
// .write(true) // also happens with write, write+truncate
// .truncate(true)
.create(true)
.open(filename).await?;
write!(
&mut file,
"{}",
a,
).await?;
write!(
&mut file,
"{}",
b,
).await?;
println!("done.");
As long as the second string b
is shorter than the first one (a
) we can't reproduce the problem, with a longer than 8 bytes we can reliably reproduce the problem.
Full reproduction in this gist: https://gist.github.com/hn3000/100460d1e239f22bf3862f1a8f8cfd92
(Also, I am not sure how to write a failing unit test because the error case does not terminate.)
Metadata
Metadata
Assignees
Labels
No labels