GNOME Bugzilla – Bug 795014
Editing register when GTK_IM_MODULE=xim segfaults
Last modified: 2018-06-30 00:07:23 UTC
Entering any character in the register when GTK_IM_MODULE=xim causes a segfault in Gnucash 3.0 1) Launch gnucash with GTK_IM_MODULE=xim and unset XMODIFIERS 2) Open the register and type any character The following stack trace is obtained. The cause seems to be a NULL client_window in the GtkIMContextXIM instance. Thread 1 "gnucash" received signal SIGSEGV, Segmentation fault. 0x00007ffff4315582 in gdk_window_has_impl (window=<optimized out>) at gdkwindow.c:677 677 gdkwindow.c: Aucun fichier ou dossier de ce type. (gdb) bt
+ Trace 238538
$1 = {object = {parent_instance = {g_type_instance = {g_class = 0x555556bf3bd0}, ref_count = 1, qdata = 0x0}}, im_info = 0x0, locale = 0x555555acbb00 "fr_FR.utf8", mb_charset = 0x555556b382d0 "UTF-8", client_window = 0x0, client_widget = 0x0, status_window = 0x0, preedit_size = 0, preedit_length = 0, preedit_chars = 0x0, feedbacks = 0x0, preedit_cursor = 0, preedit_start_callback = {client_data = 0x0, callback = 0x0}, preedit_done_callback = {client_data = 0x0, callback = 0x0}, preedit_draw_callback = {client_data = 0x0, callback = 0x0}, preedit_caret_callback = {client_data = 0x0, callback = 0x0}, status_start_callback = {client_data = 0x0, callback = 0x0}, status_done_callback = {client_data = 0x0, callback = 0x0}, status_draw_callback = {client_data = 0x0, callback = 0x0}, string_conversion_callback = {client_data = 0x0, callback = 0x0}, ic = 0x0, filter_key_release = 0, use_preedit = 1, finalizing = 0, in_toplevel = 0, has_focus = 1}
We need a few more stack frames, but if gnucash_sheet_key_press_event is the only gnucash function between the g_main_loop call and the crash, it's Gtk, not GnuCash, that's causing the crash.
Here is the full stack:
+ Trace 238539
So as I expected, it's just calling the register's key handler... and the first thing that does is call gtk_im_multicontext_filter_keypress, which proceeds to crash. The Gtk devs will need all sorts of build details about Gtk and maybe GLib, so I suggest that you raise a bug with your distro and let them take it to Gtk. I'll leave this open for a while so that if they want to use it they can.
Thanks for your answer. It seems that someone already reported it on Gtk side here: https://gitlab.gnome.org/GNOME/gtk/issues/61
OK. That's not in bugzilla and IIRC the original was from the mailing list, so I can't close this as a dupe. I'm a bit at a loss, so I'll go with "incomplete".
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=795014. Please update any external references or bookmarks.