From patchwork Wed Mar 26 08:03:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: msglm X-Patchwork-Id: 40837 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2315227BBEC; Wed, 26 Mar 2025 08:05:35 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4F54527BBE2 for ; Wed, 26 Mar 2025 08:05:34 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1txLl3-0007VV-2B; Wed, 26 Mar 2025 04:05:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txLl0-0007V7-UC for guix-patches@gnu.org; Wed, 26 Mar 2025 04:05:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1txLl0-0007Xc-Je for guix-patches@gnu.org; Wed, 26 Mar 2025 04:05:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=wQoqHNhji8QiOjBCAwalfT8anA27+6agWP9lsn+Enng=; b=YNg9WlRBs2l6sH+dL7A/9IhGRkI8RyH4YJ1LIFsEwPGNB5HMOmaCFMFPf0uZuXmdnB7CxHKF3cD+/WtcC61X65TywElKg3SBMoxekY+BpqTuOpnwbg53Om4TaZPSyOSJH9perMaVZIgQqkXPlkDlM3H5YCVgeyB0MTOpdNtP+GBLsFo9TYYCtMNmfVTrBVbsqQgRsT7Gy0xHADqV7XlO8ULDbMnBxWL++8S5jX4Dzh8CSQCz91TtZhdLQohxI510qLL+mX50+K6XK/pbFaxPSD9S2CJW0+wQv+iaKfh77heFI/5M9EJR4BVw0p8LGOQ+qjGCixW0zQU9/82Zuufu2g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1txLl0-0003gf-Bg for guix-patches@gnu.org; Wed, 26 Mar 2025 04:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77271] [PATCH 1/2] gnu: openbox: Fix alt-tabbing crash Resent-From: msglm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Mar 2025 08:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77271 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77271@debbugs.gnu.org Cc: msglm X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174297629114136 (code B ref -1); Wed, 26 Mar 2025 08:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Mar 2025 08:04:51 +0000 Received: from localhost ([127.0.0.1]:41161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txLko-0003fv-NN for submit@debbugs.gnu.org; Wed, 26 Mar 2025 04:04:51 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58760) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txLkm-0003fa-9q for submit@debbugs.gnu.org; Wed, 26 Mar 2025 04:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txLkg-0007Rj-TI for guix-patches@gnu.org; Wed, 26 Mar 2025 04:04:42 -0400 Received: from techchud.xyz ([2001:19f0:6401:770:5400:3ff:feee:3207] helo=mail.techchud.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txLke-0007Ua-T4 for guix-patches@gnu.org; Wed, 26 Mar 2025 04:04:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=techchud.xyz; s=mail; t=1742976275; bh=8vjJiK3YkX2Uw5Tc5d8fiskLfnf6BaU8tr2OIbcdw8w=; h=From:To:Cc:Subject:Date:From; b=d/+CbpFbunjL47LulIF1oH2L5ii1xNa0wwPg4CrEoKe4oS8rZ6QaOftEhE23LavxN XOJv5Zouox3J+hOGLvcEyhkgeIbEbDRbp/3Bkoir6JCNYFPMid8w1xVwbkM/knP8n0 UQxuN1wrRhJk/pfX3bqU4UB9gt45xqOeFaFsrglB3ngGboA57KLgvSgJOX1rw3d740 OT3v8PD3TvE0y+Xg5tQRvDwLv9xcMCBKZnfFoyS+Vh079Gt3bLF6pCSWaXyZab770b Hs0FxtY4mgqILYfi9UeMwVtG7UkTU/pzNUgRnypb3B1ao5a41p9bA9cNciUuouxJ3F OZVIaquce7e5Q== Date: Wed, 26 Mar 2025 03:03:27 -0500 Message-ID: <9d96f0a2d095e74f1a4bf0ef1d8f60138810321d.1742976208.git.msglm@techchud.xyz> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2001:19f0:6401:770:5400:3ff:feee:3207; envelope-from=msglm@techchud.xyz; helo=mail.techchud.xyz X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.179, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: msglm X-ACL-Warn: , msglm via Guix-patches X-Patchwork-Original-From: msglm via Guix-patches via From: msglm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 base-commit: 4d655e48836d5be89942a38da532431316f6887b 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 +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)