From f8f0bd39170df42c6cc191fcc71cebc299074185 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 28 Dec 2018 11:45:27 +0100 Subject: [PATCH] Backport an upstream patch to fix common gnome-software crash --- ...ing-related-crashes-when-creating-th.patch | 45 +++++++++++++++++++ libappstream-glib.spec | 6 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0001-store-Fix-threading-related-crashes-when-creating-th.patch diff --git a/0001-store-Fix-threading-related-crashes-when-creating-th.patch b/0001-store-Fix-threading-related-crashes-when-creating-th.patch new file mode 100644 index 0000000..fa47968 --- /dev/null +++ b/0001-store-Fix-threading-related-crashes-when-creating-th.patch @@ -0,0 +1,45 @@ +From 584faccb9e1de36265af78064e1b7ef32d4d59a3 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Thu, 27 Dec 2018 13:31:08 +0100 +Subject: [PATCH] store: Fix threading related crashes when creating the search + cache + +Keep a ref on the AsApp in the worker thread to make sure it doesn't get +destroyed in another thread while being processed. + +https://bugzilla.redhat.com/show_bug.cgi?id=1662130 +https://bugzilla.redhat.com/show_bug.cgi?id=1661701 +https://bugzilla.redhat.com/show_bug.cgi?id=1661382 +https://bugzilla.redhat.com/show_bug.cgi?id=1658140 +https://bugzilla.redhat.com/show_bug.cgi?id=1644026 +https://bugzilla.redhat.com/show_bug.cgi?id=1639558 +https://bugzilla.redhat.com/show_bug.cgi?id=1570096 +--- + libappstream-glib/as-store.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c +index 2fdbe8e..3a03fcd 100644 +--- a/libappstream-glib/as-store.c ++++ b/libappstream-glib/as-store.c +@@ -3407,7 +3407,7 @@ as_store_search_per_user (AsStore *store, + static void + as_store_load_search_cache_cb (gpointer data, gpointer user_data) + { +- AsApp *app = AS_APP (data); ++ g_autoptr(AsApp) app = AS_APP (data); + as_app_search_matches (app, NULL); + } + +@@ -3446,7 +3446,7 @@ as_store_load_search_cache (AsStore *store) + g_mutex_lock (&priv->mutex); + for (i = 0; i < priv->array->len; i++) { + AsApp *app = g_ptr_array_index (priv->array, i); +- g_thread_pool_push (pool, app, NULL); ++ g_thread_pool_push (pool, g_object_ref (app), NULL); + } + g_mutex_unlock (&priv->mutex); + g_thread_pool_free (pool, FALSE, TRUE); +-- +2.19.1 + diff --git a/libappstream-glib.spec b/libappstream-glib.spec index 2901008..4b0966d 100644 --- a/libappstream-glib.spec +++ b/libappstream-glib.spec @@ -6,13 +6,14 @@ Summary: Library for AppStream metadata Name: libappstream-glib Version: 0.7.14 -Release: 3%{?dist} +Release: 4%{?dist} License: LGPLv2+ URL: http://people.freedesktop.org/~hughsient/appstream-glib/ Source0: http://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-%{version}.tar.xz # Backported from upstream Patch0: as_utils_vercmp_full.patch Patch1: as-store-locking.patch +Patch2: 0001-store-Fix-threading-related-crashes-when-creating-th.patch BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: docbook-utils @@ -147,6 +148,9 @@ GLib headers and libraries for appstream-builder. %{_datadir}/gir-1.0/AppStreamBuilder-1.0.gir %changelog +* Fri Dec 28 2018 Kalev Lember 0.7.14-4 +- Backport an upstream patch to fix common gnome-software crash + * Tue Dec 18 2018 Kalev Lember 0.7.14-3 - Backport AsStore locking patches from upstream