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 148803 - FileChooser test program gives Critical warnings
FileChooser test program gives Critical warnings
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.4.x
Other Linux
: High major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2004-07-29 20:33 UTC by Abel Daniel
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
do not call remove_setting when screen is NULL (725 bytes, patch)
2004-08-10 08:55 UTC, Hwang, chideok
none Details | Review

Description Abel Daniel 2004-07-29 20:33:31 UTC
1) it gives warnings when the 'open' toolbaritem is activated:

uimanager.py.co:104: GtkWarning: file gtksettings.c: line 447
(gtk_settings_get_for_screen): assertion `GDK_IS_SCREEN (screen)' failed
  (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,

(uimanager.py.co:1468): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(uimanager.py.co:1468): GLib-GObject-CRITICAL **: file gsignal.c: line 1726
(g_signal_handler_disconnect): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(I don't think example code should give warnings. I mean, warnings is a sign
that something is wrong, right?)

2) it contains an unpythonic iteration over a list:
in fix_actions:

    for i in range(len(actions)):
        curr = actions[i]

instead of simply:

    for curr in actions:
Comment 1 John Finlay 2004-07-29 22:52:19 UTC
I can't reproduce 1) and it looks like the offending line is creating a
FileChooserDialog. What version of gtk and pygtk are you using? Do you get the
same error messages in a simple program just creating a FileChooserDialog?

This isn't a documentation bug.
Comment 2 Abel Daniel 2004-07-30 06:51:54 UTC
Indeed:
>>> import gtk
>>> gtk.FileChooserDialog()
__main__:1: GtkWarning: file gtksettings.c: line 447
(gtk_settings_get_for_screen): assertion `GDK_IS_SCREEN (screen)' failed

(:551): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(:551): GLib-GObject-CRITICAL **: file gsignal.c: line 1726
(g_signal_handler_disconnect): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
<gtk.FileChooserDialog object (GtkFileChooserDialog) at 0x4021ee3c>
>>> gtk.gtk_version
(2, 4, 4)
>>> gtk.pygtk_version
(2, 3, 94)
>>> 
so the warnings come from creating the FileChooserDialog

Is this enough information to reproduce it?



(I actually filed it as a documentation bug because I wanted to file #2 first
which _is_ a documentation bug (example code is part of the documentation, isn't
it?) and only noticed #1 later.)
Comment 3 John Finlay 2004-07-30 20:16:41 UTC
I am using GTK+ 2.4.0 and the problem does not occur. I installed 2.4.4 and the
problem occurs so I would say that this is a GTK+ bug.
Comment 4 Matthias Clasen 2004-07-31 13:05:16 UTC
We need a short selfcontained testcase in C. The warnings by themself don't tell
much. At the very least we need a stacktrace showing where in GTK the warning 
was produced. Run your application in gdb with --g-fatal-warnings, and when the
warning occurs, type bt at the gdb prompt.
Comment 5 John Finlay 2004-07-31 18:51:26 UTC
Running the gtk+-2.4.4/tests/testfilechooser in gdb:

(gdb) bt
  • #0 kill
    from /lib/libc.so.6
  • #1 raise
    from /lib/libc.so.6
  • #2 abort
    from /lib/libc.so.6
  • #3 g_logv
  • #4 g_log
  • #5 gtk_settings_get_for_screen
    at gtksettings.c line 466
  • #6 remove_settings_signal
    at gtkfilechooserdefault.c line 3561
  • #7 gtk_file_chooser_default_screen_changed
    at gtkfilechooserdefault.c line 3680
  • #8 g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #9 g_type_class_meta_marshal
    at gclosure.c line 514
  • #10 g_closure_invoke
    at gclosure.c line 437
  • #11 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #12 g_signal_emit_valist
    at gsignal.c line 2195
  • #13 g_signal_emit
    at gsignal.c line 2239
  • #14 do_screen_change
    at gtkwidget.c line 4765
  • #15 gtk_widget_propagate_hierarchy_changed_recurse
    at gtkwidget.c line 4789
  • #16 gtk_box_forall
    at gtkbox.c line 701
  • #17 gtk_container_forall
    at gtkcontainer.c line 1264
  • #18 gtk_widget_propagate_hierarchy_changed_recurse
    at gtkwidget.c line 4792
  • #19 _gtk_widget_propagate_hierarchy_changed
    at gtkwidget.c line 4829
  • #20 gtk_widget_set_parent
    at gtkwidget.c line 4290
  • #21 gtk_box_pack_start
    at gtkbox.c line 388
  • #22 gtk_file_chooser_dialog_constructor
    at gtkfilechooserdialog.c line 392
  • #23 g_object_newv
    at gobject.c line 941
  • #24 g_object_new_valist
    at gobject.c line 1025
  • #25 g_object_new
    at gobject.c line 822
  • #26 main
    at testfilechooser.c line 411
  • #27 __libc_start_main
    from /lib/libc.so.6

Comment 6 Hwang, chideok 2004-08-10 08:55:45 UTC
Created attachment 30392 [details] [review]
do not call remove_setting when screen is NULL

At creating widget, previous_screen argument can be NULL.
Comment 7 Matthias Clasen 2004-08-13 18:10:46 UTC
Here is the fix that went in

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_style_set): 
	Don't install the settings_notify_cb from here, since it
	may be called before the first screen_changed signal, 
	confusing the logic in gtk_file_chooser_screen_changed().
	(#148803, Abel Daniel)