segfault when used in plugin load, unload, load cycle

Bug #1065169 reported by Jason Conti
10
This bug affects 1 person
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/indicator/messages/test_app_desktop

(test-app:3805): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion `error == NULL || *error == NULL' failed

** (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.

Revision history for this message
Jason Conti (jconti) wrote :
Revision history for this message
Jason Conti (jconti) wrote :

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.

Revision history for this message
Lars Karlitski (larsu) wrote :

You're right, the calls to g_dbus_connection_unexport_* are missing. Thanks for reporting this!

Changed in indicator-messages:
milestone: none → 12.10.5
status: New → Triaged
importance: Undecided → High
Revision history for this message
Lars Karlitski (larsu) wrote :

Hi Jason. Sorry I didn't notice your branch until today (the probability of someone seeing it is much higher if you put up a merge request).

The patch is perfect, I've merged it into trunk. Thanks a lot!

Changed in indicator-messages:
status: Triaged → Fix Committed
Changed in indicator-messages (Ubuntu):
status: New → Confirmed
status: Confirmed → Triaged
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
Lars Karlitski (larsu)
Changed in indicator-messages:
status: Fix Committed → Fix Released
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

If a libmessaging-menu client is needed for this test case, then one should be provided. Please do not expect testers to write such clients to fulfill the test case.

Holding this package out of -proposed until a complete test case is available.

Revision history for this message
Lars Karlitski (larsu) wrote :

Comment #1 provides a test case for this bug. Is there anything else you need to test this?

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jason, or anyone else affected,

Accepted indicator-messages into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/indicator-messages/12.10.5-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in indicator-messages (Ubuntu Quantal):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Jason Conti (jconti) wrote :

Test case doesn't crash with the version from -proposed (but does with 12.10.4-0ubuntu1). Looks good to me.

tags: added: verification-done
removed: verification-needed
Changed in indicator-messages (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

quantal has seen the end of its life and is no longer receiving any updates. Marking the quantal task for this ticket as "Won't Fix".

Changed in indicator-messages (Ubuntu Quantal):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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