-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't die in try_unsafe_borrow if tls isn't ready
If there's no TLS key just yet, then there's nothing to unsafely borrow, so continue returning None. This prevents causing the runtime to abort itself when logging before the runtime is fully initialized. Closes #9487
- Loading branch information
1 parent
7535479
commit 324418f
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// exec-env:RUST_LOG=std::ptr | ||
// xfail-fast this would cause everything to print forever on windows... | ||
|
||
// In issue #9487, it was realized that std::ptr was invoking the logging | ||
// infrastructure, and when std::ptr was used during runtime initialization, | ||
// this caused some serious problems. The problems have since been fixed, but | ||
// this test will trigger "output during runtime initialization" to make sure | ||
// that the bug isn't re-introduced. | ||
|
||
fn main() {} |
324418f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from cmr
at alexcrichton@324418f
324418f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging alexcrichton/rust/issue-9487 = 324418f into auto
324418f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alexcrichton/rust/issue-9487 = 324418f merged ok, testing candidate = a268a1c
324418f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1695
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1698
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/804
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/804
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1713
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/804
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/804
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1713
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/804
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/805
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/885
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1698
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/804
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/805
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1482
324418f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = a268a1c