-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rust + MSVC + LLD = Segfault on attempt to access TLS #76398
Comments
I would be great if someone else could reproduce this issue, to make sure it's not caused by something specific to my system. (The issue not being reproducible on nightly My [llvm]
ninja = true
targets = "X86"
experimental-targets = ""
[build]
build = "x86_64-pc-windows-msvc"
[rust]
debuginfo-level = 1
debuginfo-level-std = 2 |
Hmm, the cause of the crash seems to be
"Access violation reading location 0xFFFFFFFFFFFFFFFF" in this case is an extremely misleading exception message, because the instruction not only doesn't access that address, it doesn't even read memory. |
I forgot about this, but I actually have |
So, |
How to reproduce:
where
hello.rs
isrustc
must be built locally, the issue doesn't reproduce on nightly rustc, I don't know due to which differences.lld
can be eitherrust-lld
shipped with rustc, orlld
from a msys2 package, the issue reproduces on both, and it doesn't happen without lld."C:\msys64\home\me\hello.exe"
works for sure. UPD: The program invocation string should just be long enough, not necessarily a path.opt-level = 3
(the default), lowering the opt level to improve debugging removes the issue :( but full debuginfo can still be enabled.I'll try to step through disassembly and look what happens in more detail tomorrow.
The text was updated successfully, but these errors were encountered: