Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any rust program run with "std::ptr=4" in RUST_LOG meets with a terrible fate #9487

Closed
MicahChalmer opened this issue Sep 25, 2013 · 2 comments · Fixed by #9490
Closed

Any rust program run with "std::ptr=4" in RUST_LOG meets with a terrible fate #9487

MicahChalmer opened this issue Sep 25, 2013 · 2 comments · Fixed by #9490

Comments

@MicahChalmer
Copy link
Contributor

The actual message you get is:

You've met with a terrible fate, haven't you?

fatal runtime error: runtime tls key not initialized

This happens when any rust program, whether it's the rust compiler itself or a program consisting of nothing but fn main() {}, is run with std::ptr=4 in RUST_LOG. It will happen with anything that activates debug logging for std::ptr--I discovered it when running with std=4.

@klutzy
Copy link
Contributor

klutzy commented Sep 25, 2013

I've also experience this when I did RUST_LOG=std. Is std::ptr the only source of fate?

@alexcrichton
Copy link
Member

@klutzy, this should fix logging in general before the runtime starts, this isn't a fix specific to std::ptr

bors added a commit that referenced this issue Sep 26, 2013
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

r? @brson
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 6, 2022
Silence [`question_mark`] in const context

fix rust-lang/rust-clippy#9175

When `const_try` is stabilised can be turned into a MSRV

changelog: Silence [`question_mark`] in const context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants