From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#75322: SAFE_ALLOCA assumed to root Lisp_Objects/SSDATA(string) Date: Sun, 05 Jan 2025 13:29:34 +0200 Message-ID: <86h66d8pnl.fsf@gnu.org> References: <87jzbbke6u.fsf@protonmail.com> <86sepx8sth.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23520"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pipcet@protonmail.com, 75322@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 12:30:19 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 1tUOpn-0005xY-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 12:30:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUOpd-0001dz-0F; Sun, 05 Jan 2025 06:30:09 -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 1tUOpZ-0001dD-Es for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:30:05 -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 1tUOpY-00050L-Qr for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:30:05 -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:References:In-Reply-To:From:Date:To:Subject; bh=86ZFKaFd58HtNLXMFamwBu3H3mnHFoqyRFzCcensGXg=; b=r/jkDtTvp64Kbpqumo2w623Ot+aeMX/QcygbBb3m8pB4FJfkh1DzE00m4V9XQY4CghY+j3NpZKM0rRLCB/5uqYyWpOiU5pX5ZGqc09bNzJErClY+tCDij3SRca9+AnRMMt5sM1N+HgGMz2aBe8SD5RjDTeEbb2LKkOQEWPYuKnZtt58maVdWgCB49OI/jTeE2SG743l1SUmDspQJKdlpACt2UmJv0aYK0bWSceReN/oZaiMe//PDr4VRKRPI/JTv88wtfRERBehKhmDt/nknmRjGUhg/TluP6YhESkUp6yYHTeehNq9jZcjqUQGrPcKY1jwkGg0fJ4c/6XC2k4fmVw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUOpY-00050Z-Jq for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:30:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 11:30:04 +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.173607658519134 (code B ref 75322); Sun, 05 Jan 2025 11:30:04 +0000 Original-Received: (at 75322) by debbugs.gnu.org; 5 Jan 2025 11:29:45 +0000 Original-Received: from localhost ([127.0.0.1]:60152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUOpE-0004yY-PZ for submit@debbugs.gnu.org; Sun, 05 Jan 2025 06:29:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56312) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUOpC-0004yI-JO for 75322@debbugs.gnu.org; Sun, 05 Jan 2025 06:29:43 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUOp7-0004mV-0V; Sun, 05 Jan 2025 06:29:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=86ZFKaFd58HtNLXMFamwBu3H3mnHFoqyRFzCcensGXg=; b=Rtma5o5+h7NZWtvkR0Yb um4ISqQWqvWV5EEC23N+E7PQg4AUkWjZnMM80EZ5y/en+YRRQdunvyug+84a5oMTs9XzGutfQAljE j+HAlEgylcUaXgVCxZ37RCQAsJ5Xu14kUpR3LCfj2I3mPe/hFiiTeoPub1d6pryLLnyRMOVD5G/xP rToGJzwYhzZkPbFlAFPjuePCaUxtObn3BI2G2H/xQGs9G0CNUcrS6LtuFkcVx+h9W79u/QIJlmcgX jVeRn2WUoAH0dk8JiekTxDW3rpH9sNu9t910X/t0wjopa5/KiR1/2AY7TKNHlrhgKF0MC0EnqBCfy Fl8qXO3fsHz6oA==; In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Sun, 05 Jan 2025 11:30:11 +0100) 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:298541 Archived-At: > From: Gerd Möllmann > Cc: pipcet@protonmail.com, 75322@debbugs.gnu.org > Date: Sun, 05 Jan 2025 11:30:11 +0100 > > Eli Zaretskii writes: > > >> Cc: 75322@debbugs.gnu.org > >> From: Gerd Möllmann > >> Date: Sun, 05 Jan 2025 07:59:32 +0100 > >> > >> Gerd Möllmann writes: > >> > >> > 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. > >> > > >> > I think I'll just make it allocate a root in my Emacs. That's the least > >> > work. > >> > >> Please find attached what I'm using now in my Emacs, in addition to your > >> xstrdup commit. > > > > These two are alternatives, right? IOW, we should use one or the > > other in each specific case, is that correct? > > If you mean the two patches I sent with "these two", then no. I prefer > using SAFE_ALLOCA_LISP because that introduces an exact root. I guess I'm confused, then. The first patch replaces calls to SAFE_NALLOCA by SAFE_ALLOCA_LISP, the second patch modifies SAFE_NALLOCA to call igc_xnmalloc_ambig. That's why I thought they were alternatives. If they are not alternatives, then why did you replace SAFE_NALLOCA in the first patch?