SEGV if use GtkCellRendererCombo with appears-as-list is true
Submitted by okimoto
Link to original bug (#703511)
Description
Created attachment 248282 Sample code to reproduce problems
I get some errors when I use GtkCellRendererCombo with appears-as-list is true or 1. On the other hand, I get no errors when appears-as-list is false or 0.
I checked several versions of Gtk+ as followings. Please refer attached sample code.
- 2.28.14 (no SEGV but display CRITICAL message)
- 3.8.2 (no SEGV but display CRITICAL message)
- 3.9.6 (SEGV)
- master@96abd26 (SEGV)
How to reproduce.
- Build sample code for Gtk2
$ gcc -g3
pkg-config --cflags --libs gtk+-2.0
sample3.c -o sample3-gtk2
gtkrc:
style "appears-as-list" { GtkComboBox::appears-as-list = 1 }
class "GtkComboBox" style "appears-as-list"
for Gtk3
$ gcc -g3
pkg-config --cflags --libs gtk+-3.0
sample3.c -o sample3-gtk3
gtk.css:
- { -GtkComboBox-appears-as-list: true; }
- Run sample and change combobox value.
3-1. Displays CRITICAL message as following
On 2.28.14 and 3.8.2.
(sample3-gtk2:32223): GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed
3-2. SEGV and get backtrace as following
On 3.9.2 and master@96abd26.
Program received signal SIGSEGV, Segmentation fault. g_type_check_instance_cast (type_instance=type_instance@entry=0x7a64b0, iface_type=iface_type@entry=80) at gtype.c:4008 4008 node = lookup_type_node_I (type_instance->g_class->g_type); (gdb) bt #0 g_type_check_instance_cast (type_instance=type_instance@entry=0x7a64b0, iface_type=iface_type@entry=80) at gtype.c:4008 #1 (closed) 0x00007ffff7797889 in gtk_combo_box_set_active_internal (combo_box=combo_box@entry=0x7a64b0, path=path@entry=0x7bb540) at gtkcombobox.c:4383 #2 (closed) 0x00007ffff779c5be in gtk_combo_box_set_active_iter (combo_box=0x7a64b0, iter=) at gtkcombobox.c:4440 #3 (closed) 0x00007ffff779c9c1 in gtk_combo_box_list_button_released (widget=, event=, data=) at gtkcombobox.c:3753 #4 (closed) 0x00007ffff78454ae in _gtk_marshal_BOOLEAN__BOXEDv (closure=0x7afa10, return_value=0x7fffffffd490, instance=, args=, marshal_data=, n_params=, param_types=0x6562a0) at gtkmarshalers.c:130 #5 (closed) 0x00007ffff6096e37 in _g_closure_invoke_va (closure=0x7afa10, return_value=0x7fffffffd490, instance=0x6848f0, args=0x7fffffffd588, n_params=1, param_types=0x6562a0) at gclosure.c:840 #6 (closed) 0x00007ffff60b0a99 in g_signal_emit_valist (instance=0x6848f0, signal_id=, detail=, var_args=var_args@entry=0x7fffffffd588) at gsignal.c:3234 #7 (closed) 0x00007ffff60b1362 in g_signal_emit (instance=instance@entry=0x6848f0, signal_id=, detail=detail@entry=0) at gsignal.c:3382 #8 (closed) 0x00007ffff798a224 in gtk_widget_event_internal (widget=widget@entry=0x6848f0, event=event@entry=0x7d10d0) at gtkwidget.c:7110 #9 (closed) 0x00007ffff798a4f9 in gtk_widget_event (widget=widget@entry=0x6848f0, event=event@entry=0x7d10d0) at gtkwidget.c:6772 #10 (closed) 0x00007ffff784379c in propagate_event_up (topmost=, event=, widget=0x6848f0) at gtkmain.c:2394 #11 (closed) propagate_event (widget=, event=0x7d10d0, captured=, topmost=0x0) at gtkmain.c:2502 #12 (closed) 0x00007ffff784506a in gtk_main_do_event (event=0x7d10d0) at gtkmain.c:1717 #13 (closed) 0x00007ffff744a342 in gdk_event_source_dispatch (source=source@entry=0x6137a0, callback=, user_data=) at gdkeventsource.c:364 #14 (closed) 0x00007ffff5da6a06 in g_main_dispatch (context=0x613890) at gmain.c:3058 #15 g_main_context_dispatch (context=context@entry=0x613890) at gmain.c:3634 #16 (closed) 0x00007ffff5da6d58 in g_main_context_iterate (context=0x613890, block=block@entry=1, dispatch=dispatch@entry=1, self=) at gmain.c:3705 #17 (closed) 0x00007ffff5da715a in g_main_loop_run (loop=0x789470) at gmain.c:3899 #18 (closed) 0x00007ffff784458d in gtk_main () at gtkmain.c:1157 #19 (closed) 0x0000000000402607 in main (argc=1, argv=0x7fffffffd988) at sample3.c:363
Thanks.
Attachment 248282, "Sample code to reproduce problems":
sample3.c