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 05:40:09 +0100 Message-ID: References: <87jzbbke6u.fsf@protonmail.com> <87msg7iq0o.fsf@protonmail.com> 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="9444"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75322@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 04 05:41:28 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 1tTvya-0002Kh-Aq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 05:41:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTvyC-0003oR-My; Fri, 03 Jan 2025 23:41: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 1tTvyA-0003o3-Mx for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 23:41: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 1tTvyA-0007GV-Ax for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 23:41: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=FYqJ0EdsWK4iVPDEDzIe+UERa5m3YZoEX76qNa/KPdA=; b=SYtUwYRLKK37+guYbbJAW8TFpu3NHRdA9aMlBNoCSGSRt7aDixWQyeDRh3inhk+VNnK5XEStzYlYv8O1l96N/MIGXVm7N9vjNdwg71Jn6CkfPdWvo/nhS4k9mk839e39fx5simg7g0SY2Osbsh2Ge34ChDXts42UN2hFnODRGUSbjIb/rGjRrHYjezjGzXtYhGk9+VsMCs1txIR8zDfq9PjH+gPwRgEewym0oyLOrT9ixHyGtICN859VWn3HDW/xfQdkk/p2bkoiUdv4JYWzX0q8C7hmVZvpNzIeQ1E76ip0q3gCrEczj+4AffGzjvotwnG2NWT6R+tS59vsB/5uKw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTvy9-0000EQ-L9 for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 23:41:01 -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 04:41:01 +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.1735965618808 (code B ref 75322); Sat, 04 Jan 2025 04:41:01 +0000 Original-Received: (at 75322) by debbugs.gnu.org; 4 Jan 2025 04:40:18 +0000 Original-Received: from localhost ([127.0.0.1]:52953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTvxR-0000Cb-Jn for submit@debbugs.gnu.org; Fri, 03 Jan 2025 23:40:18 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:58775) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTvxO-00009g-Pv for 75322@debbugs.gnu.org; Fri, 03 Jan 2025 23:40:16 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso91977075e9.1 for <75322@debbugs.gnu.org>; Fri, 03 Jan 2025 20:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735965613; x=1736570413; 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=FYqJ0EdsWK4iVPDEDzIe+UERa5m3YZoEX76qNa/KPdA=; b=Ltyh0KFi9GQn1wmYt1nZPLWpgTtLXAYNrb1hdmUXOAkWsnYA1ry/AErbdFqG+Ch9OB Tz3E7prIAFWeF1Smym7GNtpQGbQTWkwlfEeo/dPYb2O5PESejPNqsjrYR5TjJBIm0PTl ksB6NqRee1Rf83o7/W25abwJV06pZYhlh4x0oq7cijaAnUqCNwjEzCildZLVnNnIOv/F Ry5iDCYqyxJWXglrsPKg2J0qonP+pk1V3kmKUHH+Om8Hfe+dQ7hIks9mH3JalJslpko0 9LtaEoeG73I2uCroDQq4dSGeQxa/rQIo7QjGZ91TNDT9pL1M13df4iHqKd3cDD9xVRgA D4xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735965613; x=1736570413; 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=FYqJ0EdsWK4iVPDEDzIe+UERa5m3YZoEX76qNa/KPdA=; b=mYvZeMsAmNbcG/X8jS4A+geDDJ6biKfGv6P7ckiUhG4EpzE3bDXhpJ9HseQwJD3aze 7X8KgGieiYmw9vLfPkx91isMWwlkFiPToNsmKjYNgwPR3LeX8vCDk0/wgR0pqyBvMNhb EYH1/Qh1s5wcNS5IoWXfpF862Tc0aBdMudVGaC3CEj+J24YVkwCk3lgPp6ZcfgDe7kT7 v2LvXtVCCbDIfSuxFEW0qFjznBBRMlDZivB/v1IN5OxMA/h4O9ZMrWvoVWEW0wHFp/f9 aWJOt3ZWL9kbH6pX1pAplWTMBR5U8eKqk6trp+Fnd1JXKbpUO59OMw9YZ5vWbwadIK6R cSlA== X-Gm-Message-State: AOJu0YyegDa2b/1xl2gaPacFOI+DkjgI63CYYkzpGB7ritZr/faZjhSp bF4dpegqrUEEXshrDYJsgqGpBHyRU4sBeZiy0FyYIzRaQxQIpbveEjI10g== X-Gm-Gg: ASbGncvd/C87ZMqrHF2l34BJFInkxueJtwcYFqaJ6r/Yzh/+R90ZqmVzbrNTCrNfGXg kl7puLoQjJJd9zSocGMSprC2KKqhjgRiQ8capZVszIdLAZrlJplT66vQ/3MalDuUkcBow2wLiu4 1ZttlCWkhMdB2xya2mzkwqZQivbrPG0Qh1e/oroX5d8FqXSJ8m/DgaT74AeO22dtUzSPtWalplD tS/biRKT3KuMQmRi3EqsZo+D8+rbOWqY5YC5upo4p2DOPEjVjrvXztgtYwWq9/A2m08pXi2EiCJ 9FtIEebpcowwGDnef1ZMQstzakq4nynDPIZOdxmuqstdvpX5ltHNGI3R3Bn8BgkCfg== X-Google-Smtp-Source: AGHT+IHpvxI0bfvVBN8U8kkpJkYdLrReQwx3y184SWgpTdCy3C4ttZFZnduo6KyETVqyepxDoZVkVA== X-Received: by 2002:a05:600c:1d03:b0:434:a5bc:70fc with SMTP id 5b1f17b1804b1-43668642e70mr409409235e9.8.1735965613102; Fri, 03 Jan 2025 20:40:13 -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 5b1f17b1804b1-4365c08afcbsm511365765e9.21.2025.01.03.20.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 20:40:11 -0800 (PST) In-Reply-To: <87msg7iq0o.fsf@protonmail.com> (Pip Cet's message of "Fri, 03 Jan 2025 20:48:08 +0000") 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:298322 Archived-At: Pip Cet writes: > Gerd M=C3=B6llmann writes: > >> 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. > > Note that might still EFAULT if there's a memory barrier. I think. > > Do we really need to move all arguments to syscalls and libc functions > which might use a syscall into non-MPS memory? That would be bad. > > And which libc functions might use a syscall? I think we can agree > fprintf might, and memcpy() doesn't (note to self: destroy all evidence > I ever considered making memcpy() use MMU tricks for very large > buffers), but what about all the others? > > Maybe I'm panicking too much and fixing read/write/exec* is good > enough? Don't Panic! Quote from The Hitchhiker's Guide to Emacs (non-NS edition) :-). TBH, I couldn't follow your thoughts above with the EFAULT, syscalls and so on. >> 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). > > Ouch. Yes, I remember now. > > Pip And today I see you reverted that commit. Is there something wrong with it? I couldn't see something wrong, and for me VALUE(no root) > VALUE(exact) VALUE(ambig). WRT Lisp_Object allocas, please tell if I should do that. (I think this all could also be done on master, but since this is there forever, I don't think it's absolutely necessary. Agree?)