feenkcom / gtoolkit

Glamorous Toolkit is the Moldable Development environment. It empowers you to make systems explainable through experiences tailored for each problem.
https://gtoolkit.com
MIT License
1.09k stars 47 forks source link

VM crash when displaying WebViewElement on Fedora 39 #3893

Closed piotrklibert closed 1 month ago

piotrklibert commented 2 months ago

I updated my Fedora from 36 to 39. Before the update, WebViewElements didn't show on Lepiter pages, after upgrade, visiting a page with WebView crashes the VM. I checked out the latest main from feenkcom/libwebview (rev. 92b568ed8ff294813f841fcfb64b314f3532bb5b) and built it, replacing the libWebView.so in GToolkit lib dir and got the same error (but with line numbers):

-▶ RUST_BACKTRACE=1 ./bin/GlamorousToolkit
thread '<unnamed>' panicked at /home/cji/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gtk-0.18.1/src/auto/fixed.rs:23:9:
GTK has not been initialized. Call `gtk::init` first.
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: gtk::auto::fixed::Fixed::new
             at /home/cji/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gtk-0.18.1/src/auto/fixed.rs:23:9
   3: WebView::webview::build
             at ./libwebview/libwebview/src/webview.rs:32:21
   4: webview_build
             at ./libwebview/libwebview/src/webview.rs:74:5
   5: ffi_call_unix64
   6: ffi_call_int
   7: ffi_call
   8: vm_runtime::ffi::EventLoopCallout::call
   9: vm_runtime::event_loop::EventLoop::process_message
  10: vm_runtime::event_loop::EventLoop::try_recv
  11: try_receive_events
  12: Winit::polling_event_loop::PollingEventLoop::run::{{closure}}
  13: winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration
  14: winit::platform_impl::platform::x11::EventLoop<T>::run
  15: winit::platform_impl::platform::EventLoop<T>::run
  16: Winit::polling_event_loop::PollingEventLoop::run
  17: value_box::value_box::ValueBoxPointer::with_mut
  18: winit_polling_event_loop_run
  19: ffi_call_unix64
  20: ffi_call_int
  21: ffi_call
  22: vm_runtime::ffi::EventLoopCallout::call
  23: vm_runtime::event_loop::EventLoop::process_message
  24: vm_runtime::event_loop::EventLoop::run
  25: vm_runtime::constellation::Constellation::run
  26: vm_client::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: Rust cannot catch foreign exceptions
[1]    190805 IOT instruction (core dumped)  RUST_BACKTRACE=1 ./bin/GlamorousToolkit

Adding gtk::init(); here: https://github.com/feenkcom/libwebview/blob/main/libwebview/src/webview.rs#L31 fixed the crash and the Lepiter page now displays; however, the WebViewElement still doesn't render:

screenshot_2024-07-14_1902

Please let me know what info I can provide to help debug this issue; I'm very interested in getting the WebView to work on Fedora.

piotrklibert commented 1 month ago

Fixed in https://github.com/feenkcom/gtoolkit-webview/commit/725448cf574fc996578e95e6f56ede0c55a17f8e