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

compile=all package compile crash #50885

Closed
NoobsEnslaver opened this issue Aug 11, 2023 · 3 comments
Closed

compile=all package compile crash #50885

NoobsEnslaver opened this issue Aug 11, 2023 · 3 comments

Comments

@NoobsEnslaver
Copy link

Env

Julia Version 1.9.2
Commit e4ee485 (2023-07-05 09:39 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 20 × 13th Gen Intel(R) Core(TM) i9-13900H
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, goldmont)
Threads: 4 on 20 virtual cores
Environment:
JULIA_NUM_THREADS = 4
JULIA_PKG_DEVDIR = /home/ne/Projects

$ uname -a
Linux ne-stealth 6.2.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 23:39:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 23.04

Problem description

Try some reasearch to find some speedup flags for my project (can't share), all was fine, untill i try build it with flag --compile=all.

using PackageCompiler
create_app(".", "my-package";
    sysimage_build_args=`--compile=all`,
    incremental=false,
    force=true,
    include_lazy_artifacts=true,
    precompile_execution_file=precompile_script,
    cpu_target="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)",)

after long build got low-level compilation crash:

⠇ [43m:34s] PackageCompiler: compiling nonincremental system image
⠸ [01h:43m:39s] PackageCompiler: compiling nonincremental system imageimmarg operand has non-immediate parameter
⢰ [01h:43m:39s] PackageCompiler: compiling nonincremental system image  %value_phi = load i8, i8 addrspace(10)* %value_phi.in, alig⣠ [01h:43m:44s] PackageCompiler: compiling nonincremental system image!189902, !alias.scope !187709, !noalias !187710
⣄ [01h:43m:44s] PackageCompiler: compiling nonincremental system image  %36 = call <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64> %35, i8 zeroext %value_phi), !dbg !1219883
in function japi3__aes_key_gen_assist_247932
LLVM ERROR: Broken function found, compilation aborted!

[31101] signal (6.-6): Aborted
in expression starting at none:0
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN4llvm18report_fatal_errorERKNS_5TwineEb at /home/ne/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/bin/../lib/julia/libLLVM-14jl.so (unknown line)
_ZN4llvm18report_fatal_errorEPKcb at /home/ne/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/bin/../lib/julia/libLLVM-14jl.so (unknown line)
.....

crash_compile_all.txt

@NoobsEnslaver
Copy link
Author

NoobsEnslaver commented Aug 11, 2023

Trying the same on 1.8.5 (juliaup), got:

⡆ [22m:43s] PackageCompiler: compiling nonincremental system imageLLVM ERROR: Cannot select: intrinsic %llvm.x86.aesni.aesenclast

signal (6): Aborted
in expression starting at none:0
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN4llvm18report_fatal_errorERKNS_5TwineEb at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm18report_fatal_errorERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm16SelectionDAGISel15CannotYetSelectEPNS_6SDNodeE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm16SelectionDAGISel16SelectCodeCommonEPNS_6SDNodeEPKhj at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN12_GLOBAL__N_115X86DAGToDAGISel6SelectEPN4llvm6SDNodeE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm16SelectionDAGISel22DoInstructionSelectionEv at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
⠇ [22m:43s] PackageCompiler: compiling nonincremental system image_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE.part.899 at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN12_GLOBAL__N_115X86DAGToDAGISel20runOnMachineFunctionERN4llvm15MachineFunctionE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/../lib/julia/libLLVM-13jl.so (unknown line)
operator() at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/aotcompile.cpp:580 [inlined]
jl_dump_native_impl at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/aotcompile.cpp:592
jl_write_compiler_output at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/precompile.c:94
ijl_atexit_hook at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/init.c:207
jl_repl_entrypoint at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/jlapi.c:720
main at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/cli/loader_exe.c:59
unknown function (ip: 0x7fd50a023a8f)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x401098)
Allocations: 1453674207 (Pool: 1453203527; Big: 470680); GC: 323
✖ [22m:43s] PackageCompiler: compiling nonincremental system image
ERROR: LoadError: failed process: Process(`/home/ne/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/bin/julia --color=yes --startup-file=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' --compile=all --sysimage=/tmp/jl_PyDOEv/sys.ji --project=/home/ne/Projects/Executor.jl --output-o=/tmp/jl_AzG3kLE5QX.o /tmp/jl_KbOBc3C7c5`, ProcessSignaled(6)) [0]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run(::Cmd)
    @ Base ./process.jl:477
  [4] (::PackageCompiler.var"#20#22")()
    @ PackageCompiler ~/.julia/packages/PackageCompiler/i90pX/ext/TerminalSpinners.jl:157
  [5] spin(f::PackageCompiler.var"#20#22", s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners ~/.julia/packages/PackageCompiler/i90pX/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ ~/.julia/packages/PackageCompiler/i90pX/ext/TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/i90pX/src/PackageCompiler.jl:128
  [8] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::String, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/i90pX/src/PackageCompiler.jl:578
  [9] create_app(package_dir::String, app_dir::String; executables::Nothing, precompile_execution_file::String, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/i90pX/src/PackageCompiler.jl:795
 [10] top-level scope
    @ ~/Projects/Executor.jl/build_binary.jl:17
 [11] include(fname::String)
    @ Base.MainInclude ./client.jl:476
 [12] top-level scope
    @ none:1

@Seelengrab
Copy link
Contributor

Seelengrab commented Aug 11, 2023

Lacking a reproducible example, this is unlikely to be able to be fixed explicitly.

@vtjnash
Copy link
Member

vtjnash commented Aug 13, 2023

Looks like a package bug with incorrect llvmcall code. The use of llvmcall is outside of the safety guarantees of julia normally can provide with the intrinsics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants