After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793745 - GLib warnings when using a combobox in a treeview cell
GLib warnings when using a combobox in a treeview cell
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2018-02-23 11:35 UTC by Peter.Onion
Modified: 2018-05-02 19:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
galde file for combo.c (7.25 KB, text/plain)
2018-02-23 12:40 UTC, Peter.Onion
Details
combo.c that shows the glib warnings (3.57 KB, text/plain)
2018-02-23 12:41 UTC, Peter.Onion
Details

Description Peter.Onion 2018-02-23 11:35:06 UTC
I'm getting these warnings when using a combobox in a treeview cell:

(combo:1180): GLib-GObject-CRITICAL **: g_object_notify: assertion 'G_IS_OBJECT (object)' failed

(combo:1180): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

They occure when selecting an item from the combobox.

I've traced this  down to the combobox object getting freed/finalised too early.
The back trace below shows (#0) gtk_combo_box_finalize being called from within (#3) g_signal_emit_valist
which is called from (#5) gtk_combo_box_set_active_internal which is calling
  g_signal_emit (combo_box, combo_box_signals[CHANGED], 0);

NOTE: line numbers are incorrect as my sources have had quite a lot of extra debugging included
while I've been tracking this down.

Thread 1 "combo" hit Breakpoint 1, gtk_combo_box_finalize (object=0x106348)
    at gtkcombobox.c:4427
4427	{
(gdb) bt
  • #0 gtk_combo_box_finalize
    at gtkcombobox.c line 4427
  • #1 g_object_unref
    at gobject.c line 3330
  • #2 g_value_unset
    at gvalue.c line 275
  • #3 g_signal_emit_valist
    at gsignal.c line 3435
  • #4 g_signal_emit
    at gsignal.c line 3466
  • #5 gtk_combo_box_set_active_internal
    at gtkcombobox.c line 3920
  • #6 gtk_combo_box_set_active_iter
    at gtkcombobox.c line 4010
  • #7 gtk_combo_box_menu_activate
    at gtkcombobox.c line 2826
  • #8 g_cclosure_marshal_VOID__STRINGv
    at gmarshal.c line 1794
  • #9 _g_closure_invoke_va
    at gclosure.c line 867
  • #10 g_signal_emit_valist
    at gsignal.c line 3300
  • #11 g_signal_emit
    at gsignal.c line 3466
  • #12 item_activated_cb
    at gtktreemenu.c line 1434
  • #13 g_closure_invoke
    at gclosure.c line 804
  • #14 signal_emit_unlocked_R
    at gsignal.c line 3654
  • #15 g_signal_emit_valist
    at gsignal.c line 3399
  • #16 g_signal_emit
    at gsignal.c line 3466
  • #17 gtk_widget_activate
    at gtkwidget.c line 7771
  • #18 gtk_menu_shell_activate_item
    at gtkmenushell.c line 1375
  • #19 gtk_menu_shell_button_release
    at gtkmenushell.c line 791
  • #20 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 129
  • #21 _g_closure_invoke_va
    at gclosure.c line 867
  • #22 g_signal_emit_valist
    at gsignal.c line 3300
  • #23 g_signal_emit
    at gsignal.c line 3466
  • #24 gtk_widget_event_internal
    at gtkwidget.c line 7738
  • #25 propagate_event_up
    at gtkmain.c line 2582
  • #26 propagate_event
    at gtkmain.c line 2684
  • #27 gtk_main_do_event
    at gtkmain.c line 1915
  • #28 _gdk_event_emit
    at gdkevents.c line 73
  • #29 gdk_event_source_dispatch
    at gdkeventsource.c line 367
  • #30 g_main_dispatch
    at gmain.c line 3165
  • #31 g_main_context_dispatch
    at gmain.c line 3818
  • #32 g_main_context_iterate
    at gmain.c line 3891
  • #33 g_main_loop_run
    at gmain.c line 4087
  • #34 gtk_main
    at gtkmain.c line 1323
  • #35 main
    at combo.c line 132
A debugging session is active.

	Inferior 1 [process 2348] will be killed.

Quit anyway? (y or n) y

Peter Onion
Comment 1 Daniel Boles 2018-02-23 11:58:10 UTC

*** This bug has been marked as a duplicate of bug 703511 ***
Comment 2 Daniel Boles 2018-02-23 12:00:28 UTC
When you say "a combobox in a treeview cell", can you show a minimal example of how you set the widgets up? Also, are you using the appears-as-list style property?
Comment 3 Peter.Onion 2018-02-23 12:40:41 UTC
Created attachment 368822 [details]
galde file for combo.c
Comment 4 Peter.Onion 2018-02-23 12:41:18 UTC
Created attachment 368823 [details]
combo.c that shows the glib warnings
Comment 5 Peter.Onion 2018-02-23 12:43:07 UTC
I've attached tvtest.glade and combo.c that show the problem.
The warnings appear when selecting an item from the drop down.
PeterO
Comment 6 Daniel Boles 2018-02-23 12:45:11 UTC
Thanks for those. I don't see any such errors here (although clicking on the item in the popup does not update the value shown in the combobox cell).

to rephrase: are you using a GTK+ theme that enforces the appears-as-list style property?
Comment 7 Peter.Onion 2018-02-23 12:50:54 UTC
Yes the value doesn't get updated.  I originally came across this problem using some python where the text from the entry is expected to be a fraction (eg. 1/5).

I produced the C version because I felt it would be more acceptable to report a bug with some C code that with Python code :-)

I'm not aware of the  "appears-as-list" property so I don't think I'm using it.

PeterO
Comment 8 Daniel Boles 2018-02-23 12:53:03 UTC
(In reply to Peter.Onion from comment #7)
> I'm not aware of the  "appears-as-list" property so I don't think I'm using
> it.

What GTK+ theme are you using? The theme can enforce that style property if it chooses. I keep asking this because a very similar report linked earlier depends on appears-as-list being TRUE.
Comment 9 Peter.Onion 2018-02-23 12:57:50 UTC
I don't know what "GTK+ theme" I'm using.  
I've not set anything about themes so I don't know how to find out.
I'm just using what came out of the box on latest Raspbian.

Sorry not to me more helpful.

PeterO
Comment 10 Peter.Onion 2018-02-23 13:13:05 UTC
I just build my code on a MINT-18.2 x86-64 machine and I get the same warnings.
PeterO
Comment 11 Daniel Boles 2018-02-23 13:15:52 UTC
Which point release of 3.22.x are these systems on? You can get this from your package manager or gtk3-widget-factory => About.
Comment 12 Peter.Onion 2018-02-23 13:28:08 UTC
On Raspbian it is 3.22.28 (which I've build from source)
On Mint it is 3.18.9 (from the distribution).
PeterO
Comment 13 GNOME Infrastructure Team 2018-05-02 19:54:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/1037.