Jonny Lamb | 28 Nov 00:49
Favicon

Bug#507097: Segmentation fault in GtkTrayIcon

Package: libgtk2.0-0
Version: 2.12.11-4
Severity: important
Tags: patch

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.
[Switching to Thread 0x7f97ffbf5780 (LWP 10475)]
0x00007f97fa5be376 in gtk_tray_icon_manager_filter
(xevent=0x7fff07d34f20, event=0x2c32e70, user_data=<value optimized
out>) at /scratch/build-area/gtk+2.0-2.12.11/gtk/gtktrayicon-x11.c:236
236	/scratch/build-area/gtk+2.0-2.12.11/gtk/gtktrayicon-x11.c: No
such file or directory.
	in /scratch/build-area/gtk+2.0-2.12.11/gtk/gtktrayicon-x11.c
	(gdb) bt
#0  0x00007f97fa5be376 in gtk_tray_icon_manager_filter
	(xevent=0x7fff07d34f20, event=0x2c32e70, user_data=<value
	optimized out>) at
	/scratch/build-area/gtk+2.0-2.12.11/gtk/gtktrayicon-x11.c:236
#1  0x00007f97f9eac09a in gdk_event_translate (display=0xf65000,
	event=0x2c32e70, xevent=0x7fff07d34f20, return_exposes=0) at
	/scratch/build-area/gtk+2.0-2.12.11/gdk/x11/gdkevents-x11.c:345
#2  0x00007f97f9eadb87 in _gdk_events_queue (display=0xf65000) at
	/scratch/build-area/gtk+2.0-2.12.11/gdk/x11/gdkevents-x11.c:2285
#3  0x00007f97f9eadf5e in gdk_event_dispatch (source=<value optimized
(Continue reading)

Bug#507097: Segmentation fault in GtkTrayIcon

Jonny Lamb wrote:
> Anyway, I attach a patch which appears to fix my problem, but I'm not
> confident it's the "correct" fix, and I haven't been able to thoroughly
> test it. Comments welcome!

I think you forgot to attach it :-)

Cheers,
Emilio
Jonny Lamb | 28 Nov 09:29
Favicon

Bug#507097: Segmentation fault in GtkTrayIcon

On Fri, Nov 28, 08:53:57 +0100, Emilio Pozuelo Monfort wrote:
> I think you forgot to attach it :-)

Classic! Here is the patch.

Thanks,

-- 
Jonny Lamb, UK
jonny <at> debian.org
diff -Nruad -Nraud gtk+2.0-2.12.11.orig/gtk/gtktrayicon-x11.c gtk+2.0-2.12.11/gtk/gtktrayicon-x11.c
--- gtk+2.0-2.12.11.orig/gtk/gtktrayicon-x11.c	2008-11-27 23:50:01.000000000 +0000
+++ gtk+2.0-2.12.11/gtk/gtktrayicon-x11.c	2008-11-27 23:50:57.000000000 +0000
@@ -224,6 +224,10 @@
   GtkTrayIcon *icon = user_data;
   XEvent *xev = (XEvent *)xevent;

+  /* The tray icon could already have been finalized. */
+  if (icon->priv == NULL)
+    return GDK_FILTER_REMOVE;
+
   if (xev->xany.type == ClientMessage &&
       xev->xclient.message_type == icon->priv->manager_atom &&
       xev->xclient.data.l[1] == icon->priv->selection_atom)
Josselin Mouette | 28 Nov 09:55
Favicon

Bug#507097: Segmentation fault in GtkTrayIcon

Le vendredi 28 novembre 2008 à 08:29 +0000, Jonny Lamb a écrit :
> On Fri, Nov 28, 08:53:57 +0100, Emilio Pozuelo Monfort wrote:
> > I think you forgot to attach it :-)
> 
> Classic! Here is the patch.

Thanks. Two remarks:
      * This is actually a bug in epiphany, this patch only hides it.
      * Instead of just hiding it, it should be turned into a critical
        warning with g_return_val_if_fail (icon->priv != NULL,
        GDK_FILTER_REMOVE).

Cheers,
--

-- 
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.

Gmane