From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74966: 31.0.50; Crash report (using igc on macOS) Date: Fri, 20 Dec 2024 11:17:24 -0500 Message-ID: References: <87y10b99nj.fsf@protonmail.com> <87plln9376.fsf@protonmail.com> <874j2z8ook.fsf@protonmail.com> <86a5cqkc2g.fsf@gnu.org> <86o716ah09.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29705"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: spd@toadstyle.org, Eli Zaretskii , acorallo@gnu.org, pipcet@protonmail.com, 74966@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 17:19:27 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 1tOfin-0007Ut-WC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 17:19:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOfiV-00027N-QJ; Fri, 20 Dec 2024 11:19:08 -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 1tOfhS-00084M-CV for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:18:04 -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 1tOfhR-00086f-Rv for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11: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=Wke8pNGeAgcUML+2T8ivlXrLGbKGuC6ZYxWuaxELZ9U=; b=MMPVzR5nndMoJibHW+aSnnvkXqHzN9X6Z0zN99NO2qS7pbi46YH7mVF2l6WvGzRPGohQvUFOZCHQOH3vkbZHRbNlMMTrroUrhxfV4dGfHvJSCFnXpmEgz0yb9U+96kxiQoX6QFXLLo39kUuiThR+NVWFFCWpl7Fihh7f8AVme6A90DrAAW3kUqYH1m/K+wPkU+LIcA+BTKjzjDYwZ4ozIsKO4vrJGPVaT1oDkU695jHec+7U5y0nU/UJbYiaYMUr6oTabNnYYypsPVTDIZYpUu0zJO/Au1HmOWddIZr4/wlctolu1b7/MTmPWyBRMU7YB42ZUutPWsZ/vM6kukKmfg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOfhR-0000tG-Li for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2024 16:18: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.17347114543378 (code B ref 74966); Fri, 20 Dec 2024 16:18:01 +0000 Original-Received: (at 74966) by debbugs.gnu.org; 20 Dec 2024 16:17:34 +0000 Original-Received: from localhost ([127.0.0.1]:43755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfgz-0000sQ-TZ for submit@debbugs.gnu.org; Fri, 20 Dec 2024 11:17:34 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfgx-0000s9-Vu for 74966@debbugs.gnu.org; Fri, 20 Dec 2024 11:17:32 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9BB9E100126; Fri, 20 Dec 2024 11:17:26 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734711445; bh=G96LabRSGPGen4KhhM4CHPF03Sc29YE7QT/gOpfflsY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=muMc+jiBe9HJ35PMTqo9dDYKrte0HXJLfTvCkfl0Txs506pRKAOB13c/xEDhLywbl x0MwAdrNRFkANi0k/9WrEN2E+OP5RTUF0XTgh+0eRlYqAMTR7rEbqrJMiOmGrHm9Qc 6q+6Gyivc8yeduSsaFEuCLUWx5BFEvpND075DRUMt5JFpvjIkwYRiQtUQjwhWlRmFx r0wwolIR+BWe677JwiDm2OIPAcs0URh8ZU+YTbzMQq7ZOPNXCXRMcEGJsJAU2WcUOR yY1xac4itOPWa250NjZJlB1f5rKo9VBeBKJX+zQovNap5uBxDSyxV0jCdHZ3Eq5/gf yIO279L0ZDbEQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CE5C71000BD; Fri, 20 Dec 2024 11:17:25 -0500 (EST) Original-Received: from asado (unknown [199.119.74.1]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7B9561202EF; Fri, 20 Dec 2024 11:17:25 -0500 (EST) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Fri, 20 Dec 2024 09:57:39 +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:297457 Archived-At: >> Maybe the problem is in store_doc_string (doc.c:469 here), not sure. >> That function does >> >> if (SUBRP (fun)) >> XSUBR (fun)->doc = offset; Sounds right. > That seems to be the cause, indeed. When I > > 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 offset) > fun = XCDR (fun); > /* Lisp_Subrs have a slot for it. */ > if (SUBRP (fun)) > - XSUBR (fun)->doc = offset; > + { > + if (!NATIVE_COMP_FUNCTIONP (fun)) > + XSUBR (fun)->doc = offset; > + } > else if (CLOSUREP (fun)) > { > /* This bytecode object must have a slot for the docstring, since > > I don't get the assert anymore. `offset` here should be fixnum that gives the position of this docstring in the DOC file. And FUN should be a function for which we found a DEFUN in one of the C files. So in general it should be a `primitive-function`. We have a few undesirable cases where a function is defined in C code for some platforms and in ELisp for others, which is why there's the `CLOSUREP (fun)` branch If those rare CLOSUREs get native-compiled, then we'll use the SUBRP branch, of course, but I have no idea why that would lead to a crash. We're talking about a fixnum so that's usually quite safe w.r.t GC and crashes. Stefan