From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#75322: SAFE_ALLOCA assumed to root Lisp_Objects/SSDATA(string) Date: Sun, 05 Jan 2025 09:19:17 +0100 Message-ID: References: <87jzbbke6u.fsf@protonmail.com> <865xmtaeh9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14317"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pipcet@protonmail.com, 75322@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 09:20:13 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tULro-0003Yq-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 09:20:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tULrg-000440-Jh; Sun, 05 Jan 2025 03:20:04 -0500 Original-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 1tULrf-00042u-9g for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 03:20:03 -0500 Original-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 1tULre-0001Hm-LA for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 03:20:03 -0500 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:References:In-Reply-To:From:To:Subject; bh=/q4veFksP449FDi3aRQrzWYmOr5GFArhMF2SmJOGKxg=; b=JAQVCzYZzr33SQYAZ1t6qfX2UrVsxADfZuEZBy5UTgcj2hbisf0JePerwjznm4rM9X7w6+j0RyJG7VysNTziafq+z949XSOphwS3UEGGMVgOrEcuxaSpoiDPJ45qMuNShSYMlxU7/ro90pl0VVPRyIPyu17XMlQ4Dmi4C+w8bp1HLAXbYr3OWw4q7rktcAU78pmWu4mCWAnOqUsVAVKz2qZ3ePlPARflyrtAk1vVikLtXN+f80UOmI0W+0pYYhXLT/2CitPfGXgqUORjOInx3Z+mgGQTjdXtsXOr+/R0uRjtKW4a/Utl1rrs3yti0oOR4xCBFO+kF5ftwsle7/6xRA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tULre-0003cT-GK for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 03:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 08:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75322 X-GNU-PR-Package: emacs Original-Received: via spool by 75322-submit@debbugs.gnu.org id=B75322.173606517013861 (code B ref 75322); Sun, 05 Jan 2025 08:20:02 +0000 Original-Received: (at 75322) by debbugs.gnu.org; 5 Jan 2025 08:19:30 +0000 Original-Received: from localhost ([127.0.0.1]:59707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tULr8-0003bS-02 for submit@debbugs.gnu.org; Sun, 05 Jan 2025 03:19:30 -0500 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:51513) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tULr4-0003b5-7f for 75322@debbugs.gnu.org; Sun, 05 Jan 2025 03:19:28 -0500 Original-Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436249df846so92735895e9.3 for <75322@debbugs.gnu.org>; Sun, 05 Jan 2025 00:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736065159; x=1736669959; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/q4veFksP449FDi3aRQrzWYmOr5GFArhMF2SmJOGKxg=; b=k0LW4EZAEpkiUsxPxAEtU1kWujQYX+h+3oM1kBIGzkCoa+3oUsaGMyKnpb/cZk/O/u VpZ4NPBqGfwUk4P0z4X119P6mxr0gvCrVfSBwzARnZekLkT0op4O/PPicnEiIdOtJOQg NnghYrUb8/dDIo6aP6DZ4P44sVE0VCuKtt3Ei1UxFFkUldOY0DHtBRo/SM76jvgxt4Sa t62Hk4ckeornu6SJuPZJ/2Y4Ws7yRoghsIwUoaPxG/dPUQtGfflxn87f5HahmjOiTtzH bp/Fpspg+PWBjKISvB6pFGncLdkGDjxurCla71WOY3rN+W+4CPBx/od6Cw28zB9GbsaP ha5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736065159; x=1736669959; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/q4veFksP449FDi3aRQrzWYmOr5GFArhMF2SmJOGKxg=; b=A5Rx0T+Ficdf+EI9oZORq9N70uMzcSpfU3xF6RZy14JZzAZJnc23bmIqrhYMF2bszz XTFwzlXxC5Bfhu1arkzUP4T3wf9BmUSLPLJSUfvnlVJFgW5CJoDh4eZG+VFAKIsQ6d6j d5HqSX7U6bGKRcIIqfCX3njD5g0f3EOU10jbNFEkWUxWmGJ2c17ZmHwAoIqEhS6r30X8 rEoLRl0tOPyVASUmF1FuLRdK9GeuRA26/KIfhJfUek4SGhaX5fszFcSZJUCKIFnFg0aN CfPRaqtezPTojgOyTkGS9biMG5CR4bCS246+5WCtD/2RbA5Q5hsRHaFZ7q+LS1bq7y6Q 3OvA== X-Forwarded-Encrypted: i=1; AJvYcCVgvGW2csif77AK7+9s975OdpAhljKzD+ymfS8ELekVMOje1m6wiTNEyDQsvYyu+o+BVAzwfA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzAhDv9OsCo0b9cm1EaXK2jh/w8+tUeLGT1cvTPJrCdQTcRI/ie HOcNktQF7KOj5IWv1bTQU4LdqJYobeEhDAwaoCxUw/SFQ8N/uHZnIz23gg== X-Gm-Gg: ASbGncsRE7HYWx8G/Samc7vMwejPuprK+ZTNXvgQyznXaeG3k0FNGZEo81+yNHX+x0b LnZEaac0NjqXXl/mjBogFpnz8vnYNxTMijM+x1mndV+uypYqEWARbnLkIVszn8f1TCr9jbJwYxu xgOrEym6SmSLy+RHwHqX+nMa1C7FP2W2Pc1wzA/KjLeiSivKGlrTkauXQDrofemouzIhN0WmUsS 5/GAPTBsghUGRKxHwK7Tu7krMJAlR4lXsPlooNAzaRt0zDsHbLhVbd9ppcPxhNPPE5tYBfA1qc8 fO+OSm5SUcBqvflw5hkrrvd6hogaqQCoSfcGVLIo/ljQt5sf6nwHQbz1Oe6l9WQGxQ== X-Google-Smtp-Source: AGHT+IGCAwE5rTSJbHWfVWcflYyjPiKiV/jt+i770P9zBroa2xxlSK6LvjnxuHIRTQPyL7OSH0g3Hw== X-Received: by 2002:a05:600c:3554:b0:434:a923:9310 with SMTP id 5b1f17b1804b1-43668646103mr498058125e9.15.1736065159450; Sun, 05 Jan 2025 00:19:19 -0800 (PST) Original-Received: from pro2 (p200300e0b747500078d774d9859911e7.dip0.t-ipconnect.de. [2003:e0:b747:5000:78d7:74d9:8599:11e7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c833149sm44566126f8f.39.2025.01.05.00.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 00:19:19 -0800 (PST) In-Reply-To: <865xmtaeh9.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Jan 2025 09:48:02 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298514 Archived-At: Eli Zaretskii writes: >> Cc: 75322@debbugs.gnu.org >> From: Gerd M=C3=B6llmann >> Date: Sun, 05 Jan 2025 07:32:46 +0100 >>=20 >> Just want to add that all SAFE_NALLOC uses should be checked in >> scratch/igc. For example, set_overlays_multibyte uses it to store >> itree_node *, and itree_node is in MPS. > > Can you tell more about what should be checked and how? I'm probably > missing some details of the igc build, because I cannot translate what > you say above into practical actions of auditing the code. > > Thanks. I'd grep for SAFE_NALLOCA, and for each occurrence, see what is stored in the memory allocated. If that is a reference to MPS-allocated memory (a pointer or Lisp_Object), it should be changed, because it then hides references from MPS in malloc'd memory. Or can hide, to be more precise, in the case it doesn't use alloca. Or alternatively, you could avoid having to do that, and make SAFE_NALLOCA xmalloc an ambiguous root. A patch for that is in the other mail I sent. I think the performance impact of that is negligible because this path is only executed when SAFE_ALLOCA does not use alloca.