GNOME Bugzilla – Bug 738450
libtracker-data: Guard against failure to open the database
Last modified: 2014-10-13 14:24:19 UTC
See this Fedora bug and its duplicates: https://bugzilla.redhat.com/show_bug.cgi?id=972770 The session log from one of the dupes indicates that the tracker-store (PID 1373) failed to open the sqlite DB: https://bugzilla.redhat.com/attachment.cgi?id=811418 That led to a bunch of assertions from prepare_for_exec in tracker-sparql-query.vala, and eventually a crash in tracker_db_statement_start_sparql_cursor because it does not check the validity of the incoming stmt. We should guard against DBManager.get_db_interface failures, and verify the incoming stmt just to be sure. This applies to master, tracker-1.2, tracker-1.0 and tracker-0.16
Created attachment 288381 [details] [review] libtracker-data: Guard against failure to open the database
Created attachment 288382 [details] [review] libtracker-data: Guard against invalid statements in public API I don't know if the other tracker_db_manager_get_db_interface call sites can be expected to fail, but guarding against invalid TrackerDBStatements in non-private API seems like a good thing to anyway. Particularly since the tracker_db_statement_bind_* methods are already doing that.
Hi Debarshi, thanks for the patches, both look good to me. I've not really touched libtracker-data for a long while, mainly because it's the engine room and "just works" most of the time - but I would like to clean it up at some point (perhaps next cycle after all the latest changes that are going to cause enough disruption).
Created attachment 288385 [details] [review] libtracker-data: Be more explicit in the error message
Comment on attachment 288385 [details] [review] libtracker-data: Be more explicit in the error message Looks good to me.