sunoru / Webviews.jl

🌐 Julia implementation of webview, a tiny library for creating web-based desktop GUIs.
https://sunoru.github.io/Webviews.jl/
MIT License
34 stars 0 forks source link

Crash with @async run #18

Open ritulahkar opened 5 months ago

ritulahkar commented 5 months ago

`

    ritu@ritu-B450M-DS3H-V2:~$ julia
         _
    _       _ _(_)_     |  Documentation: https://docs.julialang.org
    (_)     | (_) (_)    |
    _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
    | | | | | | |/ _` |  |
    | | |_| | | | (_| |  |  Version 1.10.0 (2023-12-25)
    _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
    |__/                   |

    julia> using Webviews

    julia> webview1 = Webview()
    Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal
    Webview (0 bindings): pending

    julia> navigate!(webview1, "https://julialang.org/")
    Webview (0 bindings): pending

    julia> y=@async run(webview1)
    Task (runnable) @0x00007f7f9aea4330

    julia> 
    [950345] signal (6.-6): Aborted
    in expression starting at none:0
    pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
    raise at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
    abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
    _Z20WTFCrashWithInfoImpliPKcS0_immmm at /lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18 (unknown line)
    _ZN3JSC18sanitizeStackForVMERNS_2VME at /lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18 (unknown line)
    unknown function (ip: 0x7f7f50a32659)
    unknown function (ip: 0x7f7f50a8f7be)
    unknown function (ip: 0x7f7f50a90aa0)
    JSContextGroupCreate at /lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18 (unknown line)
    unknown function (ip: 0x7f7f4fa1f925)
    unknown function (ip: 0x7f7f4f9ec59f)
    unknown function (ip: 0x7f7f4f9efeeb)
    unknown function (ip: 0x7f7f58b001de)
    g_object_new_with_properties at /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (unknown line)
    g_object_new at /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (unknown line)
    unknown function (ip: 0x7f7f4885eb82)
    unknown function (ip: 0x7f7f4885ebf7)
    unknown function (ip: 0x7f7f488b7773)
    unknown function (ip: 0x7f7f488ac887)
    unknown function (ip: 0x7f7f487b8aac)
    unknown function (ip: 0x7f7f487c8b06)
    unknown function (ip: 0x7f7f48732aca)
    unknown function (ip: 0x7f7f486d0d14)
    unknown function (ip: 0x7f7f486d0ed4)
    unknown function (ip: 0x7f7f486d2cb1)
    unknown function (ip: 0x7f7f50eba25c)
    unknown function (ip: 0x7f7f50f1835c)
    unknown function (ip: 0x7f7f50f18ca2)
    g_main_context_dispatch at /lib/x86_64-linux-gnu/libglib-2.0.so.0 (unknown line)
    unknown function (ip: 0x7f7f58371257)
    g_main_loop_run at /lib/x86_64-linux-gnu/libglib-2.0.so.0 (unknown line)
    gtk_main at /lib/x86_64-linux-gnu/libgtk-3.so.0 (unknown line)
    run at /home/ritu/.julia/packages/Webviews/SLFXk/src/platforms/linux/Impl.jl:115 [inlined]
    run at /home/ritu/.julia/packages/Webviews/SLFXk/src/API.jl:90
    unknown function (ip: 0x7f7fa450fdc5)
    _jl_invoke at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
    ijl_apply_generic at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/gf.c:3076
    #3 at ./REPL[4]:1
    unknown function (ip: 0x7f7fa450f612)
    _jl_invoke at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
    ijl_apply_generic at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/gf.c:3076
    jl_apply at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
    start_task at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/task.c:1238
    Allocations: 2502220 (Pool: 2499829; Big: 2391); GC: 4
    Aborted (core dumped)

`

I am running Linux mint 21.3

`

sunoru commented 5 months ago

Thanks for reporting this. It is actually a known issue of this package on Linux because gtk main loop has to be called in the main thread. I haven't figured out how to fix it so you need to avoid this kind of usage for now.