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

Wrong return for supertype() in functions for compiled sysimage with option--strip-ir #895

Open
kruxigt opened this issue Nov 16, 2023 · 3 comments

Comments

@kruxigt
Copy link

kruxigt commented Nov 16, 2023

I have previously posted this at JuliaLang/julia#51751 but I'm guessing it belongs here as well?

Steps:
1, Generate new package "TestBuild"

2, Add the following functions

function test_supertype(t::Type)
return supertype(t)
end

function test_supertype_math(t::Type{T}) where T <: Number
return supertype(t)
end
3, Build systemimage with
a = Cmd(["--strip-ir", "--compile=all", "--strip-metadata"])
create_sysimage(["TestBuild"]; sysimage_path="TestBuild.so", sysimage_build_args=a)

4 Start Julia with sysimage: Julia -JTestBuild.so --startup-file=no

5, Try the functions:

julia> using .TestBuild
julia> TestBuild.test_supertype(Int64)
Signed
julia> TestBuild.test_supertype_math(Int64)
Integer
This seems like a fairly serious issue?

julia> versioninfo()
Julia Version 1.10.0-rc1
Commit JuliaLang/julia@5aaa948 (2023-11-03 07:44 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (x86_64-apple-darwin22.4.0)
CPU: 8 × Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, icelake-client)
Threads: 11 on 8 virtual cores

@KristofferC
Copy link
Member

This is a Julia bug though so while it could potentially be useful to track it here, the fix has to be done in Julia.

@kruxigt
Copy link
Author

kruxigt commented Nov 16, 2023

This is a Julia bug though so while it could potentially be useful to track it here, the fix has to be done in Julia.

That makes sense! Is this a known bug?

@KristofferC
Copy link
Member

It seems so since there is an issue open about it here JuliaLang/julia#51751. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants