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

Script basic/canvas.jl crashes during Qml loading #13

Open
magister-ludi opened this issue Dec 9, 2023 · 15 comments
Open

Script basic/canvas.jl crashes during Qml loading #13

magister-ludi opened this issue Dec 9, 2023 · 15 comments

Comments

@magister-ludi
Copy link

On Windows 11 (Julia versions 1.9.4 and 1.10.0-rc2) the script crashes while executing loadqml. On WSL, on the same machine, the script runs correctly. All other example scripts in the same folder run correctly on both systems. This may be a problem with Qml.jl, but I don't understand enough to try to debug. Happy to provide more information if it will help.
The output on failure is:

[69708] signal (22): SIGABRT
in expression starting at C:\Users\bioni\experimental\Sketches.jl\QmlJuliaExamples\basic\canvas.jl:43
crt_sig_handler at C:/workdir/src\signals-win.c:95
raise at C:\WINDOWS\System32\msvcrt.dll (unknown line)
abort at C:\WINDOWS\System32\msvcrt.dll (unknown line)
jl_init_threadtls at C:/workdir/src\threading.c:336
ijl_adopt_thread at C:/workdir/src\threading.c:413
_ZN20ForeignThreadManager10add_threadEP7QThread at C:\Users\bioni\.julia\artifacts\ad135892eb03ce170ab621b360de9f20b8ca7d41\bin\libjlqml.dll (unknown line)
_ZN7qmlwrap11JuliaCanvas5paintEP8QPainter at C:\Users\bioni\.julia\artifacts\ad135892eb03ce170ab621b360de9f20b8ca7d41\bin\libjlqml.dll (unknown line)
_ZN21QSGDefaultPainterNode5paintEv at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN21QSGDefaultPainterNode6updateEv at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN17QQuickPaintedItem15updatePaintNodeEP7QSGNodePN10QQuickItem19UpdatePaintNodeDataE at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN19QQuickWindowPrivate15updateDirtyNodeEP10QQuickItem at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN19QQuickWindowPrivate16updateDirtyNodesEv at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN19QQuickWindowPrivate14syncSceneGraphEv at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN22QSGGuiThreadRenderLoop12renderWindowEP12QQuickWindow at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Quick.dll (unknown line)
_ZN7QWindow5eventEP6QEvent at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\bin\Qt6Gui.dll (unknown line)
_ZN16QCoreApplication20sendSpontaneousEventEP7QObjectP6QEvent at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\bin\Qt6Core.dll (unknown line)
_ZN22QGuiApplicationPrivate18processExposeEventEPN29QWindowSystemInterfacePrivate11ExposeEventE at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\bin\Qt6Gui.dll (unknown line)
_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\bin\Qt6Gui.dll (unknown line)
_ZN22QWindowSystemInterface23flushWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\bin\Qt6Gui.dll (unknown line)
_ZN14QWindowsWindow13handleWmPaintEP6HWND__jyxPx at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
_ZN15QWindowsContext11windowsProcEP6HWND__jN9QtWindows16WindowsEventTypeEyxPxPP14QWindowsWindow at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
qWindowsWndProc at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
GetClassLongW at C:\WINDOWS\System32\USER32.dll (unknown line)
KiUserCallbackDispatcher at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
NtUserDispatchMessage at C:\WINDOWS\System32\win32u.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
CoUninitialize at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal111 at C:\WINDOWS\System32\combase.dll (unknown line)
RoGetActivatableClassRegistration at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal87 at C:\WINDOWS\System32\combase.dll (unknown line)
HSTRING_UserUnmarshal64 at C:\WINDOWS\System32\combase.dll (unknown line)
NdrClientCall3 at C:\WINDOWS\System32\RPCRT4.dll (unknown line)
CoGetPSClsid at C:\WINDOWS\System32\combase.dll (unknown line)
ObjectStublessClient32 at C:\WINDOWS\System32\combase.dll (unknown line)
CoDisconnectContext at C:\WINDOWS\System32\combase.dll (unknown line)
CoGetStandardMarshal at C:\WINDOWS\System32\combase.dll (unknown line)
CoGetProcessIdentifier at C:\WINDOWS\System32\combase.dll (unknown line)
Ordinal140 at C:\WINDOWS\System32\combase.dll (unknown line)
CoEnableCallCancellation at C:\WINDOWS\System32\combase.dll (unknown line)
HSTRING_UserMarshal at C:\WINDOWS\System32\combase.dll (unknown line)
CoGetProcessIdentifier at C:\WINDOWS\System32\combase.dll (unknown line)
CoGetProcessIdentifier at C:\WINDOWS\System32\combase.dll (unknown line)
CoGetProcessIdentifier at C:\WINDOWS\System32\combase.dll (unknown line)
CoGetProcessIdentifier at C:\WINDOWS\System32\combase.dll (unknown line)
CoCreateInstance at C:\WINDOWS\System32\combase.dll (unknown line)
CoCreateInstance at C:\WINDOWS\System32\combase.dll (unknown line)
CoCreateInstance at C:\WINDOWS\System32\combase.dll (unknown line)
unknown function (ip: 00007ff889313f6b)
unknown function (ip: 00007ff889313ece)
unknown function (ip: 00007ff889313e74)
unknown function (ip: 00007ff889313de4)
unknown function (ip: 00007ff88931402a)
unknown function (ip: 00007ff88931433d)
unknown function (ip: 00007ff889299a36)
_ZN24QWindowsUiaAccessibility17handleWmGetObjectEP6HWND__yxPx at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
_ZN15QWindowsContext11windowsProcEP6HWND__jN9QtWindows16WindowsEventTypeEyxPxPP14QWindowsWindow at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
qWindowsWndProc at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
GetClassLongW at C:\WINDOWS\System32\USER32.dll (unknown line)
KiUserCallbackDispatcher at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
NtUserMessageCall at C:\WINDOWS\System32\win32u.dll (unknown line)
SendMessageTimeoutW at C:\WINDOWS\System32\USER32.dll (unknown line)
unknown function (ip: 00007ff89a8d6d84)
unknown function (ip: 00007ff89a8d2ee6)
unknown function (ip: 00007ff89a910fb3)
unknown function (ip: 00007ff89a910c5d)
TF_CreateThreadMgr at C:\WINDOWS\System32\MSCTF.dll (unknown line)
TF_UninitSystem at C:\WINDOWS\System32\MSCTF.dll (unknown line)
TF_CreateThreadMgr at C:\WINDOWS\System32\MSCTF.dll (unknown line)
CtfImeDispatchDefImeMessage at C:\WINDOWS\System32\MSCTF.dll (unknown line)
RegisterWindowMessageA at C:\WINDOWS\System32\USER32.dll (unknown line)
KiUserCallbackDispatcher at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
NtUserMessageCall at C:\WINDOWS\System32\win32u.dll (unknown line)
GetDlgCtrlID at C:\WINDOWS\System32\USER32.dll (unknown line)
GetDlgCtrlID at C:\WINDOWS\System32\USER32.dll (unknown line)
qWindowsWndProc at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
DispatchMessageW at C:\WINDOWS\System32\USER32.dll (unknown line)
GetClassLongW at C:\WINDOWS\System32\USER32.dll (unknown line)
KiUserCallbackDispatcher at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
NtUserShowWindow at C:\WINDOWS\System32\win32u.dll (unknown line)
_ZNK14QWindowsWindow8show_sysEv at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
_ZN14QWindowsWindow10setVisibleEb at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\plugins\platforms\qwindows.dll (unknown line)
_ZN14QWindowPrivate10setVisibleEb at C:\Users\bioni\.julia\artifacts\2ef92b843c5dee978e2aaf8494ef5c12c09dc731\bin\Qt6Gui.dll (unknown line)
_ZThn40_N23QQuickApplicationWindow17componentCompleteEv at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6QuickTemplates2.dll (unknown line)
_ZN17QQmlObjectCreator8finalizeER26QQmlInstantiationInterrupt at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZN20QQmlComponentPrivate8completeEP17QQmlEnginePrivatePNS_17ConstructionStateE at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZN20QQmlComponentPrivate14completeCreateEv at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZN20QQmlComponentPrivate20createWithPropertiesEP7QObjectRK4QMapI7QString8QVariantEP11QQmlContextNS_14CreateBehaviorE at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZN13QQmlComponent6createEP11QQmlContext at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZN28QQmlApplicationEnginePrivate10finishLoadEP13QQmlComponent at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZN21QQmlApplicationEngine4loadERK7QString at C:\Users\bioni\.julia\artifacts\d5b2f6029a93408d9556cff464f341a32fbdad06\bin\Qt6Qml.dll (unknown line)
_ZNSt17_Function_handlerIFbP21QQmlApplicationEngineRK7QStringEZ19define_julia_moduleEUlS1_S4_E7_E9_M_invokeERKSt9_Any_dataOS1_S4_ at C:\Users\bioni\.julia\artifacts\ad135892eb03ce170ab621b360de9f20b8ca7d41\bin\libjlqml.dll (unknown line)
_ZN5jlcxx6detail11CallFunctorIbJP21QQmlApplicationEngineRK7QStringEE5applyEPKvNS_13WrappedCppPtrESA_ at C:\Users\bioni\.julia\artifacts\ad135892eb03ce170ab621b360de9f20b8ca7d41\bin\libjlqml.dll (unknown line)
load_into_engine at C:\Users\bioni\.julia\packages\CxxWrap\5IZvn\src\CxxWrap.jl:624 [inlined]
load_qml at C:\Users\bioni\.julia\packages\QML\ZVeBh\src\QML.jl:77
#loadqml#1 at C:\Users\bioni\.julia\packages\QML\ZVeBh\src\QML.jl:98
loadqml at C:\Users\bioni\.julia\packages\QML\ZVeBh\src\QML.jl:91
unknown function (ip: 0000025edfcdb8bf)
top-level scope at C:\Users\bioni\experimental\Sketches.jl\QmlJuliaExamples\basic\canvas.jl:43
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:903
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1903
_include at .\loading.jl:1963
include at .\Base.jl:457
jfptr_include_38014.clone_1 at C:\Users\bioni\.julia\juliaup\julia-1.9.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
exec_options at .\client.jl:307
_start at .\client.jl:522
jfptr__start_42472.clone_1 at C:\Users\bioni\.julia\juliaup\julia-1.9.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1880 [inlined]
true_main at C:/workdir/src\jlapi.c:573
jl_repl_entrypoint at C:/workdir/src\jlapi.c:717
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 4054092 (Pool: 4049694; Big: 4398); GC: 6
Qt Warning: QMutex: destroying locked mutex ((null):0, (null))
@barche
Copy link
Owner

