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

QML errors on Ubuntu aarch64 #202

Closed
JanisErdmanis opened this issue Jul 2, 2024 · 19 comments
Closed

QML errors on Ubuntu aarch64 #202

JanisErdmanis opened this issue Jul 2, 2024 · 19 comments
Labels
ARM on ARM cpus bug needs more info Clarification or reproducable example needed

Comments

@JanisErdmanis
Copy link

I have Ubuntu aarch64 installed through Parallels Desktop and noticed an error when launching a simple QML application on this platform:

julia> include("main.jl")
ERROR: LoadError: InitError: type RefArray has no field cpp_object
Stacktrace:
  [1] getproperty
    @ ./Base.jl:49 [inlined]
  [2] unsafe_convert(to_type::Type{CxxWrap.CxxWrapCore.CxxPtr{…}}, x::Base.RefArray{Ptr{…}, Vector{…}, Vector{…}})
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/eWADG/src/CxxWrap.jl:294
  [3] getargv(a::QML.ArgcArgv)
    @ QML ~/.julia/packages/QML/SeDxf/src/QML.jl:158
  [4] __init__()
    @ QML ~/.julia/packages/QML/SeDxf/src/QML.jl:181
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1262
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1250
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{…}, ignore_native::Nothing)
    @ Base ./loading.jl:1195
  [8] _include_from_serialized
    @ ./loading.jl:1152 [inlined]
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{…}, DEPOT_PATH::Vector{…})
    @ Base ./loading.jl:1914
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2346
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2216
 [12] #invoke_in_world#3
    @ ./essentials.jl:1077 [inlined]
 [13] invoke_in_world
    @ ./essentials.jl:1074 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2207
 [15] macro expansion
    @ ./loading.jl:2146 [inlined]
 [16] macro expansion
    @ ./lock.jl:273 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2103
 [18] #invoke_in_world#3
    @ ./essentials.jl:1077 [inlined]
 [19] invoke_in_world
    @ ./essentials.jl:1074 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2096
 [21] include(fname::String)
    @ Main ./sysimg.jl:38
 [22] top-level scope
    @ REPL[1]:1
during initialization of module QML
in expression starting at /media/psf/Home/Desktop/JuliaCon2024-AppBundler-Demo/QMLApp/main.jl:1
Some type information was truncated. Use `show(err)` to see complete types.
@ufechner7 ufechner7 added the bug label Sep 9, 2024
@ufechner7
Copy link
Member

On which hardware did you test this? How can it be reproduced?

@ufechner7 ufechner7 added needs more info Clarification or reproducable example needed ARM on ARM cpus labels Sep 9, 2024
@JanisErdmanis
Copy link
Author

It was tested on Apple silicon via Parallels desktop.

@jonalm
Copy link

jonalm commented Sep 29, 2024

Could it be that you're using an old version of QML? I got the same errors, see barche/QmlJuliaExamples#14

@JanisErdmanis
Copy link
Author

JanisErdmanis commented Sep 29, 2024

I investigated this case because I had previously overlooked how I had used Manifest.toml between Julia versions. I found that I had QML was fixed at 0.9.0. Removing the old Manifest.toml and instantiating the project fresh with Julia 1.11, where QML is now at 0.9.1, sadly, produces the same error.

@ufechner7
Copy link
Member

ufechner7 commented Sep 29, 2024

I would not expect it to work with 1.11-rc . 1.11 is not released yet. Can you repeat the test with Julia 1.10 ?

juliaup install 1.10
juliaup default 1.10

@JanisErdmanis
Copy link
Author

I just tried that. The same error is thrown with Julia 1.10.

@JanisErdmanis
Copy link
Author

JanisErdmanis commented Sep 29, 2024

I also reproduced the same error on Raspberry Pi 4 in headless mode. In my opinion, one step forward would be to create an integration test that runs on CI.

@ufechner7
Copy link
Member

@barche Do we officially support aarch64? If not we should mention it in the README.md. If we want to support it we need to debug this issue. I have a PI5 for testing, but I do not know if there are any servers that could do the testing on CI.

@barche
Copy link
Collaborator

barche commented Oct 2, 2024

I can't see an obvious reason why it wouldn't work, but I don't have a machine to test it on.

