GNOME Bugzilla – Bug 533099
Crash when selecting multiple tracks
Last modified: 2008-05-17 07:20:33 UTC
Steps to reproduce: 1. Import massive collection of TV episodes 2. Select one season to correct their metadata (ctrl + left mouse button in the listview) 3. Once you reach episode 15 or so the crash occures Stack trace: Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.IndexOutOfRangeException: Array index is out of range. at Hyena.Collections.RangeCollection.Insert (Int32 position, Range range) [0x00022] in /usr/src/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs:149 at Hyena.Collections.RangeCollection.InsertRange (Range range) [0x00026] in /usr/src/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs:193 at Hyena.Collections.RangeCollection.Add (Int32 value) [0x0001a] in /usr/src/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs:327 at Hyena.Collections.Selection.ToggleSelect (Int32 index) [0x00011] in /usr/src/banshee/src/Libraries/Hyena/Hyena.Collections/Selection.cs:73 at Hyena.Data.Gui.ListView`1[Banshee.Collection.TrackInfo].OnListButtonPressEvent (Gdk.EventButton evnt) [0x000e5] in /usr/src/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs:278 at Hyena.Data.Gui.ListView`1[Banshee.Collection.TrackInfo].OnButtonPressEvent (Gdk.EventButton evnt) [0x00061] in /usr/src/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs:208 at Gtk.Widget.buttonpressevent_cb (IntPtr widget, IntPtr evnt) [0x00000] at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) at Gtk.Widget.buttonpressevent_cb(IntPtr widget, IntPtr evnt) at Gtk.Widget.buttonpressevent_cb(IntPtr , IntPtr ) at Gtk.Application.gtk_main() at Gtk.Application.gtk_main() at Gtk.Application.Run() at Banshee.Gui.GtkBaseClient.Run() in /usr/src/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:line 114 at Banshee.Gui.GtkBaseClient.Startup() in /usr/src/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:line 55 at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup) in /usr/src/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:line 54 at Banshee.Gui.GtkBaseClient.Entry() in /usr/src/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:line 50 at Nereid.Client.Main() in /usr/src/banshee/src/Clients/Nereid/Nereid/Client.cs:line 47 Other information: Running SVN 3918 on x86_64 Fedora 9.
I was able to reproduce it, but it's a bit tricky : you have to click on lines that are NOT next to each other, and it happens at the 17th click. I'll attach a one line fix.
Created attachment 110934 [details] [review] One line fix for the crash The code is in the #else block of a #if NET_2_0 I'm running mono 1.2.6, am I not supposed to have the .NET 2.0 stuff (generics, etc.) ?
Excellent, I can confirm that the patch does indeed make the crasher disappear.
Thanks for the patch, Bertrand. Can you write a test (that fails w/o your patch and passes w/ it) in tests/ ? This is a sensitive area, and it'd be good to make sure we don't regress. Thanks!
Created attachment 110964 [details] [review] Fix for the crash and regression test I added a test that triggers an IndexOutOfRangeException without the fix.
Patch committed. Thanks Bertrand for tracking this down, and David for reporting. The bug was only in the NET_1_1 profile of the array resizing and we should have been using the NET_2_0 profile version all along, but alas that was never defined in our build! I've defined NET_2_0 so we'll now benefit from all my originally intended generic goodness :) Thanks!