After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 449858 - [patch] applications crash on fluxbox restart
[patch] applications crash on fluxbox restart
Status: RESOLVED WONTFIX
Product: libegg
Classification: Other
Component: tray
unspecified
Other All
: Normal critical
: ---
Assigned To: Libegg maintenance
Libegg maintenance
Depends on:
Blocks: 372164
 
 
Reported: 2007-06-21 19:48 UTC by Mark Tiefenbruck
Modified: 2010-10-29 10:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that fixes the problem (549 bytes, patch)
2007-06-21 19:49 UTC, Mark Tiefenbruck
needs-work Details | Review

Description Mark Tiefenbruck 2007-06-21 19:48:12 UTC
Steps to reproduce:
1. Run fluxbox.
2. Run a program (say, pidgin) with an eggtray icon.
3. Restart fluxbox.


Stack trace:
  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 88
  • #3 sighandler
    at gtkmain.c line 207
  • #4 <signal handler called>
  • #5 IA__gdk_x11_display_get_xdisplay
    at gdkdisplay-x11.c line 867
  • #6 egg_tray_icon_update_manager_window
    at eggtrayicon.c line 325
  • #7 egg_tray_icon_manager_filter
    at eggtrayicon.c line 380
  • #8 gdk_event_apply_filters
    at gdkevents-x11.c line 343
  • #9 gdk_event_translate
    at gdkevents-x11.c line 892
  • #10 _gdk_events_queue
    at gdkevents-x11.c line 2252
  • #11 gdk_event_dispatch
    at gdkevents-x11.c line 2312
  • #12 IA__g_main_context_dispatch
    at gmain.c line 2045
  • #13 g_main_context_iterate
    at gmain.c line 2677
  • #14 IA__g_main_loop_run
    at gmain.c line 2881
  • #15 IA__gtk_main
    at gtkmain.c line 1154
  • #16 main
    at gtkmain.c line 842


Other information:
That backtrace is against an older version of libegg because that's what's in pidgin. The bug still exists in svn, though. I have a patch to fix this. I'll attach it as soon as bugzilla lets me.
Comment 1 Mark Tiefenbruck 2007-06-21 19:49:56 UTC
Created attachment 90413 [details] [review]
patch that fixes the problem

Don't give a NULL pointer to GDK_DISPLAY_XDISPLAY, since it dereferences without checking it. I also plan to submit a bug to gtk+ about that.
Comment 2 Christian Kirbach 2007-06-21 19:56:22 UTC
thanks for submitting. see Comment #10 in the duplicate report.

*** This bug has been marked as a duplicate of 302549 ***
Comment 3 Emmanuele Bassi (:ebassi) 2007-06-21 21:25:23 UTC
(In reply to comment #1)

> Don't give a NULL pointer to GDK_DISPLAY_XDISPLAY, since it dereferences
> without checking it. I also plan to submit a bug to gtk+ about that.

+  display = gtk_widget_get_display (GTK_WIDGET (icon));
+  g_return_if_fail (GDK_IS_DISPLAY (display));
+
+  xdisplay = GDK_DISPLAY_XDISPLAY (display);

this should be:

  if (gtk_widget_has_display (GTK_WIDGET (icon))
    display = gtk_wigdet_get_display (GTK_WIDGET (icon));
  else
    display = gdk_display_get_default ();

  xdisplay = GDK_DISPLAY_XDISPLAY (display);

in any case, eggtrayicon.c is not maintained anymore and is deprecated by GtkStatusIcon; since libegg is cut-and-paste code you're basically on your own if you want to keep using it.
Comment 4 Mark Tiefenbruck 2007-06-21 21:38:16 UTC
Yes, I knew it was deprecated. The pidgin developers told me that. However, they're still using it to stay compatible with older versions of gtk+. Since other projects probably do the same thing, I figured the bug should be fixed at the source.

As for the fix, I appreciate the comment. I've never coded anything for gtk+, so I was basically just grasping at straws for anything that worked. I'll post a reference to this in the pidgin bug.
Comment 5 Mark Tiefenbruck 2007-06-21 22:22:20 UTC
Hmmm, that code might work better if gtk_widget_has_display() existed. Here's an update for what I'm guessing you mean:

display = gtk_widget_get_display (GTK_WIDGET (icon));
if (!GDK_IS_DISPLAY (display))
  display = gdk_display_get_default ();
Comment 6 Emmanuele Bassi (:ebassi) 2007-06-21 22:33:22 UTC
yeah, I always mess up with gtk_widget_has_screen().

(In reply to comment #5)

> display = gtk_widget_get_display (GTK_WIDGET (icon));
> if (!GDK_IS_DISPLAY (display))
>   display = gdk_display_get_default ();

yeah, this should be enough.
Comment 7 Julien Danjou 2008-11-10 12:53:49 UTC
Why this patch is not yet applied?

There is still many application out there using eggtray for various reason, and most of them are crashing on system tray application restart.
Comment 8 Christian Persch 2008-11-10 15:03:47 UTC
Because eggtrayicon is unmaintained, and should not be used anymore. It should be replaced by GtkStatusIcon whereever you encounter it. Patching the master copy in libegg will not achieve anything, since all apps still need to update their own copy, and if they do change their code they may as well just move to gtkstatusicon already.
Comment 9 Julien Danjou 2008-11-10 15:24:51 UTC
Ok, but what I've heard from several GTK app maintainer is that they do not want to swtich to GtkStatusIcon because it's far less powerful.
Comment 10 André Klapper 2008-11-15 17:13:04 UTC
(In reply to comment #9)
> Ok, but what I've heard from several GTK app maintainer is that they do not
> want to swtich to GtkStatusIcon because it's far less powerful.

Then please tell exactly which features are missing. Things can't be improved if people don't provide patches.
Comment 11 Tobias Mueller 2009-02-23 19:36:22 UTC
So is the patch isn't going to be applied, is this a WONTFIX then?
Comment 12 Murray Cumming 2010-10-29 10:19:50 UTC
EggTrayIcon has been remove from libegg a while ago, so I'll close this as WONTFIX. Thanks for the patch anyway.

However, if GtkStatusIcon is missing something, we really need GTK+ bug reports for that.