Skip to content

Segmentation fault with besselk and "large" inputs on Julia version 1.11.5 #88

@Alex-Adam25

Description

@Alex-Adam25

Hello,
I encountered a segmentation fault when using the modified Bessel function of the second kind, besselk(nu,x) , with nu = 2, x ≥ 19.7, and 128-bit precision (ArbReal{128}) in Julia 1.11.5. Here is an example

$ julia +1.11.5 -q
julia> using ArbNumerics

julia> ArbNumerics.besselk(ArbReal{128}("2"), ArbReal{128}("19.7"))

Segmentation fault

However, when using Julia 1.11.4, the computation succeeds without issues:

$ julia +1.11.4 -q
julia> using ArbNumerics

julia> ArbNumerics.besselk(ArbReal{128}("2"), ArbReal{128}("19.7"))
8.6204978292581032941664283046893573e-10

Other combinations of (nu, x) that produce small output values also trigger the segmentation fault.

I have traced the crash to the ccall in .julia/packages/ArbNumerics/gdpAn/src/float/bessel.jl (line 20) but I don't know enough to proceed debugging it.
Here is the ccall causing the segfault directly:

julia +1.11.5 -q
julia> using ArbNumerics

julia> ccall(ArbNumerics.@libarb(acb_hypgeom_bessel_k),Cvoid,(Ref{ArbComplex}, Ref{ArbComplex}, Ref{ArbComplex}, Clong),
       ArbComplex{128}(),ArbComplex{128}(2),ArbComplex{128}(30),128)

[555570] signal 11 (1): Segmentation fault
in expression starting at REPL[2]:1
Allocations: 1 (Pool: 1; Big: 0); GC: 0
Segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions