about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-21 13:06:38 +0100
committerGitHub <noreply@github.com>2020-03-21 13:06:38 +0100
commit276b54e9c930c4ff015e1958ad1c640deffd29b2 (patch)
tree4c1eb2b3b0d3e5b53b4a4e1ada7042001f5ed089 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent8deeac153fcca97f6a5185b322f8d65d59fab5f4 (diff)
parent5edaa7eefd76d4996dcf85dfc1c1a3f737087257 (diff)
downloadrust-276b54e9c930c4ff015e1958ad1c640deffd29b2.tar.gz
rust-276b54e9c930c4ff015e1958ad1c640deffd29b2.zip
Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfackler
Fix abort-on-eprintln during process shutdown

This commit fixes an issue where if `eprintln!` is used in a TLS
destructor it can accidentally cause the process to abort. TLS
destructors are executed after `main` returns on the main thread, and at
this point we've also deinitialized global `Lazy` values like those
which store the `Stderr` and `Stdout` internals. This means that despite
handling TLS not being accessible in `eprintln!`, we will fail due to
not being able to call `stderr()`. This means that we'll double-panic
quickly because panicking also attempt to write to stderr.

The fix here is to reimplement the global stderr handle to avoid the
need for destruction. This avoids the need for `Lazy` as well as the
hidden panic inside of the `stderr` function.

Overall this should improve the robustness of printing errors and/or
panics in weird situations, since the `stderr` accessor should be
infallible in more situations.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions