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 524706 - Add to playlist causes banshee to hang
Add to playlist causes banshee to hang
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
git master
Other All
: Normal critical
: 0.99.1
Assigned To: Banshee Maintainers
Banshee Maintainers
: 524915 529143 568141 569384 570949 593979 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-27 20:02 UTC by Caleb Sawtell
Modified: 2009-09-03 19:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debugging patch (2.20 KB, text/plain)
2008-04-08 06:52 UTC, Gabriel Burt
  Details
Move the gtk-menu-popup-delay override to be called whenever StyleSet (1.64 KB, patch)
2009-04-30 17:29 UTC, Gabriel Burt
committed Details | Review

Description Caleb Sawtell 2008-03-27 20:02:35 UTC
Steps to reproduce:
1. play music
2. click on add to playlist
3. hang


Stack trace:
Domain: 'Gtk' Level: Critical
Message: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Trace follows:
   at GLib.Log.PrintTraceLogFunction(System.String domain, LogLevelFlags level, System.String message)
   at GLib.Log.PrintTraceLogFunction(IntPtr , LogLevelFlags , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run()
   at Banshee.Gui.GtkBaseClient.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at Banshee.Gui.GtkBaseClient.Entry()
   at Nereid.Client.Main()
Domain: 'Gtk' Level: Critical
Message: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Trace follows:
   at GLib.Log.PrintTraceLogFunction(System.String domain, LogLevelFlags level, System.String message)
   at GLib.Log.PrintTraceLogFunction(IntPtr , LogLevelFlags , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run()
   at Banshee.Gui.GtkBaseClient.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at Banshee.Gui.GtkBaseClient.Entry()
   at Nereid.Client.Main()


Other information:
Comment 1 Matt Enright 2008-03-28 14:43:32 UTC
I get the same problem with svn trunk, gtk# version 2.10.2 - anytime I mouse over the 'Add to Playlist' menu item the submenu is not properly drawn and the above critical error is given - banshee hangs, and my entire desktop is unresponsive - I'm forced to kill banshee from an ssh terminal.

I tracked down the issue tosrc/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs:286 - Action.Proxies isn't casting properly to a MenuItem. The (o as Gtk.Action).Proxies call isn't causing the hang itself, but if I replace the cast as below there is no hang and the (empty) submenu draws correctly - but obviously there is no functionality in place now, so its just a disabling workaround for the time being (so I can stop inadvertently crashing banshee when I go to the wrong menu).

Unfortunately my gtk-fu is nowhere near up to par and I can't work around this, but hopefully this can help somebody else to find a fix (and I'd be interesting in seeing how it should be done).


Index: src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
===================================================================
--- src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs	(revision 3574)
+++ src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs	(working copy)
@@ -285,9 +285,10 @@
             Gdk.Pixbuf pl_pb = Gdk.Pixbuf.LoadFromResource ("source-playlist-16.png");
             Source active_source = ServiceManager.SourceManager.ActiveSource;
	
             // TODO find just the menu that was activated instead of modifying all proxies
-            foreach (MenuItem menu in (o as Gtk.Action).Proxies) {
+            foreach (Gtk.Widget w in (o as Gtk.Action).Proxies) {
+		 MenuItem menu = new MenuItem ();
                 Menu submenu = new Menu ();
                 menu.Submenu = submenu;
Comment 2 Gabriel Burt 2008-03-29 05:17:37 UTC
Thanks for the tip Matt.  Please svn up and test, I committed a similar patch that should fix it.
Comment 3 Gabriel Burt 2008-03-29 07:30:13 UTC
gaminggeek says this doesn't fix it for him, reopening.  Matt, could you test anyway?
Comment 4 Gabriel Burt 2008-03-29 07:31:07 UTC
*** Bug 524915 has been marked as a duplicate of this bug. ***
Comment 5 Jean Azzopardi 2008-03-29 21:05:24 UTC
I also have this bug. I am using gtk-sharp 2.12.0-1 btw, on Arch Linux. (I'm kinda new to all this bug reporting stuff, so please tell me if I need to add more information, thanks.
Comment 6 Diego Escalante Urrelo (not reading bugmail) 2008-04-06 22:11:24 UTC
I can confirm with *just* updated trunk.
Comment 7 Jean Azzopardi 2008-04-07 06:47:00 UTC
New trunk, now it's no longer hanging, it simply throws an exception and crashes. Here is the output:

Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.ArgumentException: 'source-playlist-16.png' is not a valid resource name of assembly 'Banshee.ThickClient, Version=0.98.3.15585, Culture=neutral, PublicKeyToken=null'.
  at Gdk.PixbufLoader.InitFromAssemblyResource (System.Reflection.Assembly assembly, System.String resource) [0x00000] 
  at Gdk.PixbufLoader..ctor (System.Reflection.Assembly assembly, System.String resource) [0x00000] 
  at Gdk.Pixbuf..ctor (System.Reflection.Assembly assembly, System.String resource) [0x00000] 
  at Gdk.Pixbuf.LoadFromResource (System.String resource) [0x00000] 
  at Banshee.Gui.TrackActions.OnAddToPlaylistMenu (System.Object o, System.EventArgs args) [0x00000] in /home/jean/software/applications/banshee-trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs:280 
  at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr data) [0x00000] 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at GLib.Signal.voidObjectCallback(IntPtr handle, IntPtr data)
   at GLib.Signal.voidObjectCallback(IntPtr , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run() in /home/jean/software/applications/banshee-trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:line 113
   at Banshee.Gui.GtkBaseClient.Startup() in /home/jean/software/applications/banshee-trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:line 55
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup) in /home/jean/software/applications/banshee-trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:line 54
   at Banshee.Gui.GtkBaseClient.Entry() in /home/jean/software/applications/banshee-trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:line 50
   at Nereid.Client.Main() in /home/jean/software/applications/banshee-trunk/banshee/src/Clients/Nereid/Nereid/Client.cs:line 45
Comment 8 Gabriel Burt 2008-04-07 16:34:11 UTC
(In reply to comment #7)
> New trunk, now it's no longer hanging, it simply throws an exception and
> crashes. Here is the output:

svn up again, that's been fixed
Comment 9 Jean Azzopardi 2008-04-07 17:11:06 UTC
Yes, it has.. but we're still back to the old error. I just get a bunch of these in the terminal : 

Domain: 'Gtk' Level: Critical
Message: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Trace follows:
   at GLib.Log.PrintTraceLogFunction(System.String domain, LogLevelFlags level, System.String message)
   at GLib.Log.PrintTraceLogFunction(IntPtr , LogLevelFlags , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run()
   at Banshee.Gui.GtkBaseClient.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at Banshee.Gui.GtkBaseClient.Entry()
   at Nereid.Client.Main()

And the same behaviour - gui freeze.
Comment 10 Gabriel Burt 2008-04-08 06:52:19 UTC
Created attachment 108841 [details]
Debugging patch

Please download this patch and apply it to trunk with patch -p0 < track_actions.patch

Reproduce the bug and attach all output starting with the first "AA".
Comment 11 Matt Enright 2008-04-08 12:53:22 UTC
AA
BB
CC
EE
FF
FF2
GG
HH
II
JJ
BB
CC
EE
FF
FF2
GG
HH
II
JJ
KK
Domain: 'Gtk' Level: Critical
Message: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Trace follows:
   at GLib.Log.PrintTraceLogFunction(System.String domain, LogLevelFlags level, System.String message)
   at GLib.Log.PrintTraceLogFunction(IntPtr , LogLevelFlags , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run()
   at Banshee.Gui.GtkBaseClient.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at Banshee.Gui.GtkBaseClient.Entry()
   at Nereid.Client.Main()

(this last error repeats until I kill Banshee from an ssh term)
Comment 12 Jean Azzopardi 2008-04-08 14:20:39 UTC
Same as the above :

(Nereid:4691): Gtk-WARNING **: Shuffle: missing action ShuffleAction
AA
BB
CC
EE
FF
FF2
GG
HH
II
JJ
BB
CC
EE
FF
FF2
GG
HH
II
JJ
KK
Domain: 'Gtk' Level: Critical
Message: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Trace follows:
   at GLib.Log.PrintTraceLogFunction(System.String domain, LogLevelFlags level, System.String message)
   at GLib.Log.PrintTraceLogFunction(IntPtr , LogLevelFlags , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Banshee.Gui.GtkBaseClient.Run()
   at Banshee.Gui.GtkBaseClient.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at Banshee.Gui.GtkBaseClient.Entry()
   at Nereid.Client.Main()
Comment 13 Gabriel Burt 2008-04-21 02:00:23 UTC
*** Bug 529143 has been marked as a duplicate of this bug. ***
Comment 14 Jean Azzopardi 2008-05-07 18:13:10 UTC
Sorry to bother anyone, but I'd like a status update on this bug. It's the only thing holding back Banshee for me, and I believe, many more, and I hope it doesn't make it into the final release, or being ignored. A word or two from a developer would be greatly appreciated.

Thanks!
Jean.
Comment 15 Gabriel Burt 2008-05-07 18:21:50 UTC
Hi Jean,

Well....I think I know what the problem is, but I haven't found a solution yet.

The issue is when a Gtk.Action is activated, we handle it in that method.  But there are several "proxies" (widgets) that can activate it - the context menu and the playback menu.  Ideally when we handle it, we'd get just the proxy that triggered it, and add the submenu to it etc, but there doesn't seem to be a way to do that (that I've found yet, at least).  The crasher you guys are seeing seems to be caused by us setting up the submenu for the proxy that wasn't the trigger.
Comment 16 Jean Azzopardi 2008-05-07 19:35:30 UTC
Hi all.

I've noticed that the bug doesn't manifest if I use the Aurora theme engine. It appears to manifest on all the other theme engines, however.
Comment 17 Jean Azzopardi 2008-05-07 23:17:34 UTC
I found the source of the bug.
In the gnome themes I was using, they weren't setting gtk-menu-popup-delay.
When I set it in a theme's gtkrc, the bug immediately disappears.

To test, open your themes's gtkrc, and add this line at the top of it :
gtk-menu-popup-delay=50
Comment 18 Jean Azzopardi 2008-05-07 23:28:11 UTC
Correction!

The problem was that in ~/.gtkrc-2.0 I had set a line gtk-menu-popup-delay = 0

Commenting out this line or changing it's value to another positive integer will make this bug disappear.

So, to anyone still suffering from this bug, can you check for the existence of such a line in your theme/.gtkrc-2.0?

gtk-menu-popup-delay = 0
Comment 19 Gabriel Burt 2008-05-09 18:17:12 UTC
Gaminggeek, Matt, Diego: Does Jean's fix work for you?
Comment 20 Caleb Sawtell 2008-05-10 03:23:18 UTC
Yep is does for me
Comment 21 Aaron Bockover 2008-05-29 00:02:56 UTC
Until we can find the actual fix here, Banshee will load a custom gtkrc file:

~/.config/banshee-1/gtkrc

Create that file and add this to it:

gtk-menu-popup-delay = 1
Comment 22 Aaron Bockover 2008-05-29 00:57:21 UTC
2008-05-28  Aaron Bockover  <abock@gnome.org>

    * src/Clients/Nereid/Nereid/Client.cs: Force the gtk-menu-popup-delay
    setting to be 225ms (the GTK+ default value) to avoid a nasty bug when
    it is possibly set to 0ms by some gtkrc files (BGO #524706)

...

Going to mark FIXED for now, but it's an ugly hack. The reality is this is probably a race in GTK+ itself.
Comment 23 Gabriel Burt 2009-01-23 00:01:04 UTC
*** Bug 568141 has been marked as a duplicate of this bug. ***
Comment 24 Gabriel Burt 2009-01-23 00:03:44 UTC
Reported by a user on Banshee 1.4.1.  What theme were you using, Matthew?  Can you try other themes?
Comment 25 Matthew McGowan 2009-01-23 20:14:04 UTC
I was using a mash-up of clearlooks and Aurora. I'll try out some different themes and let you know what the results are.
Comment 26 Matthew McGowan 2009-01-24 09:26:57 UTC
I have not tested switching themes but removing gtk-menu-popup-delay = 1 from my gtkrc file did resolve the issue for me.  Thank you Jean Azzopardi for the workaround!
Comment 27 Gabriel Burt 2009-01-27 20:34:29 UTC
*** Bug 569384 has been marked as a duplicate of this bug. ***
Comment 28 Thomas Leberbauer 2009-01-27 20:42:32 UTC
Removing "gtk-menu-popup-delay = 0" from the gtkrc file worked for me. 
Comment 29 Gabriel Burt 2009-02-09 18:09:24 UTC
*** Bug 570949 has been marked as a duplicate of this bug. ***
Comment 30 smol.robert 2009-02-10 09:16:53 UTC
Hi, I reported Bug 570949. I am using Ciano theme and was having:
gtk-menu-popup-delay = 1

but I got the freeze anyway, but once I created 
~/.config/banshee-1/gtkrc (it was not there)
and set
gtk-menu-popup-delay = 1
I cannot experience hang up anymore.
Comment 31 Gabriel Burt 2009-04-30 17:21:04 UTC
Seems like we are running the

Gtk.Rc.ParseString ("gtk-menu-popup-delay = 225");

line too early, before the theme is loaded.  Do we need to listen for StyleChanged or whathaveyou and run that?
Comment 32 Gabriel Burt 2009-04-30 17:29:20 UTC
Created attachment 133674 [details] [review]
Move the gtk-menu-popup-delay override to be called whenever StyleSet

Please apply to git master (http://banshee-project.org/download/development) and let me know if this fixes it for you.
Comment 33 Gabriel Burt 2009-04-30 18:42:03 UTC
Ok, I tested by setting gtk-menu-popup-delay = 0 in my theme's gtkrc, and got the crash w/o this patch, didn't w/ it.  Committed to master and stable branches.
Comment 34 Bertrand Lorentz 2009-09-03 19:38:35 UTC
*** Bug 593979 has been marked as a duplicate of this bug. ***