Skip to content

fails to compile rustc_middle for i686-pc-windows-gnullvm #131786

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

Open
ognevny opened this issue Oct 16, 2024 · 8 comments
Open

fails to compile rustc_middle for i686-pc-windows-gnullvm #131786

ognevny opened this issue Oct 16, 2024 · 8 comments
Labels
C-bug Category: This is a bug. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. O-windows-gnu Toolchain: GNU, Operating system: Windows

Comments

@ognevny
Copy link
Contributor

ognevny commented Oct 16, 2024

While updating compiler to 1.82.0 version (host with stable 1.81.0 toolchain used) for i686-pc-windows-gnullvm target it failed to compile rustc_middle due to memory overflow

I expected to see this happen: successful compilation

Instead, this happened:

rustc-LLVM ERROR: out of memory
  Allocation failed
  error: could not compile `rustc_middle` (lib)
  
  Caused by:
    process didn't exit successfully: `C:\_\B\src\CLANG32\build\bootstrap\debug\rustc 'C:\_\B\src\CLANG32\build\bootstrap\debug\rustc' --crate-name rustc_middle --edition=2021 'compiler\rustc_middle\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("rustc_use_parallel_compiler"))' -C metadata=9643f6209a9e95be -C extra-filename=-9643f6209a9e95be --out-dir 'C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps' --target i686-pc-windows-gnullvm -C linker=clang -L 'dependency=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps' -L 'dependency=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\release\deps' --extern 'bitflags=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libbitflags-e8bafa1b1abb9158.rmeta' --extern 'derive_where=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\release\deps\derive_where-ac65012f402ea378.dll' --extern 'either=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libeither-c8a0485d80424a37.rmeta' --extern 'field_offset=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libfield_offset-abfbd9d4dbcde2ec.rmeta' --extern 'gsgdt=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libgsgdt-fd78454f97ba6489.rmeta' --extern 'polonius_engine=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libpolonius_engine-592f3791bab74b51.rmeta' --extern 'rustc_apfloat=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_apfloat-5cce731c1f9a87e4.rmeta' --extern 'rustc_arena=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_arena-b0346a1b00db53d6.rmeta' --extern 'rustc_ast=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_ast-9faf6254b22115a9.rmeta' --extern 'rustc_ast_ir=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_ast_ir-7eeb7abb8ca47ec0.rmeta' --extern 'rustc_attr=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_attr-4af0fc53c61c3031.rmeta' --extern 'rustc_data_structures=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_data_structures-9cd3caba91c3f12f.rmeta' --extern 'rustc_error_messages=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_error_messages-47a7ff3634813ccd.rmeta' --extern 'rustc_errors=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_errors-d05a208674e0cf0e.rmeta' --extern 'rustc_feature=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_feature-4fe2abb0a0af4b79.rmeta' --extern 'rustc_fluent_macro=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\release\deps\rustc_fluent_macro-ec424b422ceef2e1.dll' --extern 'rustc_graphviz=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_graphviz-95a794a50077dc13.rmeta' --extern 'rustc_hir=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_hir-59691c3e2392d752.rmeta' --extern 'rustc_hir_pretty=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_hir_pretty-a9e7bd3273381e4c.rmeta' --extern 'rustc_index=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_index-91e7d150c7534c94.rmeta' --extern 'rustc_macros=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\release\deps\rustc_macros-5e4d225b7cb701b2.dll' --extern 'rustc_query_system=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_query_system-fec92489315ab7b8.rmeta' --extern 'rustc_serialize=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_serialize-34199664de1bb70a.rmeta' --extern 'rustc_session=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_session-33cb977d4093c677.rmeta' --extern 'rustc_span=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_span-eb101559291aef79.rmeta' --extern 'rustc_target=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_target-8409e41193a219e5.rmeta' --extern 'rustc_type_ir=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\librustc_type_ir-8260da4ae97fe11b.rmeta' --extern 'smallvec=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libsmallvec-90d4b093ace0bbf5.rmeta' --extern 'thin_vec=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libthin_vec-0687f84f6c803f01.rmeta' --extern 'tracing=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\deps\libtracing-9171b932e6461f53.rmeta' -Cforce-frame-pointers=yes --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(parallel_compiler)' -Zmacro-backtrace -Csplit-debuginfo=packed '-Wrustc::internal' -Wkeyword_idents_2024 -Wunsafe_op_in_unsafe_fn -Cforce-frame-pointers=true -Zon-broken-pipe=kill -Z binary-dep-depinfo -L 'native=C:\_\B\src\rustc-1.82.0-src\vendor\windows_i686_gnullvm-0.52.6\lib' -L 'native=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\build\stacker-bcb660e52798211c\out' -L 'native=C:\_\B\src\CLANG32\build\i686-pc-windows-gnullvm\stage1-rustc\i686-pc-windows-gnullvm\release\build\psm-19992ed744bbd2fd\out'` (exit code: 0xc000001d, STATUS_ILLEGAL_INSTRUCTION)

Meta

rustc --version --verbose:

rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: i686-pc-windows-gnullvm
release: 1.81.0
LLVM version: 18.1.8
Backtrace

No backtrace provided for build

@ognevny ognevny added the C-bug Category: This is a bug. label Oct 16, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 16, 2024
@ognevny ognevny changed the title fails to compile rustc_middle for i686-pc-windows-gnullvm` fails to compile rustc_middle for i686-pc-windows-gnullvm Oct 16, 2024
@lolbinarycat lolbinarycat added the I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. label Oct 16, 2024
@lolbinarycat
Copy link
Contributor

how much ram does your PC have? rustc is typically pretty reasonable with memory usage, but you will get this sort of error if your device is underspecced.

@lolbinarycat lolbinarycat added the O-windows-gnu Toolchain: GNU, Operating system: Windows label Oct 16, 2024
@ognevny
Copy link
Contributor Author

ognevny commented Oct 16, 2024

that's actually not my machine, but GitHub hosted. acording to specs it has 16 GB of RAM, that should be enough for compilation

@lolbinarycat
Copy link
Contributor

hmm, yeah, in my experience rustc can compile itself with 1-2GiB of ram..

i wonder if this could be an llvm memory leak? if you could try compiling that crate with cranelift, we could test this hypothesis... although that's probably easier said than done...

@ognevny
Copy link
Contributor Author

ognevny commented Oct 16, 2024

oh, as a Rust package maintainer in MSYS2 I don't have much motivation to work with 32-bit. we started to dropping it, so such error is just a good reason to drop 32-bit compiler downstream (just use 64-bit compiler...)

anyone welcome for help, maybe there is an enthusiast who wants to make it work...

@mati865
Copy link
Member

mati865 commented Oct 16, 2024

As I said in msys2/MINGW-packages#22205 (comment) I doubt amount of the memory is the problem here. I believe the problem here is mmap that LLD/LLVM does and 32bit address space is just insufficient.
It was a problem in the past when building LLVM, so codegen changes probably unearthed it with Rust: mstorsjo/llvm-mingw#151

@workingjubilee
Copy link
Member

hm.

@ognevny can you try -j2 or -j1?

@ognevny
Copy link
Contributor Author

ognevny commented Oct 17, 2024

@ognevny can you try -j2 or -j1?

it doesn't help :(

@workingjubilee
Copy link
Member

workingjubilee commented Oct 18, 2024

weird! sorry about this.

@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. O-windows-gnu Toolchain: GNU, Operating system: Windows
Projects
None yet
Development

No branches or pull requests

6 participants