barche commented Dec 10, 2023

Thanks for reporting this. I can reproduce this if I run other examples before canvas in the same Julie session. Does it also crash if you run canvas.jl as first and only example in the Julia session? Looking at your backtrace, the cause of the crash appears to be that the QSG_RENDER_LOOP is not set to basic, which still causes threading issues.

@magister-ludi
Copy link
Author

Thank you for your quick response. My original attempt was on the command line:

julia --project canvas.jl

After your reply, I tried running in the REPL:

$ julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.4 (2023-11-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> include("canvas.jl")

The output is the same as before.

@barche
Copy link
Owner

barche commented Dec 10, 2023

Can you try doing set QSG_RENDER_LOOP=basic (MSDOS CMD) or $Env:QSG_RENDER_LOOP = basic (PowerShell) in the terminal before running julia --project canvas.jl? I suspect there is a problem getting the environment variable through to Qt.

@magister-ludi
Copy link
Author

I tried that, but still get the same error.

@barche
Copy link
Owner

barche commented Dec 11, 2023

I'm completely out of ideas then. Setting this env var should force basic (non-threaded) rendering, but I see from your trace that it is using threaded rendering anyway. Making QML.jl work with threaded rendering is on the todo list, so then this will work.

@magister-ludi
Copy link
Author

The script explicitly sets ENV["QSG_RENDER_LOOP"] = "basic" as well.
I'll leave the issue open for now, and try to understand in more detail the scripts that do work.
Thanks for taking time to look at this.

@ghmorrison
Copy link

canvas.jl was not working for me as well. I was going through basic as well and I noticed the 2 other canvasses were working. I also noticed they both had 2 controls and canvas.jl had only one. So I commented out
#ENV["QSG_RENDER_LOOP"] = "basic"

Now it works at least for me.

@magister-ludi
Copy link
Author

Interesting, thanks. It's late in the day now, but I'll try it out tomorrow and report back.

@magister-ludi
Copy link
Author

Running Julia v1.11.2, the script still fails for me (I had to change the compat entry for CxxWrap to v0.16.0 and for QML to v0.9.1).

@ghmorrison In reference to your issue #18, the script listmodel-fromjulia.jl works on my system (both from the command line and from the REPL), so there seem to be other differences in play.

@ghmorrison
Copy link

Regarding canvas.jl I had already changed my compat and cxxWrap and it did not run until I commented out that line.

I am running dat linux and listmodel-fromjulia.jl is still not working for me. Perhaps it has a dependency I am missing.

@magister-ludi
Copy link
Author

Oh, I didn't realise you were running Linux: my issue relates specifically to Windows. All the scripts in the basic directory run for me (without any change) under WSL, which is as close to Linux as I have at the moment. I'll comment on the issue you opened at #18

@ghmorrison
Copy link

This is really weird. canvas.jl works with ENV["QSG_RENDER_LOOP"] = "basic" on old dell precision using distro MX linux running desktop enviroment of xfce. I still have to comment it out on the 2 year old hp z workstation using distro dat linux running desktop enviroment of lxqt.

@ghmorrison
Copy link

All my comments about canvas are wrong can I just delete them?

@ghmorrison
Copy link

Sorry, and thank you for taking the time to respond.

@ghmorrison
Copy link

It stopped working again and I have found some issues with using ENV["QSG_RENDER_LOOP"] = "basic" and the desktop environment kde. kde is related to lxqt. This does not explain the issue with listmodel-fromjulia.jl. xfce is a different family of desktop environments.

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

3 participants