@JanisErdmanis
Copy link
Author

@barche, could we add aarch64 to .github/workflows/test.yml, which seems to be left out for Ubuntu?

@kn05
Copy link

kn05 commented Oct 11, 2024

The same issue occurs on Arch Linux WSL2 environment as well.

julia> include("gui.jl") # Or any of the files in the directory
ERROR: LoadError: InitError: type RefArray has no field cpp_object
Stacktrace:
  [1] getproperty
    @ ./Base.jl:49 [inlined]
  [2] unsafe_convert(to_type::Type{CxxWrap.CxxWrapCore.CxxPtr{…}}, x::Base.RefArray{Ptr{…}, Vector{…}, Vector{…}})
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:271
  [3] getargv(a::QML.ArgcArgv)
    @ QML ~/.julia/packages/QML/ZVeBh/src/QML.jl:133
  [4] __init__()
    @ QML ~/.julia/packages/QML/ZVeBh/src/QML.jl:156
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1336
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1324
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing; register::Bool)
    @ Base ./loading.jl:1213
  [8] _include_from_serialized (repeats 2 times)
    @ ./loading.jl:1169 [inlined]
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{…}, DEPOT_PATH::Vector{…})
    @ Base ./loading.jl:1975
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2435
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2300
 [12] #invoke_in_world#3
    @ ./essentials.jl:1088 [inlined]
 [13] invoke_in_world
    @ ./essentials.jl:1085 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2287
 [15] macro expansion
    @ ./loading.jl:2226 [inlined]
 [16] macro expansion
    @ ./lock.jl:273 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2183
 [18] #invoke_in_world#3
    @ ./essentials.jl:1088 [inlined]
 [19] invoke_in_world
    @ ./essentials.jl:1085 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2176
 [21] include(fname::String)
    @ Main ./sysimg.jl:38
 [22] top-level scope
    @ REPL[5]:1
during initialization of module QML
in expression starting at /home/bellq/project/QmlJuliaExamples/basic/gui.jl:2
Some type information was truncated. Use `show(err)` to see complete types.

@barche
Copy link
Collaborator

barche commented Oct 12, 2024

I tried adding aarch64 for Ubuntu, but it seems the Github CI runners don't support this, it tries to run aarch64 Julia on an x86_64 Ubuntu:

https://github.com/JuliaGraphics/QML.jl/actions/runs/11304271459/job/31442445149?pr=208

@barche
Copy link
Collaborator

barche commented Oct 13, 2024

I have been able to reproduce this on my Raspberry Pi 4. It is a bug in CxxWrap, due to different typing in the C++ argv somehow. Still looking for a solution.

@GaavNa
Copy link

GaavNa commented Oct 31, 2024

I really appreciate your efforts. Were you able to make any progress regarding this issue ? I encounter the exact same error message using Julia 1.11 on Windows 10.

@JanisErdmanis
Copy link
Author

@GaavNa, are you running Windows on arm64?

@GaavNa
Copy link

GaavNa commented Nov 1, 2024

@GaavNa, are you running Windows on arm64?

No, Intel. It didn't work on two computer with Intel and Windows.

However, it worked on Debian 12 using an intel CPU.

@JanisErdmanis
Copy link
Author

@GaavNa, you should open a separate issue laying out the configuration that could help us reproduce it, along with the Julia version you have used. In my Windows environment, QML works. Thus, such a bug report would be valuable. Also, trying Julia from a fresh start is worthwhile, as I have encountered some binary Artifact locking situations in the past.

@barche
Copy link
Collaborator

barche commented Nov 3, 2024

Still no clear idea on what causes this, I think it's actually a problem in CxxWrap.jl and the convert methods there.

barche added a commit to JuliaInterop/CxxWrap.jl that referenced this issue Nov 11, 2024
@barche
Copy link
Collaborator

barche commented Nov 11, 2024

I think applying the changes in CxxWrap.jl from this commit will fix this: JuliaInterop/CxxWrap.jl@c9e113c

You can try this by manually patching the CxxWrap.jl file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM on ARM cpus bug needs more info Clarification or reproducable example needed
Projects
None yet
Development

No branches or pull requests

6 participants