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: Some experience with the igc branch Date: Wed, 25 Dec 2024 14:08:34 +0100 Message-ID: References: <87o713wwsi.fsf@telefonica.net> <87ldw7fwet.fsf@protonmail.com> <87a5cnfj8t.fsf@protonmail.com> <86seqe4j4f.fsf@gnu.org> <87ttaucub8.fsf@protonmail.com> <87pllicrpi.fsf@protonmail.com> <864j2u442i.fsf@gnu.org> <87ldw6as5f.fsf@protonmail.com> <86o7112rnq.fsf@gnu.org> <867c7p2nz4.fsf@gnu.org> <861pxx2lh7.fsf@gnu.org> <86ldw40xbo.fsf@gnu.org> <86a5cj2a0e.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="10896"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pipcet@protonmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 25 14:09:38 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 1tQR8r-0002fX-WE for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Dec 2024 14:09:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQR80-0004WQ-B2; Wed, 25 Dec 2024 08:08:44 -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 1tQR7x-0004W6-5g for emacs-devel@gnu.org; Wed, 25 Dec 2024 08:08:41 -0500 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQR7v-00016g-Hm; Wed, 25 Dec 2024 08:08:40 -0500 Original-Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a9f1c590ecdso1073649066b.1; Wed, 25 Dec 2024 05:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735132117; x=1735736917; darn=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=p0kFe+P0EOw2702UilE7k5kf/oUR5TLCt7VWK1PkkjA=; b=WNjyExD1sfAFrRhGroVuPQcVnX5859UQxddCPCH7TSza+Cab0g5eVNxszzvIBzCz8+ e2kKLWobzLRql2cQW3h0n+9YsNQU1GeRvuuHBOpZbUub1ZPPZZXe/NV6o65SQ/gTKtOb 1aiR1KBUvO07Coxub/M7ZJRPygqFSlX7k+wsnbaXLT42BnHoSYY65QndNAI6Rn/CD8iR eKEJPQRXQZpItOOrYaUDybmf49SO4IvJQCGkkReZcXoYZSgZ2Ih5EYECK2QwDXQ4mkyi m0gI6Bx2+oI/XHr0ZRJalx8qNVcPGdUBYDyzBTryk//DSJNciN81NEo+V5vsTat7q/4z nWgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735132117; x=1735736917; 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=p0kFe+P0EOw2702UilE7k5kf/oUR5TLCt7VWK1PkkjA=; b=I/ulUUfG1PYY3z52fKdktOyTIxUcyC4YeFMeYAl+o3QekEaZcPmZnZgrD/KuYLj/Mn HcGbn0AMRjkzjIIj5iF7HhviDezxWpVtCKnBlGnXxKMjr1DxSXXN83O4TdHEcek35TG0 A8oW+3IE8eiCejgUyvnYq//njo/5umqN00A76/sAKZIu9jyLERfwnX+anIdYIzusAodA rC8UVnTdOfL1wBZEDdStCHcNzeD057f4CZHaZoz6GLWM7TRqaehEBe2fNqK2uUDAkPOu wwv2LVYu23R4rk1DmA4+yCFtYLal53yNfrkaqWaGK3+HGI7YQDY7JE+2ghGbY2H7em94 23Vg== X-Forwarded-Encrypted: i=1; AJvYcCWMk8RSHvQ1W6K7RFOAs093vwU8pZgzaMBmoEwhxfLalqeD7j2pEQB/3jyJlWWlBTs0oCOQBJkMHw==@gnu.org, AJvYcCWhAMJjB3y98fg2lVRxKlGoBx40jBSCUye2wYxn0mwirsWXC8zvYgNjbstjDhWJb/CaD6grY20Zldl5PHI=@gnu.org X-Gm-Message-State: AOJu0YwSLknny0AnCiPha0c9qgMK6Pb8vrkv2AwT1FWt58arbdYjEUUl PaWwWZwaPZZqBDlVITN1HVRO/+A0rUFDrrQQdTFUS9n6Mcfl8JACP4bx7bNP X-Gm-Gg: ASbGnctrfgP5BdYdUNVqz/SZQL8xT+E1basOSClX/rkNgbAEUEo4xgqHwWjXInFOZSw aLMf6dPX0eNUz7Hhb8RrRQB/S7JqheipYjgH6uYe3CJDrss0k2eNARDdo+IUiPp0aJjmhE6j39y hJ48oK0aebiK185rOEnQYs/lSN6n/4Ro9W8qcHrUoPPAcl0ng6saafZgIPkL2RtjtJR5YL+jQaG ixZAMTRnKvUXV+htLXeLD7kviVB0q546e274YyvwdJKjULmx/I7Hm9qdAKAmwr32OPls9ZRdj5X gaNLX/PWoEKBSn65kTTsYjJTIpVjo07y9u+buiIc4yiRwnejwLRdPRkJ+5/aZGRuAw== X-Google-Smtp-Source: AGHT+IEuxs/xB+FyMBnzvGHssmcoXjwvUv9Aw/9I1NyeH8Q3DMIT4355QuZcLAzKqeMDgFX10W4cvA== X-Received: by 2002:a17:907:724b:b0:aa6:7737:1991 with SMTP id a640c23a62f3a-aac2702ae51mr2150184266b.2.1735132116575; Wed, 25 Dec 2024 05:08:36 -0800 (PST) Original-Received: from pro2 (p200300e0b73d6f00401d1c7c2fc22e2d.dip0.t-ipconnect.de. [2003:e0:b73d:6f00:401d:1c7c:2fc2:2e2d]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aaef76c461asm204134566b.125.2024.12.25.05.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Dec 2024 05:08:35 -0800 (PST) In-Reply-To: <86a5cj2a0e.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 25 Dec 2024 15:00:01 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x632.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:327087 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: pipcet@protonmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, >> eller.helmut@gmail.com, acorallo@gnu.org >> Date: Wed, 25 Dec 2024 13:50:37 +0100 >>=20 >> Eli Zaretskii writes: >>=20 >> >> More code accessing memory that is potentially behind a barrier follo= ws >> >> in record_backtrace. >> > >> > Which code is that? (It's a serious question: I tried to identify >> > that code, but couldn't. I'm probably missing something.) >>=20 >> The example I saw, with ^^^^ marking the call sites: >>=20 >> static void >> record_backtrace (struct profiler_log *plog, EMACS_INT count) >> { >> log_t *log =3D plog->log; >> get_backtrace (log->trace, log->depth); >> EMACS_UINT hash =3D trace_hash (log->trace, log->depth); >> int hidx =3D log_hash_index (log, hash); >> int idx =3D log->index[hidx]; >> while (idx >=3D 0) >> { >> if (log->hash[idx] =3D=3D hash >> && trace_equal (log->trace, get_key_vector (log, idx), log->depth)) >> ^^^^^^^^^^^ >>=20 >> static bool >> trace_equal (Lisp_Object *bt1, Lisp_Object *bt2, int depth) >> { >> for (int i =3D 0; i < depth; i++) >> if (!BASE_EQ (bt1[i], bt2[i]) && NILP (Ffunction_equal (bt1[i], bt2[= i]))) >> ^^^^^^^^^^^^^^^ >>=20 >> DEFUN ("function-equal", Ffunction_equal, Sfunction_equal, 2, 2, 0, >> doc: /* Return non-nil if F1 and F2 come from the same source. >> Used to determine if different closures are just different instances of >> the same lambda expression, or are really unrelated function. */) >> (Lisp_Object f1, Lisp_Object f2) >> { >> bool res; >> if (EQ (f1, f2)) >> res =3D true; >> else if (CLOSUREP (f1) && CLOSUREP (f2)) >> ^^^^^^^^ ^^^^^^^^ >> res =3D EQ (AREF (f1, CLOSURE_CODE), AREF (f2, CLOSURE_CODE)); >> ^^^^ ^^^^ >>=20 >> Didn't look further than that, though. > > But CLOSUREP is just > > INLINE bool > CLOSUREP (Lisp_Object a) > { > return PSEUDOVECTORP (a, PVEC_CLOSURE); > } PSEUDOVECTORP reads the vectorlike_header header from A's memory. > And AREF is even simpler: > > INLINE Lisp_Object > AREF (Lisp_Object array, ptrdiff_t idx) > { > eassert (0 <=3D idx && idx < gc_asize (array)); > return XVECTOR (array)->contents[idx]; > } And AREF accesses ARRAY's memory via ->contents. > So why are those unsafe? Because they access Lisp objects, or for > some other reason? What do you mean with unsafe? We are accessing an object's memory. That memory may potentially be protected by a barrier. I thought we agreed on that.