Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet
@ 2023-11-01 21:02 gc-user
  2023-11-01 21:07 ` oreo639
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: gc-user @ 2023-11-01 21:02 UTC (permalink / raw)
  To: ml

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

There is a new 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 922bc2d5e919eb76733bd2eeb78b6033400c97b0 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;

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
@ 2023-11-01 21:07 ` oreo639
  2023-11-01 21:09 ` oreo639
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:07 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789687591

Comment:
There should be a single commit and the commit name needs to follow the style guide:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
  2023-11-01 21:07 ` oreo639
@ 2023-11-01 21:09 ` oreo639
  2023-11-01 21:09 ` oreo639
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:09 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789687591

Comment:
There should be a single commit and the commit name needs to follow the style guide:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md

You can use `git reset HEAD~` and `git commit --amend` to fix this. Then do `git push -f`

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet 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
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:09 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789687591

Comment:
There should be a single commit and the commit name needs to follow the style guide:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md

You can use `git reset HEAD~ --soft` and `git commit --amend` to fix this. Then do `git push -f`

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (2 preceding siblings ...)
  2023-11-01 21:09 ` oreo639
@ 2023-11-01 21:12 ` oreo639
  2023-11-01 21:13 ` oreo639
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:12 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789687591

Comment:
There should be a single commit and the commit name needs to follow the style guide:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md

You can use `git reset --soft HEAD~` and `git commit --amend` to fix this. Then do `git push -f`

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (3 preceding siblings ...)
  2023-11-01 21:12 ` oreo639
@ 2023-11-01 21:13 ` oreo639
  2023-11-01 21:14 ` oreo639
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:13 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789687591

Comment:
There should be a single commit and the commit name needs to follow the style guide:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md

You can use `git reset --soft HEAD~` and `git commit --amend` to fix this. Then do `git push -f`
Also, in this case, gimp should be lowercase since the package name is lowercase.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (4 preceding siblings ...)
  2023-11-01 21:13 ` oreo639
@ 2023-11-01 21:14 ` oreo639
  2023-11-01 21:14 ` gc-user
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:14 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789687591

Comment:
There should be a single commit and the package name should be lowercase:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md

You can use `git reset --soft HEAD~` and `git commit --amend` to fix this. Then do `git push -f`.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (5 preceding siblings ...)
  2023-11-01 21:14 ` oreo639
@ 2023-11-01 21:14 ` gc-user
  2023-11-01 21:16 ` oreo639
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-01 21:14 UTC (permalink / raw)
  To: ml

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

New comment by gc-user on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789697095

Comment:
> There should be a single commit and the commit name needs to follow the style guide: https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md
> 
> You can use `git reset HEAD~ --soft` and `git commit --amend` to fix this. Then do `git push -f`

I'm using a web browser and my online repo for PRs.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: GIMP: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (6 preceding siblings ...)
  2023-11-01 21:14 ` gc-user
@ 2023-11-01 21:16 ` oreo639
  2023-11-02 13:04 ` [PR PATCH] [Updated] gimp: " gc-user
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-01 21:16 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1789699341

Comment:
You can clone your repo using the command line utility, steps are in `CONTRIBUTING.md`.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (7 preceding siblings ...)
  2023-11-01 21:16 ` oreo639
@ 2023-11-02 13:04 ` gc-user
  2023-11-02 13:15 ` gc-user
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 13:04 UTC (permalink / raw)
  To: ml

[-- 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;

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (8 preceding siblings ...)
  2023-11-02 13:04 ` [PR PATCH] [Updated] gimp: " gc-user
@ 2023-11-02 13:15 ` gc-user
  2023-11-02 13:18 ` gc-user
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 13:15 UTC (permalink / raw)
  To: ml

[-- 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 3cd7a68bf79471ccb518c6ae255195a3184f90be 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;

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (9 preceding siblings ...)
  2023-11-02 13:15 ` gc-user
@ 2023-11-02 13:18 ` gc-user
  2023-11-02 13:21 ` gc-user
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 13:18 UTC (permalink / raw)
  To: ml

[-- 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 6f6d4bb451962c5c5bd81d050e746b5284f974b1 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 eb67d4a42a1bdf17facca5c3e0f9947f00af554c 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;

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (10 preceding siblings ...)
  2023-11-02 13:18 ` gc-user
@ 2023-11-02 13:21 ` gc-user
  2023-11-02 13:24 ` gc-user
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 13:21 UTC (permalink / raw)
  To: ml

[-- 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: 3072 bytes --]

From b4ae183b7111fa153640d0eb9c117963ec51440b 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] 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/patches/gtk-workaround.patch | 40 +++++++++++++++++++++++
 srcpkgs/gimp/template                     |  2 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 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;
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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (11 preceding siblings ...)
  2023-11-02 13:21 ` gc-user
@ 2023-11-02 13:24 ` gc-user
  2023-11-02 16:51 ` [PR REVIEW] " paper42
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 13:24 UTC (permalink / raw)
  To: ml

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

New comment by gc-user on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1790718974

Comment:
Not sure if it worked as it should.
cli is a pita for me... :-)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (12 preceding siblings ...)
  2023-11-02 13:24 ` gc-user
@ 2023-11-02 16:51 ` paper42
  2023-11-02 17:00 ` gc-user
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: paper42 @ 2023-11-02 16:51 UTC (permalink / raw)
  To: ml

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

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#discussion_r1380467666

Comment:
where is this patch from? Could you add a source to the header?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (13 preceding siblings ...)
  2023-11-02 16:51 ` [PR REVIEW] " paper42
@ 2023-11-02 17:00 ` gc-user
  2023-11-02 19:28 ` oreo639
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 17:00 UTC (permalink / raw)
  To: ml

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

New review comment by gc-user on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#discussion_r1380479115

Comment:
The link is in the description of the commit:

https://github.com/void-linux/void-packages/pull/47014/commits/b4ae183b7111fa153640d0eb9c117963ec51440b

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (14 preceding siblings ...)
  2023-11-02 17:00 ` gc-user
@ 2023-11-02 19:28 ` oreo639
  2023-11-02 19:28 ` oreo639
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-02 19:28 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#discussion_r1380681134

Comment:
You should leave the patch header in. (E.g. the commit hash, the commit name, the commit date, the commit author, the commit description, etc)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (15 preceding siblings ...)
  2023-11-02 19:28 ` oreo639
@ 2023-11-02 19:28 ` oreo639
  2023-11-02 19:30 ` biopsin
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2023-11-02 19:28 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#discussion_r1380681134

Comment:
You should leave the patch header in. (Includes the commit hash, the commit name, the commit date, the commit author, the commit description, etc)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (16 preceding siblings ...)
  2023-11-02 19:28 ` oreo639
@ 2023-11-02 19:30 ` biopsin
  2023-11-02 19:51 ` [PR PATCH] [Updated] " gc-user
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: biopsin @ 2023-11-02 19:30 UTC (permalink / raw)
  To: ml

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

New review comment by biopsin on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#discussion_r1380682289

Comment:
> The link is in the description of the commit:
> 
> [b4ae183](https://github.com/void-linux/void-packages/commit/b4ae183b7111fa153640d0eb9c117963ec51440b)

Please avoid truncate the header text of patch as it shows the referance to source location.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (17 preceding siblings ...)
  2023-11-02 19:30 ` biopsin
@ 2023-11-02 19:51 ` gc-user
  2023-11-02 20:17 ` gc-user
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 19:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 729 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 (in combination with 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: 4820 bytes --]

From b4ae183b7111fa153640d0eb9c117963ec51440b 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/patches/gtk-workaround.patch | 40 +++++++++++++++++++++++
 srcpkgs/gimp/template                     |  2 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 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;
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 6aa1514f88f3e106d71cb9af547281e1835b199e Mon Sep 17 00:00:00 2001
From: gc-user <37037831+gc-user@users.noreply.github.com>
Date: Thu, 2 Nov 2023 20:51:36 +0100
Subject: [PATCH 2/2] Update gtk-workaround.patch

Put additional info about the patch back in.
---
 srcpkgs/gimp/patches/gtk-workaround.patch | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/srcpkgs/gimp/patches/gtk-workaround.patch b/srcpkgs/gimp/patches/gtk-workaround.patch
index c78b63ad56033..b89ab6480fad6 100644
--- a/srcpkgs/gimp/patches/gtk-workaround.patch
+++ b/srcpkgs/gimp/patches/gtk-workaround.patch
@@ -1,3 +1,23 @@
+Source: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/935.patch
+
+From 4c54950219fc1dcebafd734645ec3b9d31c7fe64 Mon Sep 17 00:00:00 2001
+From: Gabriel Scherer <gabriel.scherer@gmail.com>
+Date: Thu, 1 Jun 2023 16:23:22 +0200
+Subject: [PATCH] a workaround fix for a gdk_device_get_state bug
+
+See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6045
+
+This is an alternative, quick&dirty approach to the nicer but more
+invasive workaround:
+  https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/934
+
+Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+ app/widgets/gimpdeviceinfo-coords.c | 27 ++++++++++++++++++++++++++-
+ 1 file changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/app/widgets/gimpdeviceinfo-coords.c b/app/widgets/gimpdeviceinfo-coords.c
+index 93c1d90beae..024cd5b1b4d 100644
 --- a/app/widgets/gimpdeviceinfo-coords.c
 +++ b/app/widgets/gimpdeviceinfo-coords.c
 @@ -121,12 +121,37 @@ gimp_device_info_get_event_coords (GimpDeviceInfo *info,
@@ -38,3 +58,6 @@
 +  gdouble axes[GIMP_AXIS_HOPEFULLY_LAST] = { 0, };
  
    *coords = default_coords;
+ 
+-- 
+GitLab

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (18 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 20:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 729 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 (in combination with 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: 3919 bytes --]

From 5cec0c6c0464740e57b609dfe9e95634b351e9f3 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] 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/patches/gtk-workaround.patch | 63 +++++++++++++++++++++++
 srcpkgs/gimp/template                     |  2 +-
 2 files changed, 64 insertions(+), 1 deletion(-)
 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..b89ab6480fad6
--- /dev/null
+++ b/srcpkgs/gimp/patches/gtk-workaround.patch
@@ -0,0 +1,63 @@
+Source: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/935.patch
+
+From 4c54950219fc1dcebafd734645ec3b9d31c7fe64 Mon Sep 17 00:00:00 2001
+From: Gabriel Scherer <gabriel.scherer@gmail.com>
+Date: Thu, 1 Jun 2023 16:23:22 +0200
+Subject: [PATCH] a workaround fix for a gdk_device_get_state bug
+
+See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6045
+
+This is an alternative, quick&dirty approach to the nicer but more
+invasive workaround:
+  https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/934
+
+Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+ app/widgets/gimpdeviceinfo-coords.c | 27 ++++++++++++++++++++++++++-
+ 1 file changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/app/widgets/gimpdeviceinfo-coords.c b/app/widgets/gimpdeviceinfo-coords.c
+index 93c1d90beae..024cd5b1b4d 100644
+--- 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;
+ 
+-- 
+GitLab
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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (19 preceding siblings ...)
  2023-11-02 20:17 ` gc-user
@ 2023-11-02 20:21 ` gc-user
  2024-02-01  1:45 ` github-actions
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: gc-user @ 2023-11-02 20:21 UTC (permalink / raw)
  To: ml

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

New review comment by gc-user on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#discussion_r1380726854

Comment:
I removed the "info part" for 2 reasons:

1. I wan't sure if the building process wouldn't fail with it in it.
2. I modeled the patch after the patches that were already present and they didn't have such a long header.

I fixed it now. Hope it worked alright.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (20 preceding siblings ...)
  2023-11-02 20:21 ` [PR REVIEW] " gc-user
@ 2024-02-01  1:45 ` github-actions
  2024-02-04  8:08 ` oreo639
  2024-02-04  8:08 ` [PR PATCH] [Closed]: " oreo639
  23 siblings, 0 replies; 25+ messages in thread
From: github-actions @ 2024-02-01  1:45 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1920338669

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Closed]: gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (22 preceding siblings ...)
  2024-02-04  8:08 ` oreo639
@ 2024-02-04  8:08 ` oreo639
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2024-02-04  8:08 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

gimp: applying gtk patch to stop crash when using with wacom tablet
https://github.com/void-linux/void-packages/pull/47014

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
YES

GIMP (in combination with 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)


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: gimp: applying gtk patch to stop crash when using with wacom tablet
  2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet gc-user
                   ` (21 preceding siblings ...)
  2024-02-01  1:45 ` github-actions
@ 2024-02-04  8:08 ` oreo639
  2024-02-04  8:08 ` [PR PATCH] [Closed]: " oreo639
  23 siblings, 0 replies; 25+ messages in thread
From: oreo639 @ 2024-02-04  8:08 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/47014#issuecomment-1925622924

Comment:
Should be resolved by https://github.com/void-linux/void-packages/commit/714700f8a0dda0ad3e1ed7c963c066eb384ff84f

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2024-02-04  8:08 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 21:02 [PR PATCH] GIMP: applying gtk patch to stop crash when using with wacom tablet 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 ` [PR PATCH] [Updated] gimp: " gc-user
2023-11-02 13:15 ` 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 ` oreo639
2024-02-04  8:08 ` [PR PATCH] [Closed]: " oreo639

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).