Medit crashes in unity_gtk_action_group_connect_item

Bug #1313184 reported by Yevgen Muntyan
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
unity-gtk-module (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Medit crashes for no particular reason on Ubuntu 14.04: http://sourceforge.net/p/mooedit/bugs/177/, it happens both with newest medit sources and with medit package shipped with ubuntu. Debugger says that the problem is in unity_gtk_action_group_connect_item(), which tries to add a null string to a hash, call stack below (I couldn't make apport work for me). Relevant medit code is here:
https://bitbucket.org/medit/medit/raw/9a939f3f31de867326b3c5904a7ce550e6594024/moo/mooutils/mooencodings.c
see update_recent_list_visibility(), which calls gtk_widget_show() on a menu item.

#0 g_str_hash (v=0x0) at /build/buildd/glib2.0-2.40.0/./glib/ghash.c:1802
#1 0x00007ffff51eb040 in g_hash_table_lookup_node (
    hash_return=<synthetic pointer>, key=0x0, hash_table=0xfd8aa0)
    at /build/buildd/glib2.0-2.40.0/./glib/ghash.c:368
#2 g_hash_table_insert_internal (hash_table=0xfd8aa0, key=0x0,
    value=0x10ab000, keep_new_key=0)
    at /build/buildd/glib2.0-2.40.0/./glib/ghash.c:1171
#3 0x00007fffef064a62 in unity_gtk_action_group_connect_item (group=0xf68830,
    item=item@entry=0x10ab000) at ../../../lib/unity-gtk-action-group.c:849
#4 0x00007fffef05e852 in unity_gtk_menu_shell_show_item (
    shell=shell@entry=0x9b74c0, item=item@entry=0x10ab000)
    at ../../../lib/unity-gtk-menu-shell.c:180
#5 0x00007fffef0605f6 in unity_gtk_menu_shell_handle_item_visible (
    item=0x10ab000, shell=0x9b74c0) at ../../../lib/unity-gtk-menu-shell.c:416
#6 unity_gtk_menu_shell_handle_item_notify (shell=0x9b74c0, item=0x10ab000,
    property=<optimized out>) at ../../../lib/unity-gtk-menu-shell.c:1017
#7 0x00007ffff54cb3b8 in g_closure_invoke (closure=0x10d6720,
    return_value=0x0, n_param_values=2, param_values=0x7fffffffd900,
    invocation_hint=0x7fffffffd8a0)
    at /build/buildd/glib2.0-2.40.0/./gobject/gclosure.c:768
#8 0x00007ffff54dcd3d in signal_emit_unlocked_R (node=node@entry=0x8ad420,
    detail=detail@entry=281, instance=instance@entry=0xea9e40,
    emission_return=emission_return@entry=0x0,
    instance_and_params=instance_and_params@entry=0x7fffffffd900)
    at /build/buildd/glib2.0-2.40.0/./gobject/gsignal.c:3551
#9 0x00007ffff54e4a29 in g_signal_emit_valist (instance=<optimized out>,
    signal_id=<optimized out>, detail=<optimized out>,
    var_args=var_args@entry=0x7fffffffda98)
    at /build/buildd/glib2.0-2.40.0/./gobject/gsignal.c:3307
#10 0x00007ffff54e4ce2 in g_signal_emit (instance=<optimized out>,
    signal_id=<optimized out>, detail=<optimized out>)
    at /build/buildd/glib2.0-2.40.0/./gobject/gsignal.c:3363
#11 0x00007ffff54cf725 in g_object_dispatch_properties_changed (
    object=0xea9e40, n_pspecs=0, pspecs=0x10ab000)
    at /build/buildd/glib2.0-2.40.0/./gobject/gobject.c:1053
#12 0x00007ffff54d1ceb in g_object_notify_by_spec_internal (
    pspec=<optimized out>, object=0xea9e40)
    at /build/buildd/glib2.0-2.40.0/./gobject/gobject.c:1147
#13 g_object_notify (object=object@entry=0xea9e40,
    property_name=property_name@entry=0x7ffff6c56e96 "visible")
    at /build/buildd/glib2.0-2.40.0/./gobject/gobject.c:1194
