segfault when used in plugin load, unload, load cycle
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Messaging Menu |
Fix Released
|
High
|
Unassigned | ||
indicator-messages (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Quantal |
Won't Fix
|
High
|
Unassigned |
Bug Description
Impact:
libmessaging-menu using apps can segfault when unloading and reloading code
Test Case:
- download the file from comment #1
- gcc test-app.c -o test `pkg-config --cflags --libs messaging-menu`
- run ./test
with the fixed version it shouldn't segfault
Regression Potential:
Limited, check that the usecase is correctly supported
---
I've been experimenting with adding messaging-menu support to an app through a plugin, and I've noticed errors/crashing when recreating the MessagingMenuApp object after having g_object_unref'd it, as in the situation where the user unloads the plugin, then loads it again.
This is the error, which follows from pressing 'Plugin Load', 'Plugin Unload', 'Plugin Load' in the test application:
** (test-app:3805): WARNING **: unable to export action group: An object is already exported for the interface org.gtk.Actions at /com/canonical/
(test-app:3805): GLib-GIO-CRITICAL **: g_dbus_
** (test-app:3805): WARNING **: unable to export menu: (null)
I would include a stack trace but it is not consistent, so I suspect some sort of memory corruption (sometimes it doesn't crash at all, just spins at 100% and brings down compiz). I'm going to take a look at indicator-messages and see if I notice anything but I thought I'd post the bug first, maybe someone could immediately tell what the issue is, or suggest a fix in my code if I am not freeing the object correctly before recreating it.
Related branches
Changed in indicator-messages (Ubuntu): | |
status: | Triaged → In Progress |
importance: | Undecided → High |
Changed in indicator-messages (Ubuntu Precise): | |
importance: | Undecided → High |
status: | New → In Progress |
no longer affects: | indicator-messages (Ubuntu Precise) |
Changed in indicator-messages (Ubuntu Quantal): | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in indicator-messages: | |
status: | Fix Committed → Fix Released |
description: | updated |
description: | updated |
Changed in indicator-messages (Ubuntu): | |
status: | In Progress → Fix Released |
Think I worked it out. The messaging-menu exports both an action group and a menu model, but doesn't unexport them in the dispose. I'll link a branch in a bit that seems to fix the issue.