From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: staticpro everything Date: Fri, 03 May 2024 13:47:10 +0200 Message-ID: References: <87v83ynhuc.fsf@gmail.com> <86v83xof5w.fsf@gnu.org> <878r0thbfl.fsf@gmail.com> <86jzkdo9rm.fsf@gnu.org> <87jzkdfres.fsf@gmail.com> <86plu4mylj.fsf@gnu.org> <86msp8lbci.fsf@gnu.org> <86ikzwl8ih.fsf@gnu.org> <87r0ektkfo.fsf@yahoo.com> <86frv0l0ir.fsf@gnu.org> <86bk5okxfl.fsf@gnu.org> <867cgbjs1q.fsf@gnu.org> <87v83vnnxz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21856"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , luangruo@yahoo.com, emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 03 13:48:17 2024 Return-path: Envelope-to: ged-emacs-devel@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 1s2rOj-0005Ye-EC for ged-emacs-devel@m.gmane-mx.org; Fri, 03 May 2024 13:48:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2rO9-00045R-D5; Fri, 03 May 2024 07:47:41 -0400 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 1s2rNl-0003yg-2d for emacs-devel@gnu.org; Fri, 03 May 2024 07:47:17 -0400 Original-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 ) id 1s2rNi-000143-A9; Fri, 03 May 2024 07:47:16 -0400 Original-Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a595c61553cso439025466b.1; Fri, 03 May 2024 04:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714736832; x=1715341632; darn=gnu.org; h=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=gxj3BKhmfVelzHCq62PPlNEKt00lmPeovvZTUpZPAws=; b=IGPYCKm+/LC8hj0l+h0DSGuVAq5f5Qnezid9Z+mhyvY0kw6k/a6Az72RV9s/zCXq2h O1afOXU/pDmx6wxDHUxVv74JkHp6Atb4+Vwaa0nHffEwtsPbwxLOmBqw7onbNYubkX9F sirf5HDNqMykmhkm7lilFad07Sd61jy+YqaeajVB8fmWXsnlKXyCWO91oIqDskah1IIJ AvZJ1K3D5RoPG/FdFpeO6OWdXFC2aU8ydVn60hzUHXhMHQjA9OdAn446L0IHlqk1kKiY CKIbtMWGT1TFsnWRTjnHbQ99gCw3e20ViiVuv3hFQNikGqLxiMfUTAd5z2wHjEDnXxpD xZ0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714736832; x=1715341632; h=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=gxj3BKhmfVelzHCq62PPlNEKt00lmPeovvZTUpZPAws=; b=dcdYLmBaZTz/OG9+WRUobVty+o13oFQIYcXKvVvmgtU+3XQucvhUy8CjMH8ENRmhIh g3pCogAEfpNImH3ffpjmMBvjCw2NZnUUlOQIEPrUj7eBEHafrFi0H6G4Rck+VRSExebW Go+jiMd4sPtfshcdKCTojH5ixYzm4I2JEJFOyJajadCW5xMCc8lPeLYTlY6pQWo+D/FD kJF4WJGUpxD/OFc5ZI0oxtZcXfONsFzzXMRcEd/SmEm7YNL3QqgeaJmskS6UTxnTjFw0 AYw9Rwvs/fO8uHpmWEZHR1uyAN6e9sHxhR0wGIzgpSGYIYwJk7ntufmWFNPO6+zkSRV/ +1Ig== X-Forwarded-Encrypted: i=1; AJvYcCXAfJsJ6gjjHFvv9UZAN04tps2unJJkCr0Lxv3IFhS58WTKUDHrOBZMp/tRz+iBF8oSt2AoHIbTNffp5MLBl5yUUlvN X-Gm-Message-State: AOJu0YzSvg48VArClqo/24vDZX9ZCtT9W2a7HLzD1Iv2Gori6j+9eU57 HJOPW/5zlwC28IpbHineI0nNnEqzVdcY2oXzOP6aBWg2Xaqxu+X0bebftQ== X-Google-Smtp-Source: AGHT+IHEUZm9JgCVv/BZUmjNUmTE09Ev9MWLOHAKWE0+WFA7sqc8QlTcyvoVLKyQtWSQ5iMcixThtw== X-Received: by 2002:a17:906:6a28:b0:a59:9222:fd7d with SMTP id qw40-20020a1709066a2800b00a599222fd7dmr1356315ejc.5.1714736831828; Fri, 03 May 2024 04:47:11 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36a94.dip0.t-ipconnect.de. [217.227.106.148]) by smtp.gmail.com with ESMTPSA id u3-20020a17090617c300b00a51da296f66sm1617760eje.41.2024.05.03.04.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 04:47:11 -0700 (PDT) In-Reply-To: <87v83vnnxz.fsf@gmail.com> (Helmut Eller's message of "Fri, 03 May 2024 13:18:32 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=gerd.moellmann@gmail.com; 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318663 Archived-At: Helmut Eller writes: >> That leaves the u.s.data, which is an object that is not on the stack >> but only referenced from a string that is on the stack. >> >> That always works because to do anything with u.s.data, the CPU must >> load that pointer into a register or somewhere on the stack. By that >> fact the same applies to the string data that applies to the string >> above. > > Is it so easy? Somebody could load &u.s.data into a register but then > quickly stow it away in a malloced struct or a "temporary global > variable". Let's say S is the string in question. &S->u.s.data is an interior pointer into the string, right? So, in essence, we're storing a reference reference to the string in malloc'd memory. We know that that is not safe.