Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 451001 - Crashes when using the same data for 2 callbacks
Summary: Crashes when using the same data for 2 callbacks
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libnotify
Version: 11
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Bastien Nocera
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-12 10:02 UTC by Bastien Nocera
Modified: 2009-06-11 20:20 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-11 20:20:13 UTC


Attachments (Terms of Use)

Description Bastien Nocera 2008-06-12 10:02:38 UTC
libnotify-0.4.4-10.fc9.x86_64

The original patch for notifications in gnome-user-share did:
 	notify_notification_add_action (notification, "display", _("Open File"),
notify_notification_add_action (notification, "display", _("Open File"),
	(NotifyActionCallback) notification_launch_action_on_file_cb,
	(gpointer) file_uri, (GFreeFunc) g_free);
notify_notification_add_action (notification, "reveal", _("Reveal File"),
	(NotifyActionCallback) notification_launch_action_on_file_cb,
	(gpointer) file_uri, (GFreeFunc) g_free);

This will crash in libnotify:
==3954== Invalid free() / delete / delete[]
==3954==    at 0x4A0609F: free (vg_replace_malloc.c:323)
==3954==    by 0x3EF1603637: (within /usr/lib64/libnotify.so.1.1.2)
==3954==    by 0x30B2C29891: g_hash_table_remove_node (ghash.c:204)
==3954==    by 0x30B2C2990C: g_hash_table_remove_all_nodes (ghash.c:231)
==3954==    by 0x30B2C2A4F9: g_hash_table_remove_all (ghash.c:914)
==3954==    by 0x30B2C2A604: g_hash_table_destroy (ghash.c:639)
==3954==    by 0x3EF16056AC: (within /usr/lib64/libnotify.so.1.1.2)
==3954==    by 0x30B380D6A7: g_object_unref (gobject.c:1793)
==3954==    by 0x3D53211893: (within /usr/lib64/libdbus-glib-1.so.2.1.0)
==3954==    by 0x30B380B6DC: g_closure_invoke (gclosure.c:490)
==3954==    by 0x30B381F6C0: signal_emit_unlocked_R (gsignal.c:2440)
==3954==    by 0x30B3820B9B: g_signal_emit_valist (gsignal.c:2199)
==3954==  Address 0x4dd5d60 is 0 bytes inside a block of size 51 free'd
==3954==    at 0x4A0609F: free (vg_replace_malloc.c:323)
==3954==    by 0x3EF1603637: (within /usr/lib64/libnotify.so.1.1.2)
==3954==    by 0x30B2C29891: g_hash_table_remove_node (ghash.c:204)
==3954==    by 0x30B2C2990C: g_hash_table_remove_all_nodes (ghash.c:231)
==3954==    by 0x30B2C2A4F9: g_hash_table_remove_all (ghash.c:914)
==3954==    by 0x30B2C2A604: g_hash_table_destroy (ghash.c:639)
==3954==    by 0x3EF16056AC: (within /usr/lib64/libnotify.so.1.1.2)
==3954==    by 0x30B380D6A7: g_object_unref (gobject.c:1793)
==3954==    by 0x3D53211893: (within /usr/lib64/libdbus-glib-1.so.2.1.0)
==3954==    by 0x30B380B6DC: g_closure_invoke (gclosure.c:490)
==3954==    by 0x30B381F6C0: signal_emit_unlocked_R (gsignal.c:2440)
==3954==    by 0x30B3820B9B: g_signal_emit_valist (gsignal.c:2199)

libnotify doesn't realise that the 2 user_data are the same, and tries to free
it twice. The work-around is to duplicate the data for one of the calls.

Original patch is at:
http://bugzilla.gnome.org/show_bug.cgi?id=534794#c5
http://bugzilla.gnome.org/show_bug.cgi?id=534794

Comment 1 Bug Zapper 2009-06-10 01:34:12 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Bastien Nocera 2009-06-11 14:07:22 UTC
Probably still a problem.

Comment 3 Bastien Nocera 2009-06-11 20:20:13 UTC
Matthias was right about the problem being in our code. The destructor will be run twice, and that's our fault.


Note You need to log in before you can comment on or make changes to this bug.