rust-lang / rust-lang/rust

rustc uses a constantly increasing amount of memory up to OS crash or OOM kill

Open
#128,365 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug fixed-by-next-solver I-crash T-types
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Clone the bug branch of webgraph-rs and run a check:

git clone git@github.com:vigna/webgraph-rs
cd webgraph-rs
git checkout bug
cargo c

On MacOs 14.5 (M1), nixos 23.11, and Fedora 38 the compilation process stops at this message:

    Building [=======================> ] 207/209: webgraph

At this point, rustc uses a constantly increasing amount of memory. The result is an OS crash in MacOS, and OOM-kill on Linux.

The problem appears both in stable and nightly.

rustc --version --verbose:

rustc 1.82.0-nightly (2cbbe8b8b 2024-07-28)
binary: rustc
commit-hash: 2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b
commit-date: 2024-07-28
host: aarch64-apple-darwin
release: 1.82.0-nightly
LLVM version: 18.1.7

rustc 1.80.0 (051478957 2024-07-21)
binary: rustc
commit-hash: 051478957371ee0084a7c0913941d2a8c4757bb9
commit-date: 2024-07-21
host: aarch64-apple-darwin
release: 1.80.0
LLVM version: 18.1.7

The same setup works without problems on Arch Linux.

UPDATE: the first post claimed mistakenly that the check was working on Fedora 38.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the vigna/webgraph-rs bug branch and run the reported cargo c command to reproduce the memory growth near the end of compilation. Compare the stable and nightly rustc versions and the reported macOS, NixOS, Fedora, and Arch environments. Done means identifying the rustc compilation path responsible for the unbounded memory use and validating a fix without the OS crash or OOM kill.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.