Skip to content

Segmentation fault when running NewPM #528

@vchuravy

Description

@vchuravy

In EnzymeAD/Enzyme.jl#2675 I am seeing a "Bus Error" locally.

~/src/julia-1.12/julia -g2 --project=. -e "using Enzyme; autodiff(Forward, identity, Duplicated(1.0, 1.0
))"

[121250] signal 7 (128): Bus error
in expression starting at none:1
~_Function_base at /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/8.1.0/bits/std_function.h:256 [inlined]
~function at /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/8.1.0/bits/std_function.h:370 [inlined]
destroy_range at /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/local/include/llvm/ADT/SmallVector.h:354 [inlined]
~SmallVector at /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/local/include/llvm/ADT/SmallVector.h:1215 [inlined]
~PassBuilder at /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/local/include/llvm/Passes/PassBuilder.h:104
runJuliaPasses at /workspace/srcdir/LLVM.jl/deps/LLVMExtra/lib/NewPM.cpp:157
LLVMRunJuliaPasses at /home/vchuravy/.julia/packages/LLVM/iza6e/lib/18/libLLVM_extra.jl:291 [inlined]
macro expansion at /home/vchuravy/.julia/packages/LLVM/iza6e/src/executionengine/utils.jl:25 [inlined]
run! at /home/vchuravy/.julia/packages/LLVM/iza6e/src/newpm.jl:291
jfptr_runNOT._19333 at /home/vchuravy/.julia/compiled/v1.12/GPUCompiler/yPwef_V4OgU.so (unknown line)
_jl_invoke at /home/vchuravy/src/julia-1.12/src/gf.c:3991
ijl_apply_generic at /home/vchuravy/src/julia-1.12/src/gf.c:4210
jl_apply at /home/vchuravy/src/julia-1.12/src/julia.h:2391
jl_f__apply_iterate at /home/vchuravy/src/julia-1.12/src/builtins.c:868
macro expansion at /home/vchuravy/.julia/packages/LLVM/iza6e/src/newpm.jl:303 [inlined]
macro expansion at /home/vchuravy/.julia/packages/LLVM/iza6e/src/base.jl:97 [inlined]
#run!#66 at /home/vchuravy/.julia/packages/LLVM/iza6e/src/newpm.jl:301
run! at /home/vchuravy/.julia/packages/LLVM/iza6e/src/newpm.jl:300
jfptr_runNOT._20805 at /home/vchuravy/.julia/compiled/v1.12/GPUCompiler/yPwef_V4OgU.so (unknown line)
_jl_invoke at /home/vchuravy/src/julia-1.12/src/gf.c:3991
ijl_apply_generic at /home/vchuravy/src/julia-1.12/src/gf.c:4210
macro expansion at /home/vchuravy/.julia/packages/GPUCompiler/Gp8bZ/src/driver.jl:339 [inlined]
macro expansion at /home/vchuravy/.julia/packages/Tracy/tYwAE/src/tracepoint.jl:163 [inlined]
#emit_llvm#92 at /home/vchuravy/.julia/packages/GPUCompiler/Gp8bZ/src/driver.jl:322
emit_llvm at /home/vchuravy/.julia/packages/GPUCompiler/Gp8bZ/src/driver.jl:182 [inlined]

PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC);

I am a bit confused why the PassBuilder deconstructor is running in that line, and why that triggers a bus error...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions