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: Sat, 04 Jan 2025 08:17:34 +0100 Message-ID: References: <87jzbbke6u.fsf@protonmail.com> <86sepzf4h3.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="1056"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , 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 Sat Jan 04 08:18:08 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 1tTyQC-000097-Ag for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 08:18:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTyQ9-0006aJ-Qh; Sat, 04 Jan 2025 02:18:05 -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 1tTyQ6-0006Xc-Oe for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 02:18:02 -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 1tTyQ6-0006qr-Ds for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 02:18:02 -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=wjVkn9ihEL3DYVUqlzAlUq/a9vqMBKwjlRYtgsg6WLM=; b=nFNFClOZFcQtObOyqbpR0joUOH/ovZvsHApJlzNK6HviVm9pGZMKFUk8lnd+aDG0sTSDmLcKWrrCVdm6j7WutXa4ih+ozyMdCJAGCj5jf9g9o0Yz6FHEM5Wv3GwuCa6J+TB5Zd5MLOzgacuShZGXtF5aBGwsZs32Lk8WcTDk8nSZiIKqTeESFjEZ773fRS0JOWDRs9KT5oISVNqHM2LAk/RDsDSeDN3Yc/3PozepumH4G24l50sCC5d1GOXbvRzF4/3oR6EIarUoUtbhYVw42RELtNeMoLucAjtSdAkxJYZoGInLi0DD13KcugyyqskQerjUPMuB5QB/1r/PtOuHyQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTyQ6-0007c8-8K for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 02:18: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: Sat, 04 Jan 2025 07:18: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.173597506729244 (code B ref 75322); Sat, 04 Jan 2025 07:18:02 +0000 Original-Received: (at 75322) by debbugs.gnu.org; 4 Jan 2025 07:17:47 +0000 Original-Received: from localhost ([127.0.0.1]:53162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTyPq-0007bb-Ta for submit@debbugs.gnu.org; Sat, 04 Jan 2025 02:17:47 -0500 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:42448) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTyPn-0007bC-Vc for 75322@debbugs.gnu.org; Sat, 04 Jan 2025 02:17:44 -0500 Original-Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso77632925e9.1 for <75322@debbugs.gnu.org>; Fri, 03 Jan 2025 23:17:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735975057; x=1736579857; 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=wjVkn9ihEL3DYVUqlzAlUq/a9vqMBKwjlRYtgsg6WLM=; b=dJj/C70EZ5z3iClCD+uzBt0XcsysM9U4TC44GWlQmyvekjeKtsRunhFIhO+zdj0H+X I33cFX+24SLyva/azdQdR8hbWoqleVApcCIal/nBRIozYrP3+nfhdiRaS/fd/xmaWWsm I80fnAgMOR0irVhAneVwjS3L0F7y8p/69u+FY9vasNvhHxINpj9KaW6DlHEOCBnWX7eS pAeSXhX9KaKNjP8RdqDyV/ddfIdk+rfFiPh+FIaCr+lcsSRrKwgYnCaBqzm8mDxdOpzl XTO4OnD+mbzUOkyliyBAZljfgeeyxtBH6H+KHhHho/t1zERBCSQJS/M3LNZuhG/Dg/au zrFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735975057; x=1736579857; 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=wjVkn9ihEL3DYVUqlzAlUq/a9v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received: by 2002:a7b:c450:0:b0:436:2155:be54 with SMTP id 5b1f17b1804b1-4365c763d81mr453631365e9.1.1735975056938; Fri, 03 Jan 2025 23:17:36 -0800 (PST) Original-Received: from pro2 (p200300e0b73c9f00c50ae305bf989514.dip0.t-ipconnect.de. [2003:e0:b73c:9f00:c50a:e305:bf98:9514]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8472casm43222939f8f.45.2025.01.03.23.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 23:17:35 -0800 (PST) In-Reply-To: <86sepzf4h3.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Jan 2025 09:00:40 +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:298327 Archived-At: Eli Zaretskii writes: >> Cc: 75322@debbugs.gnu.org >> From: Gerd M=C3=B6llmann >> Date: Fri, 03 Jan 2025 21:34:07 +0100 >>=20 >> Gerd M=C3=B6llmann writes: >> >> > >> > The pointers to string data case probably requires adding yet another >> > macro SAFE_ALLOCA_FIND_A_GOOD_NAME, which, for MPS, allocates a root, >> > possibly and exact one which would be good. >>=20 >> Or one does it as you did in b0a209e9204, that's of course also safe. >> For both old and new GC. (Don't remember if you mentioned it Pip, but >> old GC moves string data as well, during string compaction, should GC >> run). > > The current code in callproc.c assumes that GC cannot run while we are > parked in posix_spawn or vfork. Is that assumption false with MPS? > If so, what would trigger GC during that time? Okay, so it's safe with the old GC, I assume. Do you know if it is done with an inhibit_garbage_collection? Not that we run into the trap that somewhere on the way to the actual fork maybe_quit is called which can GC and so on, like we had it in the regexp engine a while back. For MPS, I don't know for sure. I have seen in passing while git grepping in their repo recently, that they write something about forking and child processes, but I don't know what they do. Maybe someone having read the code can answer that. (Added Helmut in CC). > > Another question is about the global Lisp variables in 'globals'. For > example, Vprocess_environment actually globals.f_Vprocess_environment. > Is this large struct protected from GC, i.e. can GC ever decide that > process-environment is not used and free it? If it's protected, where > and how is it protected? And if it is protected, then any members of > the list that is the value of process-environment are also protected > and cannot be freed by GC. > > If 'globals' is not protected, I think we should protect it, no? process-environment is a DEFVAR_LISP, and is root in both GCs via the staticpro mechanism (staticvec array).