From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet 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 16:20:32 +0000 Message-ID: <87r062jpi1.fsf@protonmail.com> References: <86a5cqkc2g.fsf@gnu.org> <86o716ah09.fsf@gnu.org> Reply-To: Pip Cet 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="26311"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , spd@toadstyle.org, Eli Zaretskii , acorallo@gnu.org, 74966@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 17:27:22 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 1tOfqR-0006PQ-9C for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 17:27:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOfkV-00028s-TY; Fri, 20 Dec 2024 11:21:12 -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 1tOfkM-0001Z7-BK for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:21: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 1tOfkM-0000Eo-14 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:21: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:References:In-Reply-To:From:Date:To:Subject; bh=wFcSXWmUZa2n8DR7dbVJwkD/Xdt1NFJzIV7vSE7eoh8=; b=NHjQlmL5GvZ2/bhRM8kWZhn3Sn3elCvFffnrbKK8eEJDzrCsm1mBXco+uM9z/eBcOVfd3gu/vKspv7OPNqwasMDZ4hZ7Ksr3XbgaKF4/1SyVc7lQ2SCQ/pegBic6Aq28/BOdLYClPd0sLduLd9RJCOxkBiDtRfOmQagx4u2LzjTCbv98XIFz6djMeV6UPujvq88FDon+Db96TzRAhI/hzZ3AooqBY4ZKuVbyCQcGyyWLuVR7E+gA3i2iODqM9uTF1f3sNiyGvwHzII6fUi8ukukO3fHe1qL6V59c1wmN6gIMw9TnYM7XNLPnJ447F3ozpHnh304783KtxbPJlQfNcg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOfkL-000157-Q1 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2024 16:21: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.17347116464123 (code B ref 74966); Fri, 20 Dec 2024 16:21:01 +0000 Original-Received: (at 74966) by debbugs.gnu.org; 20 Dec 2024 16:20:46 +0000 Original-Received: from localhost ([127.0.0.1]:43764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfk5-00014R-In for submit@debbugs.gnu.org; Fri, 20 Dec 2024 11:20:45 -0500 Original-Received: from mail-10629.protonmail.ch ([79.135.106.29]:32285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfk3-00014C-LX for 74966@debbugs.gnu.org; Fri, 20 Dec 2024 11:20:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1734711637; x=1734970837; bh=wFcSXWmUZa2n8DR7dbVJwkD/Xdt1NFJzIV7vSE7eoh8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=eCOPgPCNNsl6slIDnMyTDKU8XRG28KlQQDjHnTcfDSYFZsgrkBHHy0Fh7XTu7zwBK emy3hXMudH/QoGHM7pAHr3747C1J2qqi/GV3ZufzbkCrmp/kXa/x9/gRTua0+z+K0E ms5/orf5j+M3WzK2MQ32goi7C2eu+SonLCTFAlH2jME0SfbeV27hRzsfWRobu6pHv4 zEiJ3IF4Z8BWdKmQiIatdlMhLOA9ifOshB568XTC6CANkvgwRI0iLndPKGMTUTMHVf ORJJ9JCKjcb17ePTQzsLzZOSJxEPOs/D+al0a3G9oCvWYfFRcWGt1Q5lm7e1+4amTC 8dqBG0c04vnog== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 149058da9cd5254568dcf00cd1930fc822230d8c 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:297459 Archived-At: "Stefan Monnier" writes: >>> 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; > > 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_IN= T offset) >> fun =3D XCDR (fun); >> /* Lisp_Subrs have a slot for it. */ >> if (SUBRP (fun)) >> - XSUBR (fun)->doc =3D offset; >> + { >> + if (!NATIVE_COMP_FUNCTIONP (fun)) >> +=09XSUBR (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. > > `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 Yes, but the nativecomp code assumes ->doc is an index into a nativecomp'd subr's constant vector. So we overwrite it with a docfile index, access an out-of-bounds index and crash. I think the best thing to do is to use separate fields for the "offset" doc and the "index" doc; or at least, the second best thing, after removing the entire docfile hack. I've got a patch to do that, but I'm still testing... Pip