GNOME Bugzilla – Bug 562535
Segmentation fault in GtkTrayIcon
Last modified: 2010-02-16 19:25:33 UTC
[ Original report: http://bugs.debian.org/507097 by Jonny Lamb ] When using epiphany-gecko, downloading files to disk causes a tray icon to appear to notify that file(s) are being downloaded. However, every two or three downloads makes Epiphany segfault. I installed the necessary debug packages and got the following backtrace: Program received signal SIGSEGV, Segmentation fault.
+ Trace 210300
Thread 140290807519104 (LWP 10475)
(gdb) p icon $1 = (GtkTrayIcon *) 0x2044220 (gdb) p icon->priv $2 = (GtkTrayIconPrivate *) 0x0 I can reproduce this easily by simply right clicking on links and choosing "Save Link As". It appears to work for the first 2-3 downloads and a tray icon appears, but then it segfaults in the aforementioned fashion. The files I downloaded to cause the segfault have all been small and seeing that icon->priv was NULL then the download had completed and the GtkTrayIconPrivate instance freed in the middle of something. [ Additional comments from Joss ] I think this is caused by the fact a new status icon is created every time the download view is started. Instead, it should probably be created once in the shell and just shown/hidden as necessary. The good way to fix this is probably to move the whole status icon logic to ephy-embed-shell.c. I can try to cook a patch of you agree with the idea. Maybe there should also be an additional check in gtk_tray_icon_manager_filter to return a critical warning instead of crashing.
Cosimo, you last worked on this code. What do you think?
My guess is that libnotify is trying to access in some way the status icon after the view has been destroyed: this could happen, as we don't unref the notification when destroying the view. It could be a good idea to move the status icon in a place not directly linked with the view to solve this though.
The bug seems to be in libnotify or gtk+, so maybe you should CC or assign this to them? By the way, Evolution suffers this bug too (bug 569839) or very similar.
Our code changed to avoid this scenario. Closing.