Skip to content
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

Creating Linux 32-bit debug build runs out of memory #47938

Open
maleadt opened this issue Dec 20, 2022 · 3 comments
Open

Creating Linux 32-bit debug build runs out of memory #47938

maleadt opened this issue Dec 20, 2022 · 3 comments
Labels
domain:building Build system, or building Julia or its dependencies system:32-bit Affects only 32-bit systems

Comments

@maleadt
Copy link
Member

maleadt commented Dec 20, 2022

Cross-compiling Julia with ARCH=i686 on 64-bit Linux, I'm getting an OOM while creating a debug build:

Precompilation complete. Summary:
Generation ── 174.110059 seconds 24.6289%
Execution ─── 532.824658 seconds 75.3711%
Total ─────── 706.934717 seconds
Outputting sysimage file...
LLVM ERROR: out of memory
Allocation failed

Seems like we're hitting the 4GB memory allocation limit for 32-bit processes:

(gdb) info proc stat
Virtual memory size: 4293693440

julia> Base.format_bytes(4293693440)
"3.999 GiB"
@maleadt maleadt added domain:building Build system, or building Julia or its dependencies system:32-bit Affects only 32-bit systems labels Dec 20, 2022
@gbaraldi
Copy link
Member

If you emil llvm-ir instead of the sysimg directly and use clang to generate the sysimg does it fail too?

@maleadt
Copy link
Member Author

maleadt commented Dec 20, 2022

Haven't tested that yet. I got it to work by disabling the force-enabling of the GDB event listener in case of a debug build, but I don't think that is necessary consuming a lot of memory, just pushing it over the limit.

EDIT: doesn't work consistently.

@maleadt
Copy link
Member Author

maleadt commented Dec 21, 2022

FWIW we also fail to emit LLVM IR:

Outputting sysimage file...
LLVM ERROR: out of memory
Allocation failed

[3736623] signal (6.-6): Aborted
in expression starting at none:0
__kernel_vsyscall at linux-gate.so.1 (unknown line)
unknown function (ip: 0xf7c89666)
gsignal at /usr/lib32/libc.so.6 (unknown line)
abort at /usr/lib32/libc.so.6 (unknown line)
_ZN4llvm22report_bad_alloc_errorEPKcb at /home/tim/Julia/src/julia/build/dev32/usr/bin/../lib/libLLVM-14jl.so (unknown line)
_ZN4llvm15SmallVectorBaseIjE8grow_podEPvjj at /home/tim/Julia/src/julia/build/dev32/usr/bin/../lib/libLLVM-14jl.so (unknown line)
unknown function (ip: 0xf25c673c)
unknown function (ip: 0xf3160d55)
unknown function (ip: 0xf316ed3b)
_ZN4llvm13BitcodeWriter11writeModuleERKNS_6ModuleEbPKNS_18ModuleSummaryIndexEbPSt5arrayIjLj5EE at /home/tim/Julia/src/julia/build/dev32/usr/bin/../lib/libLLVM-14jl.so (unknown line)
_ZN4llvm18WriteBitcodeToFileERKNS_6ModuleERNS_11raw_ostreamEbPKNS_18ModuleSummaryIndexEbPSt5arrayIjLj5EE at /home/tim/Julia/src/julia/build/dev32/usr/bin/../lib/libLLVM-14jl.so (unknown line)
_ZN4llvm17BitcodeWriterPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE at /home/tim/Julia/src/julia/build/dev32/usr/bin/../lib/libLLVM-14jl.so (unknown line)
run at /home/tim/Julia/src/julia/build/dev32/usr/include/llvm/IR/PassManagerInternal.h:88
_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_ at /home/tim/Julia/src/julia/build/dev32/usr/bin/../lib/libLLVM-14jl.so (unknown line)
operator() at /home/tim/Julia/src/julia/src/aotcompile.cpp:615
jl_dump_native_impl at /home/tim/Julia/src/julia/src/aotcompile.cpp:651
ijl_write_compiler_output at /home/tim/Julia/src/julia/src/precompile.c:91
ijl_atexit_hook at /home/tim/Julia/src/julia/src/init.c:258
jl_repl_entrypoint at /home/tim/Julia/src/julia/src/jlapi.c:718
jl_load_repl at /home/tim/Julia/src/julia/cli/loader_lib.c:507
main at /home/tim/Julia/src/julia/cli/loader_exe.c:58
unknown function (ip: 0xf7c1f118)
__libc_start_main at /usr/lib32/libc.so.6 (unknown line)
_start at /build/glibc/src/glibc/csu/../sysdeps/i386/start.S:111
Allocations: 114970392 (Pool: 114927501; Big: 42891); GC: 63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:building Build system, or building Julia or its dependencies system:32-bit Affects only 32-bit systems
Projects
None yet
Development

No branches or pull requests

2 participants