GNOME Bugzilla – Bug 665044
Crash when saving new file
Last modified: 2018-03-26 15:22:28 UTC
Created attachment 202291 [details] glade3-3.8.1-null-filename-on-mtime.patch Basically sending a null to g_stat() gets to g_utf8_to_utf16() and do not trigger g_return_val_if_fail() with release build. Backtrace: Breakpoint 1, g_return_if_fail_warning (log_domain=0x68694096 "GLib", pretty_function=0x686941f9 "g_utf8_to_utf16", expression=0x686940b2 "str != NULL") at gmessages.c:586 586 g_log (log_domain, (gdb) bt
+ Trace 229157
Thanks for reporting. Just curiously, how is this a crash and not a runtime warning ?? g_return_val_if_fail() statements are not compiled out of GLib production builds, if it were the case we would have lots of problems...
Seems that Glib defines G_DISABLE_CHECKS with --enable-debug=yes which causes the g_return_*() macros to become NOPs. 2.28.8 anyhow - not sure with 2.30, as I need to patch libglade to work with it.
That should be: --enable-debug=no
Just say if that is the wrong thing to do, as I am currently trying to debug a problem when using the Tool/Menu Bar editors and changing the type, that button_editor->loaded_widget->project is NULL. It does not seem to be an issue in general, but once again g_return_*() do not return and ...
(In reply to comment #4) > Just say if that is the wrong thing to do, as I am currently trying to debug a > problem when using the Tool/Menu Bar editors and changing the type, that > button_editor->loaded_widget->project is NULL. It does not seem to be an issue > in general, but once again g_return_*() do not return and ... It's the wrong thing to do ;-) I was not aware of the exact configure flag which does that but you can read up on it here: http://developer.gnome.org/glib/2.30/glib-building.html Quoted from above link: "Note that 'no' is fast, but dangerous as it tends to destabilize even mostly bug-free software by changing the effect of many bugs from simple warnings into fatal crashes. Thus --enable-debug=no should not be used for stable releases of GLib." And quoting Matthias just now on irc ;-) <mclasen> nobody should build with --enable-debug=no, ever
Figures =) Think I added that to my build scripts sometime when switching between stripping with some CFLAGS, or no stripping with -g, but haven't read the building docs in a while. Guess the point is moot then, and the bug can be closed. Just a last question, like mentioned above, when changing a Tool/Menu Button's type via the editor - during the Delete/Add of the old/new widget - project_changed() gets called then glade_editable_load(), etc. - leading to glade_tool_button_editor_load() and glade_activatable_editor_load() trying to access activatable_editor->loaded_widget->project - and later lade_project_get_format() and glade_eprop_object_load() similar Is project supposed to be not set, or should I add a bug for that? Its quite a few warnings and critical errors (a few backtraces below): ----------- (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_ref: assertion `G_I S_OBJECT (object)' failed (glade-3.exe:14976): GladeUI-CRITICAL **: glade_project_get_format: assertion `G LADE_IS_PROJECT (project)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed (glade-3.exe:14976): GLib-GObject-WARNING **: invalid (NULL) pointer instance (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matc hed: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (glade-3.exe:14976): GLib-GObject-CRITICAL **: g_object_weak_unref: assertion `G _IS_OBJECT (object)' failed ----------- First (delete): Breakpoint 1, g_return_if_fail_warning (log_domain=0x63a71d30 "GLib-GObject", pretty_function=0x63a731e0 "g_signal_handlers_disconnect_matched", expression=0x63a71ebc "G_TYPE_CHECK_INSTANCE (instance)") at gmessages.c:586 586 g_log (log_domain, (gdb) bt
+ Trace 229158
(In reply to comment #6) > Figures =) Think I added that to my build scripts sometime when switching > between stripping with some CFLAGS, or no stripping with -g, but haven't read > the building docs in a while. > > Guess the point is moot then, and the bug can be closed. Not exactly moot, but at least not a 'crasher' ;-) Probably the "Save" button should be insensitive while there is no text in the filechooser dialog entry... > Just a last question, like mentioned above, when changing a Tool/Menu Button's > type via the editor > - during the Delete/Add of the old/new widget > - project_changed() gets called then glade_editable_load(), etc. > - leading to glade_tool_button_editor_load() and > glade_activatable_editor_load() trying to access > activatable_editor->loaded_widget->project > - and later lade_project_get_format() and glade_eprop_object_load() similar > > Is project supposed to be not set, or should I add a bug for that? Its quite a > few warnings and critical errors (a few backtraces below): The project will inevitably be unset after removing a widget from a project, this is a change from Glade 3.6.x software which is a cleanup and improvement for the most part, but could have bad consequences for some unsuspecting higher-level editors (like apparently this one). To address a similar problem, glade_command_add() has been newly exposed to help cope with "Context Menu -> Add Parent / Remove Parent" actions, I don't think that's relevant for changing types... possibly the type changing code in glade-base-editor.c needs to be upgraded to save the project pointer or such... (don't let this text throw you off or confuse you too much... I would need to look at this type-changing bug closer to really have an opinion on how to fix it...).
(In reply to comment #7) > (In reply to comment #6) > > Figures =) Think I added that to my build scripts sometime when switching > > between stripping with some CFLAGS, or no stripping with -g, but haven't read > > the building docs in a while. > > > > Guess the point is moot then, and the bug can be closed. > > Not exactly moot, but at least not a 'crasher' ;-) > > Probably the "Save" button should be insensitive while there is no > text in the filechooser dialog entry... > It was not with an empty entry :) Its because of this code (first call): ----- glade-window.c ------ /* check for external modification to the project file */ mtime = glade_util_get_file_mtime (glade_project_get_path (project), NULL); if (mtime > glade_project_get_file_mtime (project)) { ----------- which gets called with: project->priv->path = NULL because the path is not yet set in the private data. I do not think you will get it (or any message for that matter) on Linux, as it does not make the call to g_utf8_to_utf16() as needed for _wstat() on win32. > > Just a last question, like mentioned above, when changing a Tool/Menu Button's > > type via the editor > > - during the Delete/Add of the old/new widget > > - project_changed() gets called then glade_editable_load(), etc. > > - leading to glade_tool_button_editor_load() and > > glade_activatable_editor_load() trying to access > > activatable_editor->loaded_widget->project > > - and later lade_project_get_format() and glade_eprop_object_load() similar > > > > Is project supposed to be not set, or should I add a bug for that? Its quite a > > few warnings and critical errors (a few backtraces below): > > The project will inevitably be unset after removing a widget from a project, > this is a change from Glade 3.6.x software which is a cleanup and improvement > for the most part, but could have bad consequences for some unsuspecting > higher-level editors (like apparently this one). > > To address a similar problem, glade_command_add() has been newly exposed > to help cope with "Context Menu -> Add Parent / Remove Parent" actions, > I don't think that's relevant for changing types... possibly the type > changing code in glade-base-editor.c needs to be upgraded to save the > project pointer or such... (don't let this text throw you off or confuse > you too much... I would need to look at this type-changing bug closer > to really have an opinion on how to fix it...). No problem. Let me know if I should file an additional bug report or not. Or if you fix it for the 3.10 branch, but the 3.8 one do not get updated, let me know - I might be able to backport it then, as last I checked GTK3 was still a bit flaky on win32.
-- 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/glade/issues/98.