-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
STATUS_HEAP_CORRUPTION in rust-lld with a custom target on x86_64-pc-windows-gnu #115985
Comments
Disable custom_target::custom_bin_target on windows-gnu The `custom_target::custom_bin_target` test has been crashing frequently in CI on the x86_64-pc-windows-gnu target since the last LLVM 17 update. This disables the test to reduce the disruption in CI. The issue is being tracked in rust-lang/rust#115985.
Maybe this is another useful data point, but I can duplicate with the following from riscv-rt:
Sometimes it succeeds, sometimes it crashes, sometimes it hangs. I found this line in my global
Unfortunately, I don't remember where I learned this- there's probably a Zulip thread- but multithreaded lld is (was?) known to be buggy and hang a lot on Windows, and there's not been much interest in fixing it on the LLD side. So I was a bit surprised to see this issue appear after a while not needing Apparently, setting
|
Ignore changing_spec_relearns_crate_types on windows-gnu This disables the `custom_target::changing_spec_relearns_crate_types` on windows-gnu targets for the same reason as #12763. The update to LLVM 17 has started to cause lld to crash when using a custom target. cc rust-lang/rust#115985 I surveyed the rest of the testsuite, and I don't see any other tests that perform linking with custom targets.
For quite some time now, on Windows, the bootloader and program builds would randomly hang with what looked to be some kind of deadlock issue in lld. I never spent much time looking into this, but when randomly googling, I found rust-lang/rust#115985 (comment), which describes similar symptoms and a workaround, which this patch implements. Admittedly, I haven't spent _that_ much time verifying this, but it appears to work as expected after a few clean/build cycles, so I'll keep going with it for now and revert if the problem comes back again.
The following example has recently started causing rust-lld to crash on x86_64-pc-windows-gnu:
with a custom JSON target:
Building with:
This causes rust-lld to fail about 50% of the time, with errors like:
or
This is part of cargo's testsuite, which is causing issues in our CI.
I have bisected the regression to #114048 (starting nightly-2023-08-09). cc @nikic
It doesn't seem to be happening on any other platforms.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: