-
Notifications
You must be signed in to change notification settings - Fork 13.3k
STATUS_HEAP_CORRUPTION in rust-lld with a custom target on x86_64-pc-windows-gnu #115985
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
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.
This shouldn't happen since GCC update in #119229 |
Answering myself: yes, it still fails on CI. |
Has also been crashing on rust-lang/rust windows-gnu CI quite frequently, cf. #137938 |
Yeah, I meant Rust's CI. |
Looking back through the logs it does seem we are indeed hitting this more often in recent days: February (1): March (3):
April (10):
|
Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test. try-job: x86_64-mingw-1
Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test.
Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test.
Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test.
Rollup merge of rust-lang#140396 - ChrisDenton:gnu-threads, r=jieyouxu Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test.
Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang/rust#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test.
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: