Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

example panics #40

Open
vhdirk opened this issue Mar 8, 2019 · 10 comments
Open

example panics #40

vhdirk opened this issue Mar 8, 2019 · 10 comments

Comments

@vhdirk
Copy link
Contributor

vhdirk commented Mar 8, 2019

When trying to get the example running, it crashes with the following error:

thread '<unnamed>' panicked at 'assertion failed: !ptr.is_null()', /home/dvhaeren/.cargo/git/checkouts/glib-928cf7b282977403/92b365b/src/shared.rs:365:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::begin_panic
             at /rustc/f22dca0a1bef4141e75326caacc3cd59f3d5be8e/src/libstd/panicking.rs:408
   6: <glib::shared::Shared<T, MM> as glib::translate::FromGlibPtrNone<*mut T>>::from_glib_none
             at /home/dvhaeren/.cargo/git/checkouts/glib-928cf7b282977403/92b365b/src/shared.rs:365
   7: glib::translate::from_glib_none
             at /home/dvhaeren/.cargo/git/checkouts/glib-928cf7b282977403/92b365b/src/translate.rs:1071
   8: <glib::variant::Variant as glib::translate::FromGlibPtrNone<*mut glib_sys::GVariant>>::from_glib_none
             at /home/dvhaeren/.cargo/git/checkouts/glib-928cf7b282977403/92b365b/src/shared.rs:159
   9: webkit_web_extension_initialize_with_user_data
             at /home/dvhaeren/projects/webkit2gtk-webextension-rs/example/<::webkit2gtk_webextension::web_extension_init_with_data macros>:8
  10: <unknown>
  11: _ZN6WebKit22WebKitExtensionManager10initializeEPNS_14InjectedBundleEPN3API6ObjectE
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: _ZN3WTF7RunLoop11performWorkEv
  20: <unknown>
  21: g_main_context_dispatch
  22: <unknown>
  23: g_main_loop_run
  24: _ZN3WTF7RunLoop3runEv
  25: <unknown>
  26: __libc_start_main
  27: _start
fatal runtime error: failed to initiate panic, error 5

I've run a cargo update for both this example and the accompanying webkit2gtk-rs example. I remember that this used to work nicely a couple of months ago (definitively pre glib-rs 0.7)

@vhdirk vhdirk changed the title example crashes example panics Mar 8, 2019
@EPashkin
Copy link
Member

EPashkin commented Mar 8, 2019

Can you add printing value of pointer extension in https://github.com/gtk-rs/webkit2gtk-webextension-rs/blob/master/src/lib.rs#L56, maybe it NULL now?
Then web_extension_initialize need accept &Option<Variant>

@vhdirk
Copy link
Contributor Author

vhdirk commented Mar 9, 2019

@EPashkin The extension pointer seems valid, but user_data is null, even though the webkit2gtk example does provide a string variant.

@EPashkin
Copy link
Member

@vhdirk Can you point me to "webkit2gtk example does provide a string variant"?
I can't find any call webkit_web_context_set_web_extensions_initialization_user_data in https://github.com/gtk-rs/webkit2gtk-webextension-rs/blob/master/example/src/lib.rs

@EPashkin
Copy link
Member

Silly question: with what feature you build https://github.com/gtk-rs/webkit2gtk-rs/blob/master/examples/main.rs#L39 ?

@vhdirk
Copy link
Contributor Author

vhdirk commented Mar 24, 2019

@EPashkin: It's indeed this one: https://github.com/gtk-rs/webkit2gtk-rs/blob/f8cf9de1c8c3e6c1f4bfa61ab8ecb5be0fb99e6f/examples/main.rs#L39

I'm building that with just the plain defaults that are there.

@EPashkin
Copy link
Member

If "plain defaults" meant no "--feature v2_4" of added default = ["v2_4"] to [features] of "Cargo.toml",
Then almost no question why you don't get string, it just don't set.
Strange why no empty Variant passed, but it also possible.

@EPashkin
Copy link
Member

If any of these changes in webkit2gtk-rs fixed problem then we can update #41 as currently it still contains panic.

@antoyo
Copy link
Member

antoyo commented Mar 24, 2019

I can confirm it panics for me when I don't set the feature. With the feature, everything works well with both of your PRs @EPashkin.

@EPashkin
Copy link
Member

@antoyo Thanks for confirmation

@antoyo
Copy link
Member

antoyo commented Nov 17, 2019

@vhdirk: Can this be closed?

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

No branches or pull requests

3 participants