Bug 451001 - Crashes when using the same data for 2 callbacks
Crashes when using the same data for 2 callbacks
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: libnotify (Show other bugs)
11
All Linux
low Severity low
: ---
: ---
Assigned To: Bastien Nocera
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-12 06:02 EDT by Bastien Nocera
Modified: 2009-06-11 16:20 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-11 16:20:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bastien Nocera 2008-06-12 06:02:38 EDT
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-09 21:34:12 EDT
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 10:07:22 EDT
Probably still a problem.
Comment 3 Bastien Nocera 2009-06-11 16:20:13 EDT
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.