Skip to content

Linker hangs with no output 9/10 times. #88704

Closed
@hydra

Description

@hydra

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:

  1. good.CSV, a log from when it works.

good.CSV

The output was this:

PS D:\Users\Hydra\Documents\dev\playground\rust\rtic\rtic-examples\rtic_v6\stm32f4_pwm_monitor> cargo build -j1
   Compiling stm32f4_pwm_input v0.1.0 (D:\Users\Hydra\Documents\dev\playground\rust\rtic\rtic-examples\rtic_v6\stm32f4_pwm_monitor)
    Finished dev [unoptimized + debuginfo] target(s) in 0.70s
  1. bad.CSV and 3) bad-after-killing.CSV. A trace was started and saved as bad.CSV when rust-lld.exe hanged, then a new trace was started, ctrl+c was pressed and the new trace was saved as bad-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:

...
Compiling stm32f4_pwm_input v0.1.0 (D:\Users\Hydra\Documents\dev\playground\rust\rtic\rtic-examples\rtic_v6\stm32f4_pwm_monitor)
    Building [=========================> ] 98/99: stm32f4_pwm_input(bin)

I'm compiling for an STM32F446RE CPU.

I tried with stable and with nightly

Meta

Project source: rtic-examples.zip

Nightly:

> rustup show
Default host: x86_64-pc-windows-gnu
rustup home:  D:\Users\Hydra\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-gnu
nightly-x86_64-pc-windows-gnu (default)

installed targets for active toolchain
--------------------------------------

thumbv7em-none-eabihf
x86_64-pc-windows-gnu

active toolchain
----------------

nightly-x86_64-pc-windows-gnu (default)
rustc 1.57.0-nightly (e30b68353 2021-09-05)

Stable:

> rustup show
Default host: x86_64-pc-windows-gnu
rustup home:  D:\Users\Hydra\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-gnu (default)
nightly-x86_64-pc-windows-gnu

installed targets for active toolchain
--------------------------------------

thumbv7em-none-eabihf
x86_64-pc-windows-gnu

active toolchain
----------------

stable-x86_64-pc-windows-gnu (default)
rustc 1.54.0 (a178d0322 2021-07-26)

Hardware:

Processor	AMD Ryzen 9 5950X 16-Core Processor               3.40 GHz
Installed RAM	64.0 GB

OS:

Edition	Windows 10 Pro
Version	21H1
Installed on	‎05/‎09/‎2021
OS build	19043.928
Experience	Windows Feature Experience Pack 120.2212.551.0

If you need more information/logs/etc, just tell me what commands you want me to run and what output/files to provide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.O-windows-gnuToolchain: GNU, Operating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions