GNU bug report logs -
#77271
[PATCH 1/2] gnu: openbox: Fix alt-tabbing crash
Previous Next
Reported by: msglm <msglm <at> techchud.xyz>
Date: Wed, 26 Mar 2025 08:05:02 UTC
Severity: normal
Tags: patch
Done: Danny Milosavljevic <dannym <at> friendly-machines.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 77271 in the body.
You can then email your comments to 77271 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#77271
; Package
guix-patches
.
(Wed, 26 Mar 2025 08:05:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
msglm <msglm <at> techchud.xyz>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Wed, 26 Mar 2025 08:05:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Add patch to fix crashing when full screening and alt-tabbing.
Patch harvested from:
https://bugs.archlinux.org/attachments/77853/22501/0001-add-fix-for-glib2-exposed-segfault.patch
* gnu/packages/openbox.scm (openbox): New patch
* gnu/packages/patches/openbox-add-fix-for-glib2-exposed-segfault.patch: New File
Change-Id: I593b50bf14bdbeb300ea545ab9efe184651112fb
---
gnu/packages/openbox.scm | 2 +-
...x-add-fix-for-glib2-exposed-segfault.patch | 50 +++++++++++++++++++
2 files changed, 51 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/openbox-add-fix-for-glib2-exposed-segfault.patch
diff --git a/gnu/packages/openbox.scm b/gnu/packages/openbox.scm
index 38afb9d9a0..85c3bda958 100644
--- a/gnu/packages/openbox.scm
+++ b/gnu/packages/openbox.scm
@@ -51,7 +51,7 @@ (define-public openbox
(sha256
(base32
"0vg2y1qddsdxkjv806mzpvmkgzliab8ll4s7zm7ma5jnriamirxb"))
- (patches (search-patches "openbox-python3.patch"))))
+ (patches (search-patches "openbox-add-fix-for-glib2-exposed-segfault.patch" "openbox-python3.patch"))))
(build-system gnu-build-system)
(arguments
(list #:phases
diff --git a/gnu/packages/patches/openbox-add-fix-for-glib2-exposed-segfault.patch b/gnu/packages/patches/openbox-add-fix-for-glib2-exposed-segfault.patch
new file mode 100644
index 0000000000..ef68d31213
--- /dev/null
+++ b/gnu/packages/patches/openbox-add-fix-for-glib2-exposed-segfault.patch
@@ -0,0 +1,50 @@
+From 9ed6fdd71890c5cc43747f105382d5677e5d37e7 Mon Sep 17 00:00:00 2001
+From: pldubouilh <pldubouilh <at> gmail.com>
+Date: Fri, 17 Mar 2023 18:23:47 +0100
+Subject: [PATCH] Fix list traversal issue in client_calc_layer
+
+The calls to client_calc_layer_internal can modify stacking_list, which
+can cause us to follow dangling ->next pointers (either by the pointer
+itself already being freed, or it pointing to a freed area). Avoid this
+by copying the list first, the goal is to visit every client in the list
+once so this should be fine.
+---
+ openbox/client.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/openbox/client.c b/openbox/client.c
+index 7168b2407..b8264587c 100644
+--- a/openbox/client.c
++++ b/openbox/client.c
+@@ -2742,9 +2742,12 @@ static void client_calc_layer_internal(ObClient *self)
+ void client_calc_layer(ObClient *self)
+ {
+ GList *it;
++ /* the client_calc_layer_internal calls below modify stacking_list,
++ so we have to make a copy to iterate over */
++ GList *list = g_list_copy(stacking_list);
+
+ /* skip over stuff above fullscreen layer */
+- for (it = stacking_list; it; it = g_list_next(it))
++ for (it = list; it; it = g_list_next(it))
+ if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;
+
+ /* find the windows in the fullscreen layer, and mark them not-visited */
+@@ -2757,7 +2760,7 @@ void client_calc_layer(ObClient *self)
+ client_calc_layer_internal(self);
+
+ /* skip over stuff above fullscreen layer */
+- for (it = stacking_list; it; it = g_list_next(it))
++ for (it = list; it; it = g_list_next(it))
+ if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;
+
+ /* now recalc any windows in the fullscreen layer which have not
+@@ -2768,6 +2771,8 @@ void client_calc_layer(ObClient *self)
+ !WINDOW_AS_CLIENT(it->data)->visited)
+ client_calc_layer_internal(it->data);
+ }
++
++ g_list_free(it);
+ }
+
+ gboolean client_should_show(ObClient *self)
base-commit: 4d655e48836d5be89942a38da532431316f6887b
--
2.48.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#77271
; Package
guix-patches
.
(Fri, 06 Jun 2025 00:12:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 77271 <at> debbugs.gnu.org (full text, mbox):
Thanks!
Pushed to guix master as commit 60e332adae600e230efb76e4027b764e3ae2c7dc.
bug closed, send any further explanations to
77271 <at> debbugs.gnu.org and msglm <msglm <at> techchud.xyz>
Request was from
Danny Milosavljevic <dannym <at> friendly-machines.com>
to
control <at> debbugs.gnu.org
.
(Fri, 06 Jun 2025 00:12:03 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
.
(Fri, 04 Jul 2025 11:24:17 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.