GNOME Bugzilla – Bug 673068
f-spot crashes when reversing time order display
Last modified: 2012-11-17 08:15:53 UTC
I select a subset of images based on a common tag, then I select all these images, and try to view them in reverse order (View->Reverse Order). F-spot crashes with this error message : [3 Debug 13:48:50.674] Exception executing command: SELECT COUNT (*) as count, month from population GROUP BY month [3 Warn 13:48:50.677] Caught an exception - Hyena.Data.Sqlite.SqliteException: Sqlite error 1: no such table: population (SQL: SELECT COUNT (*) as count, month from population GROUP BY month) (in `Hyena.Data.Sqlite') at Hyena.Data.Sqlite.Connection.CheckError (Int32 errorCode, System.String sql) [0x0003b] in /builddir/build/BUILD/f-spot-0.8.2/lib/Hyena/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Sqlite.cs:107 at Hyena.Data.Sqlite.Statement.CheckError (Int32 code) [0x00000] in /builddir/build/BUILD/f-spot-0.8.2/lib/Hyena/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Sqlite.cs:345 at Hyena.Data.Sqlite.Statement..ctor (Hyena.Data.Sqlite.Connection connection, System.String sql) [0x00026] in /builddir/build/BUILD/f-spot-0.8.2/lib/Hyena/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Sqlite.cs:236 at Hyena.Data.Sqlite.Connection.Query (System.String sql) [0x00000] in /builddir/build/BUILD/f-spot-0.8.2/lib/Hyena/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Sqlite.cs:117 at Hyena.Data.Sqlite.HyenaSqliteCommand.Execute (Hyena.Data.Sqlite.HyenaSqliteConnection hconnection, Hyena.Data.Sqlite.Connection connection) [0x00068] in /builddir/build/BUILD/f-spot-0.8.2/lib/Hyena/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs:98 The problem is that two threads invoke method FSpot.TimeAdaptor.Reload() simultaneously. This method calls FSpot.PhotoStore.PhotosPerMonth(), which create a temporary sqlite table without locking protection. The temporary table is removed by a thread before being used by the other thread.
Created attachment 210861 [details] [review] Patch that doesn't reload TimeAdaptor twice
Tested with commit 3a4dbc4622af12fe9df8cc31da5565d912f65958 and can _not_ reproduce this issue. The problem addressed in the patch is still in the current code though (e.g. patch could be applied).
commit 24e001df9fc3d0596ab9696f510c1be70d2eafec Author: Fabrice Bellet <fabrice@bellet.info> Date: Sun Mar 18 10:28:48 2012 +0100 Dont reload FSpot.TimeAdaptor twice