You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jswrenn opened this issue
Mar 19, 2022
· 0 comments
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.
In the presence of a global allocator that prints on
dealloc
, theio::cleanup
routine panics. This panic is surprising, because it occurs aftermain
.Example and Backtrace
(Playground)
Backtrace
Meta
At the time of writing, this bug occurs on stable (v1.59.0), beta (1.60.0-beta.5), and nightly (1.61.0-nightly 2022-03-18 1bfe40d).
Sequence of Events
io::cleanup
borrow_mut
sStdout
'sLineWriter
and drops itrust/library/std/src/io/stdio.rs
Line 624 in 9c7f6d6
LineWriter<BufWriter>
ofStdout
is deallocatedTracingSystemAllocator::dealloc
invokesprintln!
StdoutLock<'_>::write_all
rust/library/std/src/io/stdio.rs
Lines 863 to 865 in 9d1b210
borrow_mut()
theStdout
'sLineWriter
. This fails becauseio::cleanup
already holds the mutable borrow.The text was updated successfully, but these errors were encountered: