Skip to content

LLVM ERROR: out of memory when building a project with cargo build --target wasm32-unknown-unknown on nightly #49467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
udoprog opened this issue Mar 29, 2018 · 4 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@udoprog
Copy link
Contributor

udoprog commented Mar 29, 2018

rustc version: rustc 1.26.0-nightly (e5277c145 2018-03-28)
I have about 32G, most of which is definitely not being used.

I am able to reliably reproduce this on utf8-ranges with:

➜  utf8-ranges git:(master) cargo build --target wasm32-unknown-unknown --verbose
   Compiling utf8-ranges v1.0.0 (file:///home/udoprog/repo/utf8-ranges)
     Running `rustc --crate-name utf8_ranges src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=90af49223e8dd833 -C extra-filename=-90af49223e8dd833 --out-dir /home/udoprog/repo/utf8-ranges/target/wasm32-unknown-unknown/debug/deps --target wasm32-unknown-unknown -C incremental=/home/udoprog/repo/utf8-ranges/target/wasm32-unknown-unknown/debug/incremental -L dependency=/home/udoprog/repo/utf8-ranges/target/wasm32-unknown-unknown/debug/deps -L dependency=/home/udoprog/repo/utf8-ranges/target/debug/deps`
LLVM ERROR: out of memory
error: Could not compile `utf8-ranges`.

Caused by:
  process didn't exit successfully: `rustc --crate-name utf8_ranges src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=90af49223e8dd833 -C extra-filename=-90af49223e8dd833 --out-dir /home/udoprog/repo/utf8-ranges/target/wasm32-unknown-unknown/debug/deps --target wasm32-unknown-unknown -C incremental=/home/udoprog/repo/utf8-ranges/target/wasm32-unknown-unknown/debug/incremental -L dependency=/home/udoprog/repo/utf8-ranges/target/wasm32-unknown-unknown/debug/deps -L dependency=/home/udoprog/repo/utf8-ranges/target/debug/deps` (signal: 6, SIGABRT: process abort signal)
@pietroalbini pietroalbini added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. C-bug Category: This is a bug. labels Apr 6, 2018
@konstin
Copy link

konstin commented Apr 7, 2018

I have the same problem when trying to compile log v0.4.1, though only with wasm32-unknown-unknown.

rustc version: rustc 1.27.0-nightly (48fa6f9 2018-04-05)

@jD91mZM2
Copy link
Contributor

jD91mZM2 commented Apr 12, 2018

I just got the same problem... Except I'm on rustc 1.25...
Although release mode works for me

$ cargo build --target wasm32-unknown-unknown
   Compiling crappy-chess-minimax v0.1.0 (file:///home/jD91mZM2/Coding/Rust/crappy-chess-minimax)
   Compiling crappy-chess-minimax-wasm v0.1.0 (file:///home/jD91mZM2/Coding/Web/jD91mZM2.github.io/crappy-chess-minimax-wasm)
LLVM ERROR: out of memory
error: Could not compile `crappy-chess-minimax-wasm`.

To learn more, run the command again with --verbose.
$ cargo build --target wasm32-unknown-unknown --release
   Compiling crappy-chess-minimax v0.1.0 (file:///home/jD91mZM2/Coding/Rust/crappy-chess-minimax)
   Compiling crappy-chess-minimax-wasm v0.1.0 (file:///home/jD91mZM2/Coding/Web/jD91mZM2.github.io/crappy-chess-minimax-wasm)
    Finished release [optimized] target(s) in 4.66 secs
cargo build --target wasm32-unknown-unknown --release  7.58s user 0.08s system 146% cpu 5.226 total
$ rustc --version
rustc 1.25.0 (84203cac6 2018-03-25)

EDIT: I can reproduce it with this project

@vitiral
Copy link
Contributor

vitiral commented Apr 24, 2018

Also experiencing this related to utf8-ranges. Confirm that --release is a workaround

@alexcrichton
Copy link
Member

I believe this has since been fixed, so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants