Skip to content

JIT session error: Symbols not found: [ __udivti3 ] on 32-bit 1.12 only #58911

@LilithHafner

Description

@LilithHafner

This code crashes the repl on Julia +1.12.0-beta4~x86, but not on 1.11 nor 64-bit 1.12.

struct PtrArray{T, N} <: DenseArray{T, N}
    ptr::Ptr{T}
    size::NTuple{N, Int}
end
Base.size(p::PtrArray) = p.size
Base.IndexStyle(::Type{<:PtrArray}) = IndexLinear()
function Base.getindex(p::PtrArray, i::Int)
    @boundscheck checkbounds(p, i)
    unsafe_load(p.ptr, i)
end
function Base.setindex!(p::PtrArray, v, i::Int)
    @boundscheck checkbounds(p, i)
    unsafe_store!(p.ptr, v, i)
    p
end

function f(res)
    sm2 = sum(res)
    for (i,x) in enumerate(res)
        val = div(UInt128(x) << 64, sm2) % UInt64
        res[i] = val
    end
end

backing = UInt64[10, 73]
GC.@preserve backing begin
    res = PtrArray{UInt64, 1}(pointer(backing), (2,))
    f(res)
end
JIT session error: Symbols not found: [ __udivti3 ]

This example is extracted from a real failure in AliasTables.jl

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorregression 1.12Regression in the 1.12 releasesystem:32-bitAffects only 32-bit systems

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions