Skip to content

rust-lld corruption with Ctrl+C #128860

@Axel-Reactor

Description

@Axel-Reactor

When interrupting linking with rust-lld.exe it sometimes corrupts the target and the only recovery is cargo clean.
I'm getting tones of errors like this if I try cargo build again after:
= note: rust-lld: error: undefined symbol: anon.8ff5a01038e5b419b80b5d238bffa21c.22.llvm.13741956020784447919
rust-lld: error: undefined symbol: xx::xxxx::xxxx::GLOBAL::h22b2a472d7972d2f (.llvm.10192556018238492745)
rust-lld: error: undefined symbol: core::hint::unreachable_unchecked::precondition_check::h644ec5c1a75164f9 (.llvm.10192556018238492745)

This isn't a good UX. Ctrl+C should be robust and not leave things in a bad state.

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Aug 9, 2024
changed the title [-]rust-lld corruption with Cltr+C[/-] [+]rust-lld corruption with Ctrl+C[/+] on Aug 9, 2024
bjorn3

bjorn3 commented on Aug 9, 2024

@bjorn3
Member

Duplicate of #81280. Recovering from this can also be done by clearing the incr comp cache using rm -r target/debug/incremental. The incr comp cache should only be finalized after it is fully written, but this bug seems to indicate that finalization of the incr comp cache is done just a bit too early.

added
A-incr-compArea: Incremental compilation
A-linkageArea: linking into static, shared libraries and binaries
on Aug 9, 2024
workingjubilee

workingjubilee commented on Aug 10, 2024

@workingjubilee
Member

closing as duplicate.

removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationA-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bjorn3@jieyouxu@workingjubilee@rustbot@Axel-Reactor

        Issue actions

          rust-lld corruption with Ctrl+C · Issue #128860 · rust-lang/rust