Segfault in the host JIT when launching a tuple of kernel functions with @opencl
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with the reproducer in crash.jl:13 using OpenCL.jl 0.10.12, Julia 1.12.7 or 1.13.0, and PoCL with system ICDs hidden. Inspect the host code generated by @opencl and compare it with the working single-element tuple and CUDA pattern; done means isolating a minimal Julia or OpenCL.jl reproducer, or identifying the information needed for an upstream LLVM report.
Written by the indexing model from the issue text.
Description
Launching kernels with @opencl from a function that loops over a tuple of kernel functions crashes Julia while it compiles that function:
using OpenCL, pocl_jll
v1(A) = nothing
v2(A) = nothing
function main()
for k in (v1, v2)
A = OpenCL.zeros(Int, 5, 7)
@opencl k(A)
end
println("ok")
end
main()
[1715148] signal 11 (1): Segmentation fault
in expression starting at crash.jl:13
_ZN4llvm13LazyCallGraph4Node12populateSlowEv at .../lib/julia/libLLVM.so.20.1jl (unknown line)
_ZN4llvm13LazyCallGraph12buildRefSCCsEv at .../lib/julia/libLLVM.so.20.1jl (unknown line)
_ZN4llvm33ModuleToPostOrderCGSCCPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE at .../lib/julia/libLLVM.so.20.1jl (unknown line)
_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_ at .../lib/julia/libLLVM.so.20.1jl (unknown line)
run at .../src/pipeline.cpp:792
[...]
eval at ./boot.jl:489
The crash is in the host JIT: LLVM's call-graph analysis, while optimizing the code Julia generates for main. It isn't in kernel compilation.
- It reproduces with the released OpenCL.jl 0.10.12 and with
main(e3f48f3), on Julia 1.12.7 and 1.13.0, with PoCL (pocl_jll, system ICDs hidden with an emptyOCL_ICD_VENDORSdirectory). - Looping over a tuple with a single function,
(v1,), works. - The same pattern with CUDA.jl's
@cudaworks, so it seems to be something about the host code@openclexpands to, rather than the loop itself.
We haven't reduced it further, e.g. to plain Julia code that crashes LLVM without OpenCL.jl, which would make it reportable upstream.
- Dominant language
- Julia
- Stars
- 313
- Forks
- 50
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 42
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGPU/OpenCL.jl
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
performance runtime
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Intel CPU runtime: reports half-precision atomic addition but lacks the atomic_add builtin for halfOpenIntel CPU kernels upstream
Difficulty 4/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Intel CPU kernels upstream
Difficulty 4/5 3-5 days Newbie friendliness 43/100
JuliaGPU/OpenCL.jl#559 · 1 comment ·
Maintainers usually reply within 1 day
All issues in JuliaGPU/OpenCL.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jump-dev/MathOptInterface.jl#3113 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
JuliaMath/Polynomials.jl#647 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OpenSourceAWE/SymbolicAWEModels.jl#431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
JuliaArrays/StaticArrays.jl#1365 ·