Skip to content

rust fails to compile/bootstrap llvm on armv7 due to llvm out of memory error (while there is plenty) #50944

Closed
@stefson

Description

@stefson

The hardware is a rpi2, it has 971mb of ram available plus 8gb of fast swap via usb hdd. I monitored the build, to be sure - at the point of the failure there is roughly 1.4gb of combined ram and swap used.

this is what happens with -j4: rust-j4-fails.log.gz

sysroot: "/var/tmp/portage/dev-lang/rust-1.26.0/work/rustc-1.26.0-src/build/armv7-unknown-linux-gnueabihf/stage0-sysroot"
libdir: "/var/tmp/portage/dev-lang/rust-1.26.0/work/rust-stage0/lib"
LLVM ERROR: out of memory
error: Could not compile `rustc`.

Caused by:
  process didn't exit successfully:

and this error, slightly different one, with -j2: rust-j2-fails.log.gz

sysroot: "/var/tmp/portage/dev-lang/rust-1.26.0/work/rustc-1.26.0-src/build/armv7-unknown-linux-gnueabihf/stage0-sysroot"
libdir: "/var/tmp/portage/dev-lang/rust-1.26.0/work/rust-stage0/lib"
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
error: Could not compile `rustc`.

Caused by:
  process didn't exit successfully:

Last version of rust I built with this machine was rust-1.23.0, with exactly the same setup and -j2, which took 13hrs. Now I'm forced to drop to -j1, which passes, but takes 27hrs.

My dmesg is clean of any errors. Have you built in a check for available ram, which I am failing here, or what is this all about?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-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