-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Linker hangs with no output 9/10 times. #88704
Comments
Could you obtain stacktraces for the hanged process? I though we fixed all hangs like that in LLD 13 but maybe Rust's ancient GCC is even more broken than more recent versions. |
This comment has been minimized.
This comment has been minimized.
@mati865 Sure, but how do I obtain a stacktrace for the hung process? |
The easiest way is to attach debugger to the process (this sometimes fixes the hang so you cannot get the trace) or create dump by right clicking on the process in task manager and load it into the debugger.
Indeed it looks like bug in old GCC or mingw-w64 used by Rust to build this target. |
@mati865 Awesome! Thanks ever so much for digging into it, was glad you were able to replicate the issue. Keep us all posted. I and my colleagues will be so happy when this is fixed. Is it possible to upgrade the tools used by rust to workaround this issue? |
Unfortunately there is no easy fix, last time I tried to upgrade the tools it couldn't make it on the CI: #51989 I don't know how |
Can you reach out the mingw developers to see if they can provide an updated build? How would I go about using |
I found the documentation for changing the linker: https://doc.rust-lang.org/rustc/codegen-options/index.html#linker-flavor I will give that a try as time permits and report back. |
This is still an issue, I changed my linker to the gnu-ld linker for other reasons (map file generation, printing memory usage stats, etc) and forgot about this issue. Today when working on a new project I encountered the error again. I'm using a much newer version of rust since I opened this issue.
Has there been any update to the tools? what's the current status of this? are there any other workarounds? |
Any update on this? I find it a bit crazy that such a fundamental issue, i.e. it randomly fails 9/10 times, hasn't been prioritized over other changes. |
This still happens on a very recent nightly:
example, frustrating, user experience:
|
83: Fix parser error on `undef` type in argument list of tail call. r=japaric a=hydra LLVM output was generated by rustc nightly-2022-11-16. I ran into an issue with the parser in the tool and found and 'fixed' the issue. Note: I wasn't able to run the integration tests, they ALL fail on my machine, but I don't think the code change I made is the cause. I have an underlying issue with the rustc linker failing to link targets due to an bug that is fixed, but still unreleased. (See rust-lang/rust#88704) The specific line that fails to parse is line 3 in the example. ``` tail call void %1(i32 noundef 0, i32 undef) #39, !dbg !104902 ``` Specifically, it's missing handling for `undef` after the `i32` type. Co-authored-by: Dominic Clifton <me@dominicclifton.name>
The MinGW version had been updated, does this issue still happen with recent nightly? |
I'll check with the latest nightly and report back ASAP. |
Hi, Sorry for not getting back to you sooner. I confirm this doesn't happen with the nightly from 2023-06-17, installed via rustup. To verify I ran Happy days! Do we know exactly which nightly and/or or stable version this issue issue was fixed in so that others coming back to this issue can ensure they are on known-working fixed version? |
It was fixed by #100178 because this was GCC/winpthreads bug. |
ok, closing since it seems to be fixed now. |
When building various example projects, I find that the rust-lld.exe linker will just stall instead of creating the .elf file. When it works, it takes about 0.4seconds, most of the time it fails and you have to ctrl+c the command and retry, it's obviously ridiculously frustrating, especially during a pair programming session.
To make sure there was nothing odd on my PC that might be affecting it, I did a complete fresh install of the OS, rust and the tools, yet the same thing still happens.
I was able to record detailed logs using ProcessMonitor of the failure. Attached to this issue are 3 files:
good.CSV
, a log from when it works.good.CSV
The output was this:
bad.CSV
and 3)bad-after-killing.CSV
. A trace was started and saved asbad.CSV
when rust-lld.exe hanged, then a new trace was started, ctrl+c was pressed and the new trace was saved asbad-after-killing.CSV
so that you can see what happens before and after ctrl+c was pressed.bad.CSV
bad-after-killing.CSV
The output, when it fails is this:
I'm compiling for an STM32F446RE CPU.
I tried with
stable
and withnightly
Meta
Project source: rtic-examples.zip
Nightly:
Stable:
Hardware:
OS:
If you need more information/logs/etc, just tell me what commands you want me to run and what output/files to provide.
The text was updated successfully, but these errors were encountered: