GNOME Bugzilla – Bug 457480
Crashes at startup: LoadPreference
Last modified: 2007-07-29 07:43:24 UTC
Steps to reproduce: 1. Get f-spot from trunk 16. july 2007 2. Compile and install 3. Startup. Crash. Stack trace: An unhandled exception was thrown: An element with the same key already exists in the dictionary. at System.Collections.Generic.Dictionary`2[System.String,System.Object].Add (System.String , System.Object ) [0x00000] at FSpot.Preferences.Get (System.String key) [0x00000] at MainWindow.LoadPreference (System.String key) [0x00000] at MainWindow..ctor (.Db db) [0x00000] at FSpot.Core.get_MainWindow () [0x00000] at FSpot.Core.Organize () [0x00000] at FSpot.Driver.Main (System.String[] args) [0x00000] .NET Version: 2.0.50727.42 Assembly Version Information: Mono.Addins.Gui (0.2.0.0) pango-sharp (2.10.0.0) SemWeb (0.7.1.0) glade-sharp (2.10.0.0) gtkhtml-sharp (2.16.0.0) System.Data (2.0.0.0) Mono.Data.SqliteClient (2.0.0.0) System.Xml (2.0.0.0) gconf-sharp (2.16.0.0) gdk-sharp (2.10.0.0) gnome-vfs-sharp (2.16.0.0) Mono.Addins (0.2.0.0) NDesk.DBus.GLib (0.3.0.0) NDesk.DBus (1.0.0.0) System (2.0.0.0) Mono.Posix (2.0.0.0) atk-sharp (2.10.0.0) gtk-sharp (2.10.0.0) Mono.Addins.Setup (0.2.0.0) glib-sharp (2.10.0.0) gnome-sharp (2.16.0.0) f-spot (0.4.0.0) Mono.GetOptions (2.0.0.0) mscorlib (2.0.0.0) Platform Information: Linux 2.6.17-11-generic i686 unknown GNU/Linux Distribution Information: [/etc/debian_version] testing/unstable [/etc/lsb-release] DISTRIB_ID=Ubuntu DISTRIB_RELEASE=6.10 DISTRIB_CODENAME=edgy DISTRIB_DESCRIPTION="Ubuntu 6.10" Other information:
After closing and restarting f-spot, f-spot didn't crash.
This also happens when I open Edit->Preferences: An unhandled exception was thrown: An element with the same key already exists in the dictionary. at System.Collections.Generic.Dictionary`2[System.String,System.Object].Add (System.String , System.Object ) [0x00000] at FSpot.Preferences.Get (System.String key) [0x00000] at FSpot.PreferenceDialog.LoadPreference (System.String key) [0x00000] at FSpot.PreferenceDialog..ctor () [0x00000] at FSpot.PreferenceDialog.Show () [0x00000] at MainWindow.HandlePreferences (System.Object sender, System.EventArgs args) [0x00000] at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs) at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr gch) [0x00000] at (wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr) at <0x00000> <unknown method> at (wrapper managed-to-native) Gtk.Application:gtk_main () at Gtk.Application.Run () [0x00000] at Gnome.Program.Run () [0x00000] at FSpot.Driver.Main (System.String[] args) [0x00000] .NET Version: 2.0.50727.42 Assembly Version Information: Mono.Addins.Gui (0.2.0.0) SemWeb (0.7.1.0) pango-sharp (2.10.0.0) glade-sharp (2.10.0.0) System.Data (2.0.0.0) Mono.Data.SqliteClient (2.0.0.0) System.Xml (2.0.0.0) gconf-sharp (2.16.0.0) gdk-sharp (2.10.0.0) gnome-vfs-sharp (2.16.0.0) Mono.Addins (0.2.0.0) NDesk.DBus.GLib (0.3.0.0) NDesk.DBus (1.0.0.0) System (2.0.0.0) Mono.Posix (2.0.0.0) atk-sharp (2.10.0.0) gtk-sharp (2.10.0.0) Mono.Addins.Setup (0.2.0.0) glib-sharp (2.10.0.0) gnome-sharp (2.16.0.0) f-spot (0.4.0.0) Mono.GetOptions (2.0.0.0) mscorlib (2.0.0.0) Platform Information: Linux 2.6.17-12-generic i686 unknown GNU/Linux Distribution Information: [/etc/debian_version] testing/unstable [/etc/lsb-release] DISTRIB_ID=Ubuntu DISTRIB_RELEASE=6.10 DISTRIB_CODENAME=edgy DISTRIB_DESCRIPTION="Ubuntu 6.10"
looks like this code needs some locks for multithreading support... if rubenv doesn't shows up in the next few days, I'll give a try by myself
Goddarn this is my fault :-) I'll clean up my own mess. Very strange that we're getting calls from multiple threads. I'll put monitors around them. Also, note that I suck at reading bugmail lately (IBM eats my spare time), if you need me, be sure to ping me, a lot :-)
I've pushed in a patch that makes the cache manipulation thread-safe. If the threading problems are what cause this, it should be fixed. Could you try updating your copy? Let me know if it did the trick, if not, I'll dive into it some more. Sorry for the breakage, it worked on my system :-)
Your fix worked. Thanks.
I think there is something wrong here. I am trying to make a patch for http://bugzilla.gnome.org/show_bug.cgi?id=326328 but I get hit by this bug again. It happens with settings that does not exist yet. I cannot understand why it happens, so can't make a patch for this bug.
I committed another fix (provided by Mike) to this bug yesterday as r3258