Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Segfault in the host JIT when launching a tuple of kernel functions with @opencl

Open
#522 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
julia
Domain
backend

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

kernels upstream

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 empty OCL_ICD_VENDORS directory).
  • Looping over a tuple with a single function, (v1,), works.
  • The same pattern with CUDA.jl's @cuda works, so it seems to be something about the host code @opencl expands 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaGPU/OpenCL.jl

All issues in JuliaGPU/OpenCL.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.