Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure due to illegal implicit addrspacecast #608

Open
maleadt opened this issue Mar 19, 2024 · 0 comments
Open

Assertion failure due to illegal implicit addrspacecast #608

maleadt opened this issue Mar 19, 2024 · 0 comments
Labels
bug Something isn't working hostcall

Comments

@maleadt
Copy link
Member

maleadt commented Mar 19, 2024

With JuliaLang/julia#53687, ExaTron.jl tests run into an assertion failure due to what I think is a bug in AMDGPU.jl. The problem lies with free!(AMDGPU.Device.HostCallHolder), which compiles the following ccall:

Expr(:foreigncall, Expr(:call, Core.tuple, :(:hipHostFree), AMDGPU.HIP.libhip), AMDGPU.HIP.hipError_t, svec(Ptr{Nothing}), 0, :(:ccall), SSAValue(7), SSAValue(7))

Here, hipHostFree is invoked with a Ptr{Nothing}) (i.e. addrspace(0)) pointer, however, HostCallHolder contains HostCall which results in passing a LLVMPtr{UInt8, AS.Global} (i.e. addrspace(1)) pointer. This kind of implicit address space conversion is illegal, and only happened to work because of the implicit ptrtoint/inttoptr that happened at the ccall boundary because of Julia storing pointers as i64. That is changing in JuliaLang/julia#53687.

It seems like the HostCall struct shouldn't be used as such on the CPU, where it should simply use a Ptr instead.

@maleadt maleadt added bug Something isn't working hostcall labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hostcall
Projects
None yet
Development

No branches or pull requests

1 participant