From 1927f5801bb9fae18ba6564b7acbeca06eda75b8 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:30:08 +0000 Subject: import tracker-0.16.2-11.el7 --- diff --git a/SOURCES/tracker-0.16-miner-fs-crashes.patch b/SOURCES/tracker-0.16-miner-fs-crashes.patch new file mode 100644 index 0000000..43ca776 --- /dev/null +++ b/SOURCES/tracker-0.16-miner-fs-crashes.patch @@ -0,0 +1,161 @@ +From 409606679702536cfb207282c3d034eace83f2a4 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Wed, 1 Oct 2014 19:31:01 +0200 +Subject: [PATCH 1/2] libtracker-miner: Ensure that the async function uses + owned data + +... and simplify parent directory tracking. + +The GFileEnumerator keeps a reference to the directory that is being +traversed, so we don't need to keep track of it ourselves. + +https://bugzilla.gnome.org/show_bug.cgi?id=737768 +--- + src/libtracker-miner/tracker-crawler.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c +index c034204..2c6e0f0 100644 +--- a/src/libtracker-miner/tracker-crawler.c ++++ b/src/libtracker-miner/tracker-crawler.c +@@ -105,7 +105,6 @@ typedef struct { + TrackerCrawler *crawler; + DirectoryRootInfo *root_info; + DirectoryProcessingData *dir_info; +- GFile *dir_file; + GCancellable *cancellable; + } EnumeratorData; + +@@ -596,9 +595,6 @@ enumerator_data_new (TrackerCrawler *crawler, + ed->crawler = g_object_ref (crawler); + ed->root_info = root_info; + ed->dir_info = dir_info; +- /* Make sure there's always a ref of the GFile while we're +- * iterating it */ +- ed->dir_file = g_object_ref (G_FILE (dir_info->node->data)); + ed->cancellable = g_cancellable_new (); + + crawler->priv->cancellables = g_list_prepend (crawler->priv->cancellables, +@@ -607,7 +603,7 @@ enumerator_data_new (TrackerCrawler *crawler, + } + + static void +-enumerator_data_process (EnumeratorData *ed) ++enumerator_data_process (GFile *parent, EnumeratorData *ed) + { + TrackerCrawler *crawler; + GSList *l; +@@ -623,7 +619,7 @@ enumerator_data_process (EnumeratorData *ed) + children = g_list_prepend (children, child_data->child); + } + +- g_signal_emit (crawler, signals[CHECK_DIRECTORY_CONTENTS], 0, ed->dir_info->node->data, children, &use); ++ g_signal_emit (crawler, signals[CHECK_DIRECTORY_CONTENTS], 0, parent, children, &use); + g_list_free (children); + + if (!use) { +@@ -640,7 +636,6 @@ enumerator_data_free (EnumeratorData *ed) + g_list_remove (ed->crawler->priv->cancellables, + ed->cancellable); + +- g_object_unref (ed->dir_file); + g_object_unref (ed->crawler); + g_object_unref (ed->cancellable); + g_slice_free (EnumeratorData, ed); +@@ -690,6 +685,7 @@ file_enumerate_next_cb (GObject *object, + ed = user_data; + crawler = ed->crawler; + cancelled = g_cancellable_is_cancelled (ed->cancellable); ++ parent = g_file_enumerator_get_container (enumerator); + + files = g_file_enumerator_next_files_finish (enumerator, + result, +@@ -710,7 +706,7 @@ file_enumerate_next_cb (GObject *object, + } + + if (!cancelled) { +- enumerator_data_process (ed); ++ enumerator_data_process (parent, ed); + } + + enumerator_data_free (ed); +@@ -724,8 +720,6 @@ file_enumerate_next_cb (GObject *object, + return; + } + +- parent = ed->dir_info->node->data; +- + for (l = files; l; l = l->next) { + const gchar *child_name; + gboolean is_dir; +@@ -814,6 +808,7 @@ file_enumerate_children (TrackerCrawler *crawler, + DirectoryProcessingData *dir_data) + { + EnumeratorData *ed; ++ GFile *dir_file; + gchar *attrs; + + ed = enumerator_data_new (crawler, info, dir_data); +@@ -826,7 +821,8 @@ file_enumerate_children (TrackerCrawler *crawler, + attrs = g_strdup (FILE_ATTRIBUTES); + } + +- g_file_enumerate_children_async (ed->dir_file, ++ dir_file = G_FILE (dir_data->node->data); ++ g_file_enumerate_children_async (dir_file, + attrs, + G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, + G_PRIORITY_LOW, +-- +2.1.0 + + +From 0018667159e02a4b9e51ad2c9bbd76d666fbfe56 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Wed, 1 Oct 2014 19:44:42 +0200 +Subject: [PATCH 2/2] libtracker-miner: Keep the crawler alive across async + calls + +The EnumeratorData held a reference to TrackerCrawler while +enumerating. Just before closing the enumerator we destroy the +EnumeratorData and drop the reference. This can lead to TrackerCrawler +getting destroyed. + +To prevent this, grab a new reference before dropping the older one +and keep it till the asynchronous call is alive. + +https://bugzilla.gnome.org/show_bug.cgi?id=737769 +--- + src/libtracker-miner/tracker-crawler.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c +index 2c6e0f0..80befde 100644 +--- a/src/libtracker-miner/tracker-crawler.c ++++ b/src/libtracker-miner/tracker-crawler.c +@@ -664,6 +664,7 @@ file_enumerator_close_cb (GObject *enumerator, + * continue with queued files/directories. + */ + process_func_start (crawler); ++ g_object_unref (crawler); + } + + static void +@@ -709,12 +710,12 @@ file_enumerate_next_cb (GObject *object, + enumerator_data_process (parent, ed); + } + +- enumerator_data_free (ed); + g_file_enumerator_close_async (enumerator, + G_PRIORITY_DEFAULT, + NULL, + file_enumerator_close_cb, +- crawler); ++ g_object_ref (crawler)); ++ enumerator_data_free (ed); + g_object_unref (enumerator); + + return; +-- +2.1.0 + diff --git a/SOURCES/tracker-0.16-miner-store-crashes.patch b/SOURCES/tracker-0.16-miner-store-crashes.patch new file mode 100644 index 0000000..9412c53 --- /dev/null +++ b/SOURCES/tracker-0.16-miner-store-crashes.patch @@ -0,0 +1,76 @@ +From 82f4821ed0b022ed91aa0867b0f5b77048e2c3be Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Mon, 13 Oct 2014 13:49:29 +0200 +Subject: [PATCH 1/2] libtracker-data: Guard against failure to open the + database + +An error from sqlite3_open_v2 will lead to a failure to create a +TrackerDBInterface. This means that DBManager.get_db_interface will +fail. + +https://bugzilla.gnome.org/show_bug.cgi?id=738450 +--- + src/libtracker-data/tracker-sparql-query.vala | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala +index b84103d..2430263 100644 +--- a/src/libtracker-data/tracker-sparql-query.vala ++++ b/src/libtracker-data/tracker-sparql-query.vala +@@ -500,6 +500,10 @@ public class Tracker.Sparql.Query : Object { + + DBStatement prepare_for_exec (string sql) throws DBInterfaceError, Sparql.Error, DateError { + var iface = DBManager.get_db_interface (); ++ if (iface == null) { ++ throw new DBInterfaceError.OPEN_ERROR ("Error opening database"); ++ } ++ + var stmt = iface.create_statement (no_cache ? DBStatementCacheType.NONE : DBStatementCacheType.SELECT, "%s", sql); + + // set literals specified in query +-- +2.1.0 + + +From 08b31a6d1de2418e409a300ca86578bbd03ad8ee Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Mon, 13 Oct 2014 14:27:07 +0200 +Subject: [PATCH 2/2] libtracker-data: Guard against invalid statements in + public API + +https://bugzilla.gnome.org/show_bug.cgi?id=738450 +--- + src/libtracker-data/tracker-db-interface-sqlite.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c +index a9e899e..682dd86 100644 +--- a/src/libtracker-data/tracker-db-interface-sqlite.c ++++ b/src/libtracker-data/tracker-db-interface-sqlite.c +@@ -2202,6 +2202,7 @@ void + tracker_db_statement_execute (TrackerDBStatement *stmt, + GError **error) + { ++ g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt)); + g_return_if_fail (!stmt->stmt_is_sunk); + + execute_stmt (stmt->db_interface, stmt->stmt, NULL, error); +@@ -2211,6 +2212,7 @@ TrackerDBCursor * + tracker_db_statement_start_cursor (TrackerDBStatement *stmt, + GError **error) + { ++ g_return_val_if_fail (TRACKER_IS_DB_STATEMENT (stmt), NULL); + g_return_val_if_fail (!stmt->stmt_is_sunk, NULL); + + return tracker_db_cursor_sqlite_new (stmt->stmt, stmt, NULL, 0, NULL, 0, FALSE); +@@ -2225,6 +2227,7 @@ tracker_db_statement_start_sparql_cursor (TrackerDBStatement *stmt, + gboolean threadsafe, + GError **error) + { ++ g_return_val_if_fail (TRACKER_IS_DB_STATEMENT (stmt), NULL); + g_return_val_if_fail (!stmt->stmt_is_sunk, NULL); + + return tracker_db_cursor_sqlite_new (stmt->stmt, stmt, types, n_types, variable_names, n_variable_names, threadsafe); +-- +2.1.0 + diff --git a/SPECS/tracker.spec b/SPECS/tracker.spec index 494afb6..462fe55 100644 --- a/SPECS/tracker.spec +++ b/SPECS/tracker.spec @@ -15,7 +15,7 @@ Summary: Desktop-neutral search tool and indexer Name: tracker Version: 0.16.2 -Release: 8%{?dist} +Release: 11%{?dist} License: GPLv2+ Group: Applications/System URL: http://projects.gnome.org/tracker/ @@ -39,6 +39,12 @@ Patch6: 0001-fts-Strengthen-against-sqlite-failures-in-FTS-functi.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1028194 Patch7: 0001-Bump-the-minimum-memory-requirement-to-768M.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1096307 +Patch8: tracker-0.16-miner-fs-crashes.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1083199 +Patch9: tracker-0.16-miner-store-crashes.patch + BuildRequires: poppler-glib-devel libxml2-devel libgsf-devel libgxps-devel BuildRequires: libuuid-devel dbus-glib-devel BuildRequires: nautilus-devel @@ -152,6 +158,8 @@ This package contains the documentation for tracker %patch5 -p1 -b .rename %patch6 -p1 -b .fts %patch7 -p1 -b .memory +%patch8 -p1 -b .miner-fs-crashes +%patch9 -p1 -b .miner-store-crashes autoreconf @@ -281,7 +289,19 @@ fi %{_datadir}/gtk-doc/html/ontology/ %changelog -* Fri Feb 28 2014 Matthias Clasen 0 16.2-8 +* Mon Oct 13 2014 Debarshi Ray 0.16.2-11 +- Fix a tracker-store crash +Resolves: #1083199 + +* Mon Oct 13 2014 Debarshi Ray 0.16.2-10 +- Update the tracker-miner-fs patch to cover another crash site +Resolves: #1096307 + +* Thu Oct 02 2014 Debarshi Ray 0.16.2-9 +- Fix a couple of tracker-miner-fs crashes +Resolves: #1096307 + +* Fri Feb 28 2014 Matthias Clasen 0.16.2-8 - Rebuild Resolves: #1070803