Skip to content

Compiler using over 20GiB memory #82406

Open
@davidspies

Description

@davidspies

I have a project where cargo build runs for about 5 minutes before spitting out:

error: could not compile `boolsatr`

Caused by:
  process didn't exit successfully: `rustc --crate-name boolsatr --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=255257b6ec403593 -C extra-filename=-255257b6ec403593 --out-dir /home/david/projects/boolsatr/target/debug/deps -C incremental=/home/david/projects/boolsatr/target/debug/incremental -L dependency=/home/david/projects/boolsatr/target/debug/deps --extern dc2=/home/david/projects/boolsatr/target/debug/deps/libdc2-2d8e237aaa1a2253.rlib --extern lazy_fields=/home/david/projects/boolsatr/target/debug/deps/liblazy_fields-448c098331ae6c36.rlib --extern rand=/home/david/projects/boolsatr/target/debug/deps/librand-e3fc23702a4e7632.rlib --extern rand_pcg=/home/david/projects/boolsatr/target/debug/deps/librand_pcg-8bccd6915bda7571.rlib` (signal: 9, SIGKILL: kill)
The terminal process "/bin/bash '-c', 'cargo build'" terminated with exit code: 101.

(cargo check runs without issue)

I assume the compiler's getting stuck in a loop somewhere and cargo is killing it after some timeout, but to produce a MWE I need some idea of which bit of code is causing it. How can I figure this out?

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (07194ffcd 2021-02-10)
binary: rustc
commit-hash: 07194ffcd25b0871ce560b9f702e52db27ac9f77
commit-date: 2021-02-10
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Adding RUST_BACKTRACE=1 doesn't change the error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-compilememIssue: Problems and improvements with respect to memory usage during compilation.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions