GNU bug report logs - #34658
Gtk upstream bug #1280 causes crashes in IceCat and Emacs

Previous Next

Package: guix;

Reported by: Carlo Zancanaro <carlo <at> zancanaro.id.au>

Date: Tue, 26 Feb 2019 00:50:01 UTC

Severity: normal

Merged with 34454, 34528

Done: Bradley Haggerty <bradigger <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34658 in the body.
You can then email your comments to 34658 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Tue, 26 Feb 2019 00:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carlo Zancanaro <carlo <at> zancanaro.id.au>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 26 Feb 2019 00:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlo Zancanaro <carlo <at> zancanaro.id.au>
To: bug-guix <at> gnu.org
Subject: Emacs crashes
Date: Tue, 26 Feb 2019 11:49:07 +1100
[Message part 1 (text/plain, inline)]
I updated my Guix installation and user profile yesterday, and 
since then Emacs has started crashing. I've attached the output of 
running "emacs -Q".

I'm using my own branch of Guix that is based on 
089a2c51ff4d4d8ddd180001b25535019c0d35c0, but I haven't modified 
Emacs. As a workaround I am now using emacs-no-x-toolkit, which 
does not have this problem.

The output claims that it's a GTK bug, but I have not experienced 
it before today.

[emacs-output.txt (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Tue, 26 Feb 2019 01:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 34658 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Carlo Zancanaro <carlo <at> zancanaro.id.au>
Cc: 34658 <at> debbugs.gnu.org
Subject: Re: bug#34658: Emacs crashes
Date: Mon, 25 Feb 2019 20:15:32 -0500
[Message part 1 (text/plain, inline)]
On Tue, Feb 26, 2019 at 11:49:07AM +1100, Carlo Zancanaro wrote:
> I updated my Guix installation and user profile yesterday, and since then
> Emacs has started crashing. I've attached the output of running "emacs -Q".
> 
> I'm using my own branch of Guix that is based on
> 089a2c51ff4d4d8ddd180001b25535019c0d35c0, but I haven't modified Emacs. As a
> workaround I am now using emacs-no-x-toolkit, which does not have this
> problem.

It will aid debugging if you can tell us which commit you upgraded from,
as well.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Tue, 26 Feb 2019 01:59:01 GMT) Full text and rfc822 format available.

Message #11 received at 34658 <at> debbugs.gnu.org (full text, mbox):

From: Carlo Zancanaro <carlo <at> zancanaro.id.au>
To: Leo Famulari <leo <at> famulari.name>
Cc: 34658 <at> debbugs.gnu.org
Subject: Re: bug#34658: Emacs crashes
Date: Tue, 26 Feb 2019 12:58:11 +1100
On Tue, Feb 26 2019, Leo Famulari wrote:
> It will aid debugging if you can tell us which commit you 
> upgraded from, as well.

Good call.

I think the last Guix commit that I was branched from (where Emacs 
worked properly) was e36d043882462f2252aa8e6fe7c34bfbee6d3175.




Information forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Wed, 27 Mar 2019 13:01:02 GMT) Full text and rfc822 format available.

Message #14 received at 34658 <at> debbugs.gnu.org (full text, mbox):

From: Bradley Haggerty <bradigger <at> gmail.com>
To: 34658 <at> debbugs.gnu.org
Date: Wed, 27 Mar 2019 13:00:06 +0000
[Message part 1 (text/plain, inline)]
This sounds similar to my issue, #34454
Do you also experience crashes with icecat and pavucontrol? I have been
just holding back emacs and icecat when I do my upgrades for a few weeks
now. All the crashes look similar and mention GTK. I was asked to make a vm
of my system to try and reproduce the crash but I have not gotten around to
figuring that out quite yet.
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Sat, 30 Mar 2019 03:50:03 GMT) Full text and rfc822 format available.

Message #17 received at 34658 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: 34454 <at> debbugs.gnu.org, 34658 <at> debbugs.gnu.org, 34528 <at> debbugs.gnu.org
Cc: Carlo Zancanaro <carlo <at> zancanaro.id.au>, Leo Famulari <leo <at> famulari.name>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Joshua Branson <jbranso <at> dismail.de>, Bradley Haggerty <bradigger <at> gmail.com>
Subject: Gtk upstream bug #1280 causes crashes in IceCat and Emacs
Date: Fri, 29 Mar 2019 23:47:25 -0400
[Message part 1 (text/plain, inline)]
merge 34454 34658 34528
retitle 34454 Gtk upstream bug #1280 causes crashes in IceCat and Emacs
thanks

