tshort / StaticCompiler.jl

Compiles Julia code to a standalone library (experimental)
Other
498 stars 30 forks source link

segfault with julia master #77

Closed JeffBezanson closed 2 years ago

JeffBezanson commented 2 years ago

Might be an issue with julia itself or GPUCompiler, but will post here for now:

julia> compile(fib, Tuple{Int}, "fib")

signal (11): Segmentation fault
in expression starting at REPL[4]:1
__atomic_add at /usr/include/c++/11/ext/atomicity.h:71 [inlined]
__atomic_add_dispatch at /usr/include/c++/11/ext/atomicity.h:111 [inlined]
_M_add_ref_copy at /usr/include/c++/11/bits/shared_ptr_base.h:148 [inlined]
__shared_count at /usr/include/c++/11/bits/shared_ptr_base.h:712 [inlined]
__shared_ptr at /usr/include/c++/11/bits/shared_ptr_base.h:1152 [inlined]
shared_ptr at /usr/include/c++/11/bits/shared_ptr.h:150 [inlined]
ThreadSafeContext at /home/jeff/src/julia/usr/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:29 [inlined]
getContext at /home/jeff/src/julia/usr/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:153 [inlined]
jl_create_native_impl at /home/jeff/src/julia/src/aotcompile.cpp:268
compile_method_instance at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/jlgen.jl:361
macro expansion at /home/jeff/.julia/packages/TimerOutputs/LDL7n/src/TimerOutput.jl:252 [inlined]
irgen at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/irgen.jl:4
macro expansion at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/driver.jl:149 [inlined]
macro expansion at /home/jeff/.julia/packages/TimerOutputs/LDL7n/src/TimerOutput.jl:252 [inlined]
macro expansion at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/driver.jl:148 [inlined]
#emit_llvm#110 at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/utils.jl:64
unknown function (ip: 0x7f03563650b5)
unknown function (ip: 0x7f0356339569)
unknown function (ip: 0x7f0356339548)
emit_llvm##kw at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/utils.jl:62 [inlined]
#codegen#108 at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/driver.jl:58
codegen##kw at /home/jeff/.julia/packages/GPUCompiler/I9fZc/src/driver.jl:43 [inlined]
#generate_obj#17 at /home/jeff/.julia/packages/StaticCompiler/S1AWw/src/StaticCompiler.jl:144
generate_obj##kw at /home/jeff/.julia/packages/StaticCompiler/S1AWw/src/StaticCompiler.jl:134 [inlined]
generate_obj##kw at /home/jeff/.julia/packages/StaticCompiler/S1AWw/src/StaticCompiler.jl:134 [inlined]
#compile#15 at /home/jeff/.julia/packages/StaticCompiler/S1AWw/src/StaticCompiler.jl:98
compile at /home/jeff/.julia/packages/StaticCompiler/S1AWw/src/StaticCompiler.jl:86
jl_apply at /home/jeff/src/julia/src/julia.h:1841 [inlined]
do_call at /home/jeff/src/julia/src/interpreter.c:126
eval_value at /home/jeff/src/julia/src/interpreter.c:215
eval_stmt_value at /home/jeff/src/julia/src/interpreter.c:166 [inlined]
eval_body at /home/jeff/src/julia/src/interpreter.c:612
jl_interpret_toplevel_thunk at /home/jeff/src/julia/src/interpreter.c:750
vchuravy commented 2 years ago

Fixed by https://github.com/JuliaGPU/GPUCompiler.jl/pull/324. So updating GPUCompiler to 0.16 should fix this

brenhinkeller commented 2 years ago

I can try to bump the compat bounds on GPUCompiler in my current PR and see if that has any unexpected consequences

brenhinkeller commented 2 years ago

Looks like we have some work to do: #76

Integration tests are actually passing on 1.8 though, meaning we are successfully compiling standalone executables with GPUCompiler 0.16 -- and I think I know the problem with integration tests on 1.9, so can probably get those up and running without too much trouble.