#14 0x00007ffff6b1bdc5 in IA__gtk_widget_show (widget=0xea9e40)
    at /build/buildd/gtk+2.0-2.24.23/gtk/gtkwidget.c:3237
#15 0x00000000004c4228 in update_recent_list_visibility (action=0xd9d420)
    at ../../moo/mooutils/mooencodings.c:1234
#16 0x00007ffff51fbce5 in g_main_dispatch (context=0x8ced20)
    at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3064
#17 g_main_context_dispatch (context=context@entry=0x8ced20)
    at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3663
#18 0x00007ffff51fc048 in g_main_context_iterate (context=0x8ced20,
    block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3734
#19 0x00007ffff51fc30a in g_main_loop_run (loop=0x8a3030)
    at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3928
#20 0x00007ffff6a04417 in IA__gtk_main ()
    at /build/buildd/gtk+2.0-2.24.23/gtk/gtkmain.c:1271
#21 0x0000000000553b15 in moo_app_run (app=app@entry=0x91b6c0)
    at ../../moo/mooapp/mooapp.c:908
#22 0x000000000044c172 in medit_main (argv=<optimized out>,
    argc=<optimized out>) at ../../moo/medit-app/main.c:843
#23 main (argc=<optimized out>, argv=<optimized out>)
    at ../../moo/medit-app/main.c:854

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: libunity-gtk2-parser0 0.0.0+14.04.20140403-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Apr 26 12:30:53 2014
InstallationDate: Installed on 2014-04-24 (2 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: unity-gtk-module
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Yevgen Muntyan (muntyan-fastmail) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-gtk-module (Ubuntu):
status: New → Confirmed
Revision history for this message
Charles Kerr (charlesk) wrote :

looks like unity_gtk_action_group_get_state_name() is returning NULL s.t. NULL is passed as a key into a GHashTable that's using g_str_hash().

The crash could be solved with a simple NULL guard before passing a NULL key into a g_hash_table_*() function; however I'm not sure why _get_state_name() is returning NULL in the first place.

Revision history for this message
William Hua (attente) wrote :

Charles is right, unity-gtk-module tries to infer a good name for the radio action state, but in this case, it couldn't find one because of a lack of label and action. But rather than a NULL guard (which would prevent selecting it), we can only make up a unique (but bad) name for it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-gtk-module - 0.0.0+14.10.20140716-0ubuntu1

---------------
unity-gtk-module (0.0.0+14.10.20140716-0ubuntu1) utopic; urgency=low

  [ William Hua ]
  * Make up a bad state name if we can't infer a good name from a radio
    menu item's label or action. (LP: #1313184)
  * Forward show and hide signals to GTK+ menus. (LP: #1208019)
  * Disable unity-gtk-module on non-Unity desktops. (LP: #1307657)
 -- Ubuntu daily release <email address hidden> Wed, 16 Jul 2014 16:45:42 +0000

Changed in unity-gtk-module (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Makronas (makronas) wrote :

Is bug fixed only for Ubuntu 14.10? I use Ubuntu 14.04 and medit still crashes. What users of Ubuntu 14.04 should do?

Revision history for this message
mahmoud fahmy (mah-fahmyy) wrote :

I'm facing that problem which the medit crashes not in particular time sometimes when i first run it then after , so is there anyhelp ??

Revision history for this message
Pascal Mons (anton+) wrote :

Following-up on this bug in my Ubuntu Trusty 14.04 and to answer Makronas request for a fix in Trusty 14.04, I have set-up a build for Trusty 14.04 from the source of Utopic which are available here:

https://launchpad.net/ubuntu/+source/unity-gtk-module/0.0.0+14.10.20140716-0ubuntu1

In one of my Launchpad PPA along with the latest version of medit which is 1.2.0

Just install my Miscellaneous PPA with these cmd. lines:

$ sudo apt-add-repository ppa:anton+/miscellaneous
$ sudo apt-get update

Then your Trusty 14.04 system will pick up the update ...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.