Github messages for voidlinux
 help / color / mirror / Atom feed
From: gc-user <gc-user@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
Date: Thu, 02 Nov 2023 14:04:08 +0100	[thread overview]
Message-ID: <20231102130408.F88_MAuEzfZ06uTS4cpFmojogPJOA3NvMvzGhfzu-LE@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-47014@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

There is an updated pull request by gc-user against master on the void-packages repository

https://github.com/gc-user/void-packages master
https://github.com/void-linux/void-packages/pull/47014

gimp: applying gtk patch to stop crash when using with wacom tablet
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
YES

GIMP (with combination xf86-input-wacom v1.2.0_1) doesn't crash anymore when performing actions that make it reliably crash with GIMP v2.10.34_2.

#### Local build testing
- I built this PR locally for my native architecture, (x86_64, glibc 2.36_2)


A patch file from https://github.com/void-linux/void-packages/pull/47014.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-47014.patch --]
[-- Type: text/x-diff, Size: 3442 bytes --]

From 11a2c55d1f40ba4ed6d0b9c530f71a5d8939d3eb Mon Sep 17 00:00:00 2001
From: gc-user <37037831+gc-user@users.noreply.github.com>
Date: Wed, 1 Nov 2023 21:43:22 +0100
Subject: [PATCH 1/2] GIMP: applying gtk patch to stop crash when using with
 wacom tablet

See discussion of the problem:
https://github.com/void-linux/void-packages/issues/46975

See patch that was applied:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/935.patch
---
 srcpkgs/gimp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gimp/template b/srcpkgs/gimp/template
index cdaa6ded089bb..d9008e8e1d294 100644
--- a/srcpkgs/gimp/template
+++ b/srcpkgs/gimp/template
@@ -1,7 +1,7 @@
 # Template file for 'gimp'
 pkgname=gimp
 version=2.10.34
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--disable-check-update --datadir=/usr/share --disable-python"
 hostmakedepends="automake gegl gettext-devel glib-devel gtk+-devel intltool

From d0db936d97b13afc38dace29a49d46d1d018f075 Mon Sep 17 00:00:00 2001
From: gc-user <37037831+gc-user@users.noreply.github.com>
Date: Wed, 1 Nov 2023 21:46:11 +0100
Subject: [PATCH 2/2] gimp: adding gtk patch

See discussion of the problem:
void-linux#46975 See patch that was applied:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/935.patch
---
 srcpkgs/gimp/patches/gtk-workaround.patch | 40 +++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 srcpkgs/gimp/patches/gtk-workaround.patch

diff --git a/srcpkgs/gimp/patches/gtk-workaround.patch b/srcpkgs/gimp/patches/gtk-workaround.patch
new file mode 100644
index 0000000000000..c78b63ad56033
--- /dev/null
+++ b/srcpkgs/gimp/patches/gtk-workaround.patch
@@ -0,0 +1,40 @@
+--- a/app/widgets/gimpdeviceinfo-coords.c
++++ b/app/widgets/gimpdeviceinfo-coords.c
+@@ -121,12 +121,37 @@ gimp_device_info_get_event_coords (GimpDeviceInfo *info,
+   return FALSE;
+ }
+ 
++#define GIMP_AXIS_HOPEFULLY_LAST 36
++/* gtk2 has a bug where gdk_device_get_state may write
++   more coordinates than GDK_AXIS_LAST in a caller-provided
++   array, resulting in a buffer overflow.
++
++   This happens when the underlying X device supports more axes -- as
++   of 2023, the Wacom tablet driver 1.20 supports 8 axes when
++   GDK_AXIS_LAST is 7.
++
++   To be safe we over-estimate the maximum number of axes that any
++   driver may provide to gtk, to avoid buffer overflows. It would be nicer
++   to fix gdk upstream (to never write more than GDK_AXIS_LAST - GDK_AXIS_X
++   coordinates), but the proper upstream fix was rejected as gtk2 is EOL:
++    https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6045
++
++   Our constant might in theory become wrong if new device drivers
++   start returning much more axes than they do today -- more than 32,
++   when the current maximum is 8. Hopefully, by the time this happens,
++   users have migrated to gtk3 versions of gimp that use a different
++   API and do not suffer from this bug.
++
++   We chose 36 as it is also the internal limit MAX_VALUATORS on the
++   number of 'valuators' used by current X server implementations.
++*/
++
+ void
+ gimp_device_info_get_device_coords (GimpDeviceInfo *info,
+                                     GdkWindow      *window,
+                                     GimpCoords     *coords)
+ {
+-  gdouble axes[GDK_AXIS_LAST] = { 0, };
++  gdouble axes[GIMP_AXIS_HOPEFULLY_LAST] = { 0, };
+ 
+   *coords = default_coords;

  parent reply	other threads:[~2023-11-02 13:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 21:02 [PR PATCH] GIMP: " gc-user
2023-11-01 21:07 ` oreo639
2023-11-01 21:09 ` oreo639
2023-11-01 21:09 ` oreo639
2023-11-01 21:12 ` oreo639
2023-11-01 21:13 ` oreo639
2023-11-01 21:14 ` oreo639
2023-11-01 21:14 ` gc-user
2023-11-01 21:16 ` oreo639
2023-11-02 13:04 ` gc-user [this message]
2023-11-02 13:15 ` [PR PATCH] [Updated] gimp: " gc-user
2023-11-02 13:18 ` gc-user
2023-11-02 13:21 ` gc-user
2023-11-02 13:24 ` gc-user
2023-11-02 16:51 ` [PR REVIEW] " paper42
2023-11-02 17:00 ` gc-user
2023-11-02 19:28 ` oreo639
2023-11-02 19:28 ` oreo639
2023-11-02 19:30 ` biopsin
2023-11-02 19:51 ` [PR PATCH] [Updated] " gc-user
2023-11-02 20:17 ` gc-user
2023-11-02 20:21 ` [PR REVIEW] " gc-user
2024-02-01  1:45 ` github-actions
2024-02-04  8:08 ` [PR PATCH] [Closed]: " oreo639
2024-02-04  8:08 ` oreo639

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231102130408.F88_MAuEzfZ06uTS4cpFmojogPJOA3NvMvzGhfzu-LE@z \
    --to=gc-user@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).