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

Unexpected null pointer returned from gtk_entry_get_text #85

Open
trans opened this issue Apr 30, 2021 · 1 comment
Open

Unexpected null pointer returned from gtk_entry_get_text #85

trans opened this issue Apr 30, 2021 · 1 comment
Labels
bug incomplete-gir Weirdness caused by wrong or missing GIR data library compat

Comments

@trans
Copy link

trans commented Apr 30, 2021

Getting critical error:

(benchgui:95622): GLib-GObject-CRITICAL **: 08:46:44.520: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(benchgui:95622): Gtk-CRITICAL **: 08:46:44.520: gtk_entry_set_text: assertion 'GTK_IS_ENTRY (entry)' failed

(benchgui:95622): Gtk-CRITICAL **: 08:46:44.520: gtk_entry_set_text: assertion 'GTK_IS_ENTRY (entry)' failed

(benchgui:95622): Gtk-CRITICAL **: 08:46:44.520: gtk_entry_get_text: assertion 'GTK_IS_ENTRY (entry)' failed
Unhandled exception in spawn: An unexpected null pointer was returned from gtk_entry_get_text.

This means that there is a missing may return null annotation in the GIR
file defining this function. Please report this as a bug upstream.

For now please manually override the generated wrapper method with one that
handles the null pointer. You may also want to upstream this override to the
shard maintaining manual overrides for the respective library. (Exception)
  from lib/gobject/src/gobject.cr:12:5 in 'raise_unexpected_null'
  from lib/gobject/src/gtk/gtk.cr:4:1 in 'text'
  from src/gtk/mainui.cr:130:62 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'update'
  from src/gtk/mainui.cr:389:9 in 'update'
  from src/benchgui.cr:90:7 in 'handle_message'
  from src/benchgui.cr:73:11 in 'listen'
  from src/benchgui.cr:47:7 in '->'
  from ../../../../../../usr/share/crystal/src/primitives.cr:255:3 in 'run'
  from ../../../../../../usr/share/crystal/src/fiber.cr:92:34 in '->'
  from ???

My source code at src/gtk/mainui.cr:130:62 in '->' is simply calling Gtk::Entry#text.

@jhass jhass added bug incomplete-gir Weirdness caused by wrong or missing GIR data library compat labels Apr 30, 2021
@jhass
Copy link
Owner

jhass commented May 1, 2021

This is a little weird, looking at usages of gtk_entry_get_text it doesn't seem to be frequently null-checked, so I wonder if it's nullable or not now.

Maybe you're hitting the problem described at https://github.com/jhass/crystal-malloc_pthread_shim :/

Could try to find a minimal example that reproduces this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug incomplete-gir Weirdness caused by wrong or missing GIR data library compat
Projects
None yet
Development

No branches or pull requests

2 participants