Hello all,

I looked into this, and I believe all of these bugs are caused by Gtk
upstream bug #1280:

  https://gitlab.gnome.org/GNOME/gtk/issues/1280

which is apparently fixed by the following upstream commit:

  https://gitlab.gnome.org/GNOME/gtk/commit/e3a1593a0984cc0156ec1892a46af8f256a64878

Here's another upstream bug report that's more obviously related to
this, and upstream decided it was a duplicate with #1280:

  https://gitlab.gnome.org/GNOME/gtk/issues/1523

Also, here's the same bug reported for NixOS and Arch:

  https://github.com/NixOS/nixpkgs/issues/53697
  https://bugs.archlinux.org/task/61050

I've attached a proposed patch to fix this in Guix.  I'm currently
testing the patch on my system to make sure it doesn't cause any
problems, although I cannot reproduce this bug on my own system.

If those affected by this issue would like to test this patch and report
back, that would be helpful.

     Regards,
       Mark


[0001-UNTESTED-gnu-gtk-Add-upstream-fix-for-crashes-in-Ema.patch (text/x-patch, inline)]
From 5a11003732688c0fbbfdc831774f58ff6fe20a0b Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw <at> netris.org>
Date: Fri, 29 Mar 2019 23:28:45 -0400
Subject: [PATCH] UNTESTED: gnu: gtk+: Add upstream fix for crashes in Emacs
 and IceCat.

* gnu/packages/patches/gtk3-fix-deprecation-macro-use.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gtk.scm (gtk+/fixed): New variable.
(gtk+)[replacement]: New field.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gtk.scm                          | 12 +++++++-
 .../gtk3-fix-deprecation-macro-use.patch      | 29 +++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gtk3-fix-deprecation-macro-use.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 18531d9a76..5639bc58d1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -887,6 +887,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch	\
   %D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
   %D%/packages/patches/gtk2-theme-paths.patch			\
+  %D%/packages/patches/gtk3-fix-deprecation-macro-use.patch	\
   %D%/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch	\
   %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \
   %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index aab392758f..1d26aab963 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo <at> gnu.org>
-;;; Copyright © 2014, 2015, 2017, 2018 Mark H Weaver <mhw <at> netris.org>
+;;; Copyright © 2014, 2015, 2017, 2018, 2019 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2014 Eric Bavier <bavier <at> member.fsf.org>
 ;;; Copyright © 2015 Federico Beffa <beffa <at> fbengineering.ch>
 ;;; Copyright © 2015 Paul van der Walt <paul <at> denknerd.org>
@@ -694,6 +694,7 @@ application suites.")
    ;; NOTE: When updating the version of 'gtk+', the hash of 'mate-themes' in
    ;;       mate.scm will also need to be updated.
    (version "3.24.2")
