From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Chang Xiaoduan Newsgroups: gmane.emacs.bugs Subject: bug#67900: 30.0.50; Emacs Crahes When Executing Command `consult-buffer' Date: Mon, 08 Jan 2024 11:28:26 +0800 Message-ID: References: <838r5qib7l.fsf@gnu.org> <83plz1ggua.fsf@gnu.org> <8334vwgezh.fsf@gnu.org> <83msu2fzvc.fsf@gnu.org> <834jg9fk2j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38006"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67900@debbugs.gnu.org, Eli Zaretskii To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 08 04:29:14 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 1rMgK9-0009lg-Gc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Jan 2024 04:29:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMgJv-0003jj-3M; Sun, 07 Jan 2024 22:28:59 -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 1rMgJs-0003jL-FF for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 22:28:56 -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 1rMgJs-0005Jg-5k for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 22:28:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMgJx-0001bl-RX for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 22:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chang Xiaoduan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jan 2024 03:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67900 X-GNU-PR-Package: emacs Original-Received: via spool by 67900-submit@debbugs.gnu.org id=B67900.17046845226150 (code B ref 67900); Mon, 08 Jan 2024 03:29:01 +0000 Original-Received: (at 67900) by debbugs.gnu.org; 8 Jan 2024 03:28:42 +0000 Original-Received: from localhost ([127.0.0.1]:34798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMgJe-0001b8-HN for submit@debbugs.gnu.org; Sun, 07 Jan 2024 22:28:42 -0500 Original-Received: from r3-22.sinamail.sina.com.cn ([202.108.3.22]:40515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMgJd-0001au-0U for 67900@debbugs.gnu.org; Sun, 07 Jan 2024 22:28:41 -0500 X-SMAIL-HELO: PWRD-20210716KV Original-Received: from unknown (HELO PWRD-20210716KV)([111.207.225.84]) by sina.com (10.182.253.23) with ESMTP id 659B6BD4000035CC; Mon, 8 Jan 2024 11:28:26 +0800 (CST) X-Sender: drcxd@sina.com X-Auth-ID: drcxd@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=drcxd@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=drcxd@sina.com X-SMAIL-MID: 8282607864943 X-SMAIL-UIID: 27A248201AD447A59055186C9A52D6CC-20240108-112826-1 In-Reply-To: (Andrea Corallo's message of "Fri, 05 Jan 2024 16:46:46 -0500") 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:277531 Archived-At: Hello Andrea, After some further test, I have found that the crash is reproducible when the declare form is absent from the function definition inside the macro definition. #+begin_src emacs-lisp (defmacro consult--define-state (type) "Define state function for TYPE." (declare (speed 1)) `(defun ,(intern (format "consult--%s-state" type)) () ,(format "State function for %ss with preview. The result can be passed as :state argument to `consult--read'." type) (declare (speed 1)) ;; If absent, crash is reproducible (consult--state-with-return (,(intern (format "consult--%s-preview" type))) #',(intern (format "consult--%s-action" type))))) #+end_src Even if I use `emacs-lisp-macroexpand' to expand all instances of this macro, and add declare form to these functions, missing the declare form in the function definition inside the macro definition still triggers the crash. In fact, if the functions generated from the macro expansion contains the declare form seems has nothing to do with the crash. Do you have any idea why this is happening and how it may be fixed? Thanks