From 3867463b8988ca5a1218cdc6d8ac2288c9f97b37 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mar 22 2021 11:44:55 +0000 Subject: Update to 1.68.0 --- diff --git a/.gitignore b/.gitignore index e7c0359..9f58870 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,4 @@ gjs-0.7.1.tar.gz /gjs-1.67.1.tar.xz /gjs-1.67.2.tar.xz /gjs-1.67.3.tar.xz +/gjs-1.68.0.tar.xz diff --git a/588.patch b/588.patch deleted file mode 100644 index 34582b6..0000000 --- a/588.patch +++ /dev/null @@ -1,70 +0,0 @@ -From c0003eb5ad4c4b0421d723da3d1ff11991f70fb5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= -Date: Fri, 19 Mar 2021 16:46:42 +0100 -Subject: [PATCH] object: Ignore toggle notifications after disposition - -As per commit d37d6604 we are not removing a toggle reference on -disposed objects, however it may happen that a disposed object (but not -yet finalized) is still using the toggle references while we're releasing -it, and in such case we must always remove the toggle ref, otherwise -GObject (that doesn't remove toggle notifications on disposition) will -notify us after that the wrapper has been finalized, causing a crash -because at that point the GObject is still very well alive (and so -its qdata) and so when we'll try to get the gjs private data from it, -(namely the JS object wrapper instance) we'll end up accessing freed -memory. - -So, on weak notify callback (that we get during disposition, when the -object memory is still valid like its toggle notifications) remove the -toggle reference that we set and consequently toggle down the JSObject -wrapper, unrooting it so that the garbage collector can pick it (this may -also make it a bit more reactive, without waiting for the last reference -being removed if disposition happens as consequence of a run_dispose() -call). - -We keep the m_uses_toggle_ref set though to avoid adding another one, -but at this point we also have to check whether the object is also -disposed before considering the toggle ref active, and per this in such -case we've to only release (steal) the m_ptr when releasing the native -object not to access to potentially finalized data. - -Fixes: #387 ---- - gi/object.cpp | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/gi/object.cpp b/gi/object.cpp -index 68410514..598e6bb0 100644 ---- a/gi/object.cpp -+++ b/gi/object.cpp -@@ -1082,10 +1082,18 @@ static void wrapped_gobj_dispose_notify( - where_the_object_was); - } - -+static void wrapped_gobj_toggle_notify(void*, GObject* gobj, -+ gboolean is_last_ref); -+ - void - ObjectInstance::gobj_dispose_notify(void) - { - m_gobj_disposed = true; -+ -+ if (m_uses_toggle_ref) { -+ g_object_remove_toggle_ref(m_ptr, wrapped_gobj_toggle_notify, nullptr); -+ wrapped_gobj_toggle_notify(nullptr, m_ptr, TRUE); -+ } - } - - void ObjectInstance::iterate_wrapped_gobjects( -@@ -1297,7 +1305,7 @@ void - ObjectInstance::release_native_object(void) - { - discard_wrapper(); -- if (m_gobj_disposed) -+ if (m_uses_toggle_ref && m_gobj_disposed) - m_ptr.release(); - else if (m_uses_toggle_ref) - g_object_remove_toggle_ref(m_ptr.release(), wrapped_gobj_toggle_notify, --- -GitLab - diff --git a/gjs.spec b/gjs.spec index f8fd2d4..0dbc5b2 100644 --- a/gjs.spec +++ b/gjs.spec @@ -1,11 +1,10 @@ -%global glib2_version 2.58.0 -%global gobject_introspection_version 1.61.2 -%global gtk3_version 3.20 +%global glib2_version 2.66.0 +%global gobject_introspection_version 1.66.0 %global mozjs78_version 78.8.0-1 Name: gjs -Version: 1.67.3 -Release: 3%{?dist} +Version: 1.68.0 +Release: 1%{?dist} Summary: Javascript Bindings for GNOME # The following files contain code from Mozilla which @@ -14,13 +13,7 @@ Summary: Javascript Bindings for GNOME # Stack printer (gjs/stack.c) License: MIT and (MPLv1.1 or GPLv2+ or LGPLv2+) URL: https://wiki.gnome.org/Projects/Gjs -Source0: https://download.gnome.org/sources/%{name}/1.67/%{name}-%{version}.tar.xz - -# Fix a frequent crash on unlock: -# https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/588 -# https://bugzilla.redhat.com/show_bug.cgi?id=1940171 -# https://gitlab.gnome.org/GNOME/gjs/-/issues/387 -Patch0: 588.patch +Source0: https://download.gnome.org/sources/%{name}/1.68/%{name}-%{version}.tar.xz BuildRequires: cairo-gobject-devel BuildRequires: dbus-daemon @@ -30,7 +23,8 @@ BuildRequires: meson BuildRequires: gettext BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} -BuildRequires: gtk3-devel >= %{gtk3_version} +BuildRequires: gtk3-devel +BuildRequires: gtk4-devel BuildRequires: mozjs78-devel >= %{mozjs78_version} BuildRequires: pkgconfig BuildRequires: readline-devel @@ -41,7 +35,6 @@ BuildRequires: xorg-x11-server-Xvfb Requires: glib2%{?_isa} >= %{glib2_version} Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version} -Requires: gtk3%{?_isa} >= %{gtk3_version} Requires: mozjs78%{?_isa} >= %{mozjs78_version} # Filter provides for private libraries @@ -103,6 +96,9 @@ the functionality of the installed gjs package. %{_datadir}/installed-tests/ %changelog +* Mon Mar 22 2021 Kalev Lember - 1.68.0-1 +- Update to 1.68.0 + * Fri Mar 19 2021 Adam Williamson - 1.67.3-3 - Replace MR #585 reversion with MR #588, hopefully correct fix diff --git a/sources b/sources index 1fe7840..4b2c88d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gjs-1.67.3.tar.xz) = 9bd6d58e2322cb7354cf29c7327127276f947f514c80b10831f8f8b36854b7b34da811eff26d41fa7e74e42421df0ffab3a0e6896eb73cca456235c3f2dd1499 +SHA512 (gjs-1.68.0.tar.xz) = 65278ca345f2c786995bed7755dd86403b469eb6cceaa6db57dbd4af212025a3b1f01b7387f45dc9abc23d47ba2f39c5ab8a90ec95b1934f1471a68a06f0d82d