+   (replacement gtk+/fixed)
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnome/sources/" name "/"
@@ -787,6 +788,15 @@ application suites.")
            (variable "GUIX_GTK3_PATH")
            (files '("lib/gtk-3.0")))))))
 
+(define gtk+/fixed
+  (package
+    (inherit gtk+)
+    (source (origin
+              (inherit (package-source gtk+))
+              (patches
+               (cons (search-patch "gtk3-fix-deprecation-macro-use.patch")
+                     (origin-patches (package-source gtk+))))))))
+
 ;;;
 ;;; Guile bindings.
 ;;;
diff --git a/gnu/packages/patches/gtk3-fix-deprecation-macro-use.patch b/gnu/packages/patches/gtk3-fix-deprecation-macro-use.patch
new file mode 100644
index 0000000000..39cd4bd59a
--- /dev/null
+++ b/gnu/packages/patches/gtk3-fix-deprecation-macro-use.patch
@@ -0,0 +1,29 @@
+Copied from <https://gitlab.gnome.org/GNOME/gtk/commit/e3a1593a>.
+Fixes upstream bug <https://gitlab.gnome.org/GNOME/gtk/issues/1280>,
+and hopefully also <https://bugs.gnu.org/34528>,
+<https://bugs.gnu.org/34454>, and <https://bugs.gnu.org/34658>.
+
+diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
+index 97ada6d73919fba3dfe192dd66929e90bc7677bb..764e39495f7edb0c3efe41cca25b8bee4778887d 100644
+--- a/gdk/x11/gdkwindow-x11.c
++++ b/gdk/x11/gdkwindow-x11.c
+@@ -2985,6 +2985,7 @@ gdk_window_x11_set_background (GdkWindow      *window,
+   double r, g, b, a;
+   cairo_surface_t *surface;
+   cairo_matrix_t matrix;
++  cairo_pattern_t *parent_relative_pattern;
+ 
+   if (GDK_WINDOW_DESTROYED (window))
+     return;
+@@ -2997,8 +2998,10 @@ gdk_window_x11_set_background (GdkWindow      *window,
+     }
+ 
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+-  if (pattern == gdk_x11_get_parent_relative_pattern ())
++  parent_relative_pattern = gdk_x11_get_parent_relative_pattern ();
+ G_GNUC_END_IGNORE_DEPRECATIONS
++
++  if (pattern == parent_relative_pattern)
+     {
+       GdkWindow *parent;
+ 
-- 
2.21.0


Merged 34454 34528 34658. Request was from Mark H Weaver <mhw <at> netris.org> to control <at> debbugs.gnu.org. (Sat, 30 Mar 2019 03:50:04 GMT) Full text and rfc822 format available.

Changed bug title to 'Gtk upstream bug #1280 causes crashes in IceCat and Emacs' from 'Emacs crashes' Request was from Mark H Weaver <mhw <at> netris.org> to control <at> debbugs.gnu.org. (Sat, 30 Mar 2019 03:50:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Sat, 30 Mar 2019 04:57:03 GMT) Full text and rfc822 format available.

Message #24 received at 34658 <at> debbugs.gnu.org (full text, mbox):

From: Carlo Zancanaro <carlo <at> zancanaro.id.au>
To: Mark H Weaver <mhw <at> netris.org>
Cc: Bradley Haggerty <bradigger <at> gmail.com>,
 Ludovic Courtès <ludo <at> gnu.org>, 34454 <at> debbugs.gnu.org,
 34658 <at> debbugs.gnu.org, 34528 <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>,
 Joshua Branson <jbranso <at> dismail.de>
Subject: Re: Gtk upstream bug #1280 causes crashes in IceCat and Emacs
Date: Sat, 30 Mar 2019 15:56:33 +1100
Hi Mark,

Thanks so much for taking a look at this!

On Sat, Mar 30 2019, Mark H Weaver wrote:
> If those affected by this issue would like to test this patch 
> and report back, that would be helpful.

I applied your patch to my local Guix, and everything is working 
fine again. I had been working around the problem by using 
emacs-no-x-toolkit, but with your patch I can use the normal emacs 
package again without issues.

Carlo




Information forwarded to bug-guix <at> gnu.org:
bug#34658; Package guix. (Sun, 31 Mar 2019 10:09:03 GMT) Full text and rfc822 format available.

Message #27 received at 34658 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: Bradley Haggerty <bradigger <at> gmail.com>, 34454 <at> debbugs.gnu.org,
 34658 <at> debbugs.gnu.org, Carlo Zancanaro <carlo <at> zancanaro.id.au>,
 34528 <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>,
 Joshua Branson <jbranso <at> dismail.de>
Subject: Re: Gtk upstream bug #1280 causes crashes in IceCat and Emacs
Date: Sun, 31 Mar 2019 12:07:57 +0200
Hi Mark,

Mark H Weaver <mhw <at> netris.org> skribis:

> I looked into this, and I believe all of these bugs are caused by Gtk
> upstream bug #1280:
>
>   https://gitlab.gnome.org/GNOME/gtk/issues/1280
>
> which is apparently fixed by the following upstream commit:
>
>   https://gitlab.gnome.org/GNOME/gtk/commit/e3a1593a0984cc0156ec1892a46af8f256a64878

Woow, thanks for tracking it down and for pushing a fix!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Apr 2019 11:24:07 GMT) Full text and rfc822 format available.

bug unarchived. Request was from jbranso <at> dismail.de to control <at> debbugs.gnu.org. (Fri, 20 Mar 2020 15:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Apr 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.