Skip to content

Memory usage regression in #49045 #50073

Closed
@ishitatsuyuki

Description

@ishitatsuyuki

On the CircleCI Docker remote machine which has 2 cores and 8G memory, I'm no longer able to compile rustc. This error consistently occurs in stage1. This was bisected to #49045.

It's likely that overcommit is disabled and vfork() resulted in rejection, although I wasn't able to obtain any further traces about this.

The possible cause may be:

  • Simply that the memory requirement increased.
  • We're leaking memory / freeing too late. rustc shouldn't need much memory at the stage it would invoke linker.

cc @Zoxc

Compiling syntax_ext v0.0.0 (file:///home/user/rust/src/libsyntax_ext)
error: could not exec the linker `cc`
  |
  = note: Cannot allocate memory (os error 12)
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-d162f1a13c8ef190.rustc0-20c527915fa1ef6087fc31cbe68d7f2f.rs.rcgu.o" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-d162f1a13c8ef190.rustc1-20c527915fa1ef6087fc31cbe68d7f2f.rs.rcgu.o" "-o" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-d162f1a13c8ef190.so" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-d162f1a13c8ef190.crate.metadata.rcgu.o" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-d162f1a13c8ef190.crate.allocator.rcgu.o" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-340c7157c7761734/out/.libs" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-bf90fe466cd4a9fa/out" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "test-902559d4a0cc83d5" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "term-36880752958d2c6f" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/libflate2-75c9cc82bb755b48.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/libminiz_sys-3d17c9d844239fa3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/libbacktrace-786cb2b6a87aed68.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/libbacktrace_sys-60501d5f3e4fb8f6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/librustc_demangle-ffb675b42151a6f8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/libbyteorder-f652c706c62d3d96.rlib" "-Wl,--no-whole-archive" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-Wl,-Bdynamic" "-l" "proc_macro-50a63500c1ea1d55" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/libjobserver-5189829dca651532.rlib" "-Wl,--no-whole-archive" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-Wl,-Bdynamic" "-l" "rustc_const_math-b2c60d57ea59ca96" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_back-a514fb34c8a54105" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "syntax-915450af937848b5" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_errors-d6070e053e9037b0" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "syntax_pos-e425942a0298756c" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_data_structures-9ce9b8b9893796c6" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "serialize-b63c42e100577192" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_cratesio_shim-45d3d77a26fe81d5" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.GuL2KuWri9zo/liblazy_static-d0629a75f2783580.rlib" "-Wl,--no-whole-archive" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-Wl,-Bdynamic" "-l" "graphviz-06bb7008d45cdff0" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "fmt_macros-7fa0522df5af949a" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "arena-657cf6916cd0a947" "-Wl,--start-group" "-L" "/home/user/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "std-0feb32955e89b888" "-Wl,--end-group" "-Wl,-Bstatic" "/tmp/rustc.GuL2KuWri9zo/libcompiler_builtins-825ad861341732a3.rlib" "-Wl,-Bdynamic" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" "-shared" "-Wl,-rpath,$ORIGIN/../lib"

error: aborting due to previous error

error: Could not compile `rustc`.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions