GNU bug report logs - #78662
feature/igc: [PATCH] Make buffer_local_symbols exact roots

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Helmut Eller <eller.helmut@HIDDEN>; Keywords: patch; Done: Pip Cet <pipcet@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 78662-done <at> debbugs.gnu.org:


Received: (at 78662-done) by debbugs.gnu.org; 1 Jun 2025 09:30:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 01 05:30:15 2025
Received: from localhost ([127.0.0.1]:36482 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uLf1C-0003SA-1I
	for submit <at> debbugs.gnu.org; Sun, 01 Jun 2025 05:30:15 -0400
Received: from mail-10629.protonmail.ch ([79.135.106.29]:27675)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>)
 id 1uLf16-0003QI-Oc
 for 78662-done <at> debbugs.gnu.org; Sun, 01 Jun 2025 05:30:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1748770201; x=1749029401;
 bh=PtfdsM7q6Ov4EGQyASwQRo3t6LpvbSOkl9s31lqehTg=;
 h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;
 b=FA4to2cllZaS9EV+LxmC9BkD2tvdgGa7Pedqet9dFb01U5hhtg9gkURroWVjv7NDb
 xPAmq/9uj266mkOmnPaL8nHGodJVviDCrn0GvFYAQja7cOTRBy+1GyPL91M1u/zU0k
 WT7pqO24WPLrLga8bSO58PXWx4tgRj90wTP3G/GR+lMX1F6EB1J79psgnTesX7rZJk
 zBb1rU6coRiPC07UE8Zh1WWS8Uv4RB+0wk9UpjDbNLh3pfDNIsLZJEg981valpRCd/
 Wp0W+IB6ZAHVuNpFhdP6lOkW6nRs291FBXPjWW3BB4Fz5OlGSVq3bQd6v14g0Q8c2m
 Q1dMxR5IjnqMQ==
Date: Sun, 01 Jun 2025 09:29:55 +0000
To: Helmut Eller <eller.helmut@HIDDEN>
From: Pip Cet <pipcet@HIDDEN>
Subject: Re: bug#78662: feature/igc: [PATCH] Make buffer_local_symbols exact
 roots
Message-ID: <87sekjern4.fsf@HIDDEN>
In-Reply-To: <87v7pfkgcv.fsf@HIDDEN>
References: <87v7pfkgcv.fsf@HIDDEN>
Feedback-ID: 112775352:user:proton
X-Pm-Message-ID: 85ec204029cb7c8f98e6ce7719f16c13fa0522bb
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78662-done
Cc: 78662-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"Helmut Eller" <eller.helmut@HIDDEN> writes:

> Tracing buffer_local_symbols and buffer_defaults exactly as in
> the patch seems to work.

Thanks.  I see no reason why it wouldn't work, and it doesn't crash, so
I've pushed it and am closing the bug.

I did note that buffer_defaults.text changes from NULL to
&buffer_defaults.own_text on the first scan, but this seems harmless to
me.

If these strange objects (no MPS header, these two have a vectorlike
header but buffer_local_flags doesn't, not necessarily lisp-aligned)
cause any trouble, we could always allocate them on the MPS heap, giving
us the very slight benefit of putting some words behind a barrier.

Pip





Notification sent to Helmut Eller <eller.helmut@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Pip Cet <pipcet@HIDDEN>:
You have taken responsibility. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Jun 2025 08:37:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 01 04:37:18 2025
Received: from localhost ([127.0.0.1]:36283 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uLeBx-0005kk-Fv
	for submit <at> debbugs.gnu.org; Sun, 01 Jun 2025 04:37:18 -0400
Received: from lists.gnu.org ([2001:470:142::17]:49846)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eller.helmut@HIDDEN>)
 id 1uLeBv-0005kA-OO
 for submit <at> debbugs.gnu.org; Sun, 01 Jun 2025 04:37:16 -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 <eller.helmut@HIDDEN>)
 id 1uLeBp-0004R9-Q2
 for bug-gnu-emacs@HIDDEN; Sun, 01 Jun 2025 04:37:09 -0400
Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eller.helmut@HIDDEN>)
 id 1uLeBo-0006b3-8f
 for bug-gnu-emacs@HIDDEN; Sun, 01 Jun 2025 04:37:09 -0400
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-adb5fd85996so28084766b.2
 for <bug-gnu-emacs@HIDDEN>; Sun, 01 Jun 2025 01:37:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1748767026; x=1749371826; darn=gnu.org;
 h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc
 :subject:date:message-id:reply-to;
 bh=h6LPU/zyZnwRC9suWiKrxdR0y0byAwwE1n0J8B6m3wE=;
 b=LY2XFQuWQu9vwRgGV5WEdxRVEqF16cWQSROR9A+8MzUfLEvCO7EwS2fWbHggOccOAO
 FPERxnfwIG3B3pR6FMug7gMfrskyMTIFOKx1wPh66yVFW6HZmb3s9VjKG/f7JBkIcjxY
 8xZ/0mVVZfVjddBJIRyq63PPeQ0RXNc7bj9yLg9JTFPwQmBTH6r1SfA7T9caqviaFfjL
 kuQweHViwMMizvCDdeQHSKXHoMDE6REaBiwyTciQbfRacegH7sA1+UqxbvbQ0W8aSI01
 +0IJNRiC47HtJTsGU/GlrPHlNszXI4tJdVmxYe/wf22UpR9FvuKrbkXpF3rX+weO0B7H
 6YTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1748767026; x=1749371826;
 h=mime-version:user-agent:message-id:date:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=h6LPU/zyZnwRC9suWiKrxdR0y0byAwwE1n0J8B6m3wE=;
 b=OsZecwKXCQTqu4dsXZOfWZvZKyCH5PJlqZa1xjoUxQC9gAIn2MyYGxtlP9kr89eLk6
 YwRGbBYI6gvVWz99WVj85bEwFv8PSS3FIAht+4McP/NP8C6M/YdOtugFCRnKbKoNdWpQ
 p2EoXE2znSAnduL6tb6vx9AoxebN47EQFQ++/Y80oI6UXX71lKkj4sZ+C4xWwwFHagtl
 hvO1aJzuihzMcob04Cnlx34rPo+37/EEouf4LA3e4wGGsiZ9hn6paYuc+j7EhFSbfXug
 SknzSkVU1qoKQqyx7ld6riKoWDVt86j4AURBLuPAXTEZUdT5mYEM501wn9HjAtXo6hA0
 NJPQ==
X-Gm-Message-State: AOJu0Yx8BKe5aanKjUErvvfqSgZzSJDDTm7ja+y3Zs2FRmHNSlIZi0kk
 uMXAxsOJVx//zN6pumYQLJBqeselUC9herLEOH1CyW9JEbuf7nzCQHGbSIVXcQ==
X-Gm-Gg: ASbGnculUVFXxnfYQXFLzazKgw1KoYhzxx4YcjbgUd+hFDtQfzIvLIDpihZDOVn1+Ws
 IsuhuOo5OGvyIY0K9ZqrvNV6U0pU6DYS+2OGeCpPs0f4uvRV1LuLg3oX7nqbCdIEXjADvzxAnmF
 /3AUfcyc+4bbIUEl+5EqPD/D2yC7kYvkFTtVyAKiepzmC8YIGmw/1rPN8l2GzvIJVeCkfT/DXhl
 ZmP/AdUYbqA7szbaFiZ3hp6pH4AkigwMVrXs8Cxc9Oag3ohB54CKhs5Im1i6kHKZ+L9hizxrVVb
 ueO/7e0FcGa/A5MG7UwBCY6dLk/RQhDR/YA5xFRu2R8fZZ3A/Tr1SxCtBcQ=
X-Google-Smtp-Source: AGHT+IHmzX87F8QOjdA5gh5jdDZlpaGbW1SBhcBgrugy0+IhZ56RYDJKGB98cuJyO2XlTVpTO01ulA==
X-Received: by 2002:a17:906:dc8d:b0:ad2:3f1f:7974 with SMTP id
 a640c23a62f3a-adb493aba1dmr433760266b.10.1748767026049; 
 Sun, 01 Jun 2025 01:37:06 -0700 (PDT)
Received: from caladan ([89.107.110.32]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-ada5d7fed8bsm620810166b.28.2025.06.01.01.37.05
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 01 Jun 2025 01:37:05 -0700 (PDT)
From: Helmut Eller <eller.helmut@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: feature/igc: [PATCH] Make buffer_local_symbols exact roots
X-Debbugs-Cc: 
Date: Sun, 01 Jun 2025 10:37:04 +0200
Message-ID: <87v7pfkgcv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::630;
 envelope-from=eller.helmut@HIDDEN; helo=mail-ej1-x630.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

Tracing buffer_local_symbols and buffer_defaults exactly as in
the patch seems to work.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Make-buffer_defaults-and-buffer_local_symbols-exact-.patch

From f1709d2c66f4cb88af2645f61e761fc50e10384c Mon Sep 17 00:00:00 2001
From: Helmut Eller <eller.helmut@HIDDEN>
Date: Sun, 1 Jun 2025 10:29:58 +0200
Subject: [PATCH] Make buffer_defaults and buffer_local_symbols exact roots

* src/igc.c (root_create_buffer): Create exact roots.
(scan_buffer): New helper.
---
 src/igc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/igc.c b/src/igc.c
index 9c3c8e82758..f63b0fe8c88 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -2196,6 +2196,14 @@ fix_buffer (mps_ss_t ss, struct buffer *b)
   return MPS_RES_OK;
 }
 
+static mps_res_t
+scan_buffer (mps_ss_t ss, void *start, void *end, void *closure)
+{
+  igc_assert (PSEUDOVECTOR_TYPE (start) == PVEC_BUFFER);
+  igc_assert ((char *) end - (char *) start == sizeof (struct buffer));
+  return fix_buffer (ss, start);
+}
+
 static mps_res_t
 fix_glyph_pool (mps_ss_t ss, struct glyph_pool *pool)
 {
@@ -2887,8 +2895,7 @@ root_create_lispsym (struct igc *gc)
 static void
 root_create_buffer (struct igc *gc, struct buffer *b)
 {
-  void *start = &b->name_, *end = &b->own_text;
-  root_create_ambig (gc, start, end, "buffer");
+  root_create_exact (gc, b, b + 1, scan_buffer, "buffer");
 }
 
 static void
-- 
2.39.5


--=-=-=--




Acknowledgement sent to Helmut Eller <eller.helmut@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#78662; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 1 Jun 2025 09:45:02 UTC

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