GNOME Bugzilla – Bug 652512
nm-applet crash in g_hash_table_foreach()
Last modified: 2011-06-20 12:51:25 UTC
From downstream bug report: https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/795871 It seems as though glib 2.29.6 has nm-applet crash in g_hash_table_foreach(). I've spent most of my afternoon trying to track it down to something, but the best I can tell is that the hash_table is NULL when accessed, thought I'm unable to comprehend why. AFAICT the same applies in the git master branch, though after reverting to glib 2.29.4 it works properly. Backtrace is below.
+ Trace 227468
I think you are most likely getting hit by Author: Matthias Clasen <mclasen@redhat.com> 2011-05-20 15:07:08 Committer: Matthias Clasen <mclasen@redhat.com> 2011-05-20 15:07:08 Parent: afc5319a273d2154cb725110f170a7e7c6b87076 (Be more careful when calling destroy notifies) Child: 4ddb84999d47816624f9ae7dcba181cbccd5c4d9 (g_key_file_has_key_full: Clarify the docs) Branches: master, remotes/origin/g-property, remotes/origin/master, wip/typecheck-performance Follows: 2.29.4 Precedes: 2.29.6 Enforce rules about modifying hash tables in callbacks We have the infrastructure to do this, so lets do it. Also add tests for find and foreach to the testsuite. Bug 650688 Which would make this an application bug.
Seemed to me like it was the case, but I looked hard for code that would modify hash tables that way in nm-applet and couldn't find any. There was another bug about dbusmenu though, but that's another library and ubuntu-specific. Now, I can't seem to reproduce the issue, so I think you might as well close it. Sorry for the trouble.
Matthias, wouldn't building with --disable-debug workaround the issue? I've tried a build with that locally and still get crashes.
Either way, more debugging is needed. Unless you have a testcase that involves nothing but a hash table, I still think this is a problem between nm and dbus-glib.
Created attachment 189929 [details] backtrace I've run nm-applet in the debugger with glib2-2.29.8-1. The problem is in nm_client_add_and_activate_connection(). There is a partial connection (not NULL) pass to it. But nm_connection_to_hash() return NULL and thus NULL hash is passed to org_freedesktop_NetworkManager_add_and_activate_connection_async()
Fixed in master: b4a72d1ad794aef4c623fd530fc38ceb9b95456d
*** Bug 652509 has been marked as a duplicate of this bug. ***