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#74966: 31.0.50; Crash report (using igc on macOS) Date: Fri, 20 Dec 2024 09:57:39 +0100 Message-ID: References: <87y10b99nj.fsf@protonmail.com> <87plln9376.fsf@protonmail.com> <874j2z8ook.fsf@protonmail.com> <86a5cqkc2g.fsf@gnu.org> <86o716ah09.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="31618"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: spd@toadstyle.org, pipcet@protonmail.com, acorallo@gnu.org, Stefan Monnier , 74966@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 09:59:23 2024 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 1tOYqx-000845-7p for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 09:59:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOYqd-0006we-SM; Fri, 20 Dec 2024 03:59: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 1tOYqc-0006wV-Cp for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 03:59: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 1tOYqc-0002om-3Q for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 03:59: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=OXJ8pWgQk7A4LQRtoWWaxF6DpFjGWgZqHvAWzuQlkTo=; b=rnV9gI1+IpcJ6QV03KCgINIdDw2jNKVKBSCU4vUUWODAQjY5PNdSkfgVKgndxLM2zw3ZvEEKoHIi3VoqQ9oPsJKTw8GUqizCmm4eIqtGLf8wcjo95e9aQe9OXnN5nQ1E39kNtUengYeE0vWxBLKTFV8L6OAxAG/NWqg0EZuUoetAzgVf2fkgcmtpqcAAojVbz1xVjTnuXYLVI6N0YEs3SFYc6hLgOz4RVuDggX4jDrpxJ/UpHBcn5IZi+jxxRbu34EFNjshelmsAMqd9MFcpwCQpwWuVr7MpjgASdZsW/7vdx6KiRofPQ/gewNC6TvFlaBtA2+CcmRGTu3qrlUNOfg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOYqb-0004a9-Jp for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 03:59: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: Fri, 20 Dec 2024 08:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74966 X-GNU-PR-Package: emacs Original-Received: via spool by 74966-submit@debbugs.gnu.org id=B74966.173468513417595 (code B ref 74966); Fri, 20 Dec 2024 08:59:01 +0000 Original-Received: (at 74966) by debbugs.gnu.org; 20 Dec 2024 08:58:54 +0000 Original-Received: from localhost ([127.0.0.1]:41633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOYqT-0004Zg-Hp for submit@debbugs.gnu.org; Fri, 20 Dec 2024 03:58:54 -0500 Original-Received: from mail-ej1-f51.google.com ([209.85.218.51]:58610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOYqN-0004ZJ-IX for 74966@debbugs.gnu.org; Fri, 20 Dec 2024 03:58:51 -0500 Original-Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-aa68b513abcso325500966b.0 for <74966@debbugs.gnu.org>; Fri, 20 Dec 2024 00:58:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734685061; x=1735289861; 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=OXJ8pWgQk7A4LQRtoWWaxF6DpFjGWgZqHvAWzuQlkTo=; b=LssdM3lMpHvMmRfdaOcnKov6BJf7Rua4KnJQ4R9qd9q0dnSP7JzZFlGjCJq09qU5vG 6jzbKf9AuFp49wlTnRL4mpHDa7MFuCakgZHlgR0leXjqSUePBXyshlLA82E3FH9TJQcX 8A4etht2Mny6vK1ionSiTULRb7eYEnU6Bx3bvzkEsI/u6yO82t6wavFofTScBQjsd3y3 i+ReP6w9kO6HhChNzAzifJtljIpWiYViDkWIAKW5vAboXzyKWoNRH7Zrn9VKh6EDrqu/ za/RntRDBdUw52q4hfo3ce37LaIVFAQBxWQ/xMzSp1pKWimwxX79UT113xVzmMpsuUz1 mf1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734685061; x=1735289861; 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; b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ICRl4AOkRxHKagPhuzEjg== X-Received: by 2002:a17:907:3f98:b0:aa6:ab70:4a7d with SMTP id a640c23a62f3a-aac33690749mr141248166b.58.1734685061170; Fri, 20 Dec 2024 00:57:41 -0800 (PST) Original-Received: from pro2 (p200300e0b70a560050feb175441df3ce.dip0.t-ipconnect.de. [2003:e0:b70a:5600:50fe:b175:441d:f3ce]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d806fedc68sm1579561a12.66.2024.12.20.00.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 00:57:40 -0800 (PST) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Fri, 20 Dec 2024 09:43:26 +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:297444 Archived-At: Gerd M=C3=B6llmann writes: > Eli Zaretskii writes: > >>> From: Gerd M=C3=B6llmann >>> Cc: Andrea Corallo , pipcet@protonmail.com, >>> spd@toadstyle.org, 74966@debbugs.gnu.org >>> Date: Fri, 20 Dec 2024 09:21:38 +0100 >>>=20 >>> Eli Zaretskii writes: >>>=20 >>> >> Cc: spd@toadstyle.org, 74966@debbugs.gnu.org >>> >> From: Gerd M=C3=B6llmann >>> >> Date: Fri, 20 Dec 2024 08:30:55 +0100 >>> >>=20 >>> >> Gerd M=C3=B6llmann writes: >>> >>=20 >>> >> > I think I'll read the code a bit now. >>> >>=20 >>> >> BTW, does C-h f x-file-dialog work on platforms !=3D macOS? >>> > >>> > In what version of Emacs? and with or without native compilation? >>>=20 >>> master with native compilation, if possible with --enable-checking. >>>=20 >>> > >>> > It works here as follows: >>> > >>> > . On MS-Windows: >>> > - emacs 31 without native compilation >>> > - emacs 30 with and without native compilation >>> > . On GNU/Linux: >>> > - emacs 31 with and without native compilation >>> > - emacs 30 with and without native compilation >>> > >>> >> It aborts here for the same reason. >>> >>=20 >>> >> And I'm asking myself now why the heck it lands in native_function_d= oc in >>> >> the first place. Isn't x-file-dialog a C function everywhere? >>> > >>> > It is a C function, yes. >>>=20 >>> My current theory is that one needs to C-h f a function with a doc >>> string lie this one: >>>=20 >>> (defun x-file-dialog (prompt dir &optional default-filename >>> mustmatch only-dir-p) >>> "SKIP: real doc in xfns.c." >>> (ns-read-file-name prompt dir mustmatch default-filename only-dir-p)) >>>=20 >>> And the function must be native-comp-function-p. >>>=20 >>> I can't see so far how/where such "redirections" are handled. >> >> AFAIR, the doc string is in etc/DOC, and is collected by >> lib-src/make-docfile. That program scans the C source according to >> what src/Makefile tells is (see the $(etc)/DOC rule there), so it >> doesn't care whether xfns.c is or isn't compiled into the binary. > > Yes, that matches what I remember from the old times. > >> But we had many changes lately in how etc/DOC is handled, and maybe my >> memory is no long accurate. So I added Stefan to this discussion, who >> made at least some of those DOC-related changes. > > Maybe the problem is in store_doc_string (doc.c:469 here), not sure. > That function does > > if (SUBRP (fun)) > XSUBR (fun)->doc =3D offset; > > without checking if it's a native compiled function. That does look > like a place where an invalid offset could land in the subr. > > I have no idea what's the right thing to do to fix this. Just not doing > anything for native compiled function certainly isn't right. That seems to be the cause, indeed. When I=20 1 file changed, 4 insertions(+), 1 deletion(-) src/doc.c | 5 ++++- modified src/doc.c @@ -479,7 +479,10 @@ store_function_docstring (Lisp_Object obj, EMACS_INT o= ffset) fun =3D XCDR (fun); /* Lisp_Subrs have a slot for it. */ if (SUBRP (fun)) - XSUBR (fun)->doc =3D offset; + { + if (!NATIVE_COMP_FUNCTIONP (fun)) + XSUBR (fun)->doc =3D offset; + } else if (CLOSUREP (fun)) { /* This bytecode object must have a slot for the docstring, since I don't get the assert anymore. C-h f x-file-dialog shows the "redirection doc string" though, so it's not a correct solution. I think I'll leave to the experts :-).