From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#66743: 30.0.50; Crash when dumping reftex Date: Thu, 26 Oct 2023 09:38:40 +0000 Message-ID: <87a5s5d8pr.fsf@localhost> References: <875y2v592c.fsf@localhost> <83a5s6kgxx.fsf@gnu.org> <87wmvadfkw.fsf@localhost> <83jzraisg0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9967"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 66743@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 Thu Oct 26 11:37:54 2023 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 1qvwoM-0002Kh-9E for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Oct 2023 11:37:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvwo3-0000XY-7j; Thu, 26 Oct 2023 05:37:35 -0400 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 1qvwo0-0000Ww-Kv for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 05:37:32 -0400 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 1qvwo0-0004vL-CW for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 05:37:32 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvwoU-0004mx-Ce for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 05:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Oct 2023 09:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66743 X-GNU-PR-Package: emacs Original-Received: via spool by 66743-submit@debbugs.gnu.org id=B66743.169831306518384 (code B ref 66743); Thu, 26 Oct 2023 09:38:02 +0000 Original-Received: (at 66743) by debbugs.gnu.org; 26 Oct 2023 09:37:45 +0000 Original-Received: from localhost ([127.0.0.1]:60614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvwoC-0004mS-Jt for submit@debbugs.gnu.org; Thu, 26 Oct 2023 05:37:45 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:45675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvwo7-0004mA-Gv for 66743@debbugs.gnu.org; Thu, 26 Oct 2023 05:37:43 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id ACB1C240103 for <66743@debbugs.gnu.org>; Thu, 26 Oct 2023 11:37:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698313022; bh=LzbQGqUsfWjmLFdCDkcbxf3eI2YiHbyTjPG6Deu7YQI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=WEOY6JRBPd74yY/uVDiUoLoYvoaad4LHhXxiEus6gL69zceo9NBu/HzRSwNH8UK5a 6X+20TxE3CDAAko6uYI+qbZIL1RA2pfwWhSQGYwMXDawhNiVRLZOUR1WP+SSEfXdHK 6hMqTjcifRyEaJZvUaYrtoPXrbsIs7fA8PqHZ5zCcmUv3NZiPcY/kZLbblnNT3ppcT uIjfO7k0BPu4L412xbAKscW/o2CjQYOa5rMIonf/WPPVBv8D3KaAKFKz46ubz0vViy CPXhsO1uLPYqPpGubEYzZKVZdTCcDu8QrizkIHSLfe+ZNswtksMxjQSrivkL31t7d2 rfS6kv3MUIaDQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SGLKn4BF9z9rxG; Thu, 26 Oct 2023 11:37:01 +0200 (CEST) In-Reply-To: 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:273259 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: >>> Emacs is always dumped with a few buffers, because temacs needs them >>> to do the dumping. See this comment text from buffer.c: >>> >>> Implementation notes: the buffers we carry from temacs are: >>> " prin1", "*scratch*", " *Minibuf-0*", "*Messages*", and >>> " *code-conversion-work*". They are created by >>> init_buffer_once and init_window_once (which are not called >>> in the dumped Emacs), and by the first call to coding.c >>> routines. >> >> Thanks. >> >> So, one idea would be to try and move the creation of these buffers from >> the init_*_once functions to the "normal" init functions, and see what >> happens. One would also have to take a closer look at coding.c, of cours= e. > > Actually, this is bug#59029, sort of. > > TLDR is that the code to dump itrees is there, somewhere in git, but has > an infinite recursion bug. So, I guess it should first be tried to > revive that code and fix it (tests should also exist, IIUC). While I agree that dumping buffer overlays would be nice to have, I think I found a simple workaround for the specific issue I reported. We may simply make sure that the overlays do not belong to any buffer - it is good enough for the purposes of reftex library, where the overlay objects are created once and then modified by side effect for actual use. See the attached patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-textmodes-reftex.el-Work-around-pdumper-crash-b.patch >From 3bc99957796a8e8f92c8cb57d7102ee0461b3d86 Mon Sep 17 00:00:00 2001 Message-ID: <3bc99957796a8e8f92c8cb57d7102ee0461b3d86.1698313010.git.yantar92@posteo.net> From: Ihor Radchenko Date: Thu, 26 Oct 2023 12:34:58 +0300 Subject: [PATCH] * lisp/textmodes/reftex.el: Work around pdumper crash (bug#66743) (reftex-highlight-overlays): Make sure that the overlays objects are not assigned to any buffer. This is to work around pdumping not supporting dumping buffer overlays (yet). --- lisp/textmodes/reftex.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 0a1fa8580d0..5f564b7f9eb 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -2075,13 +2075,15 @@ 'reftex-delete-overlay (defvar reftex-highlight-overlays [nil nil nil]) ;; Initialize the overlays -(aset reftex-highlight-overlays 0 (make-overlay 1 1)) +;; Ensure that the overlays are not assigned to any buffer to avoid +;; crashing pdumper, if it is used to dump this library. See bug#66743. +(aset reftex-highlight-overlays 0 (with-temp-buffer (make-overlay 1 1))) (overlay-put (aref reftex-highlight-overlays 0) 'face 'highlight) -(aset reftex-highlight-overlays 1 (make-overlay 1 1)) +(aset reftex-highlight-overlays 1 (with-temp-buffer (make-overlay 1 1))) (overlay-put (aref reftex-highlight-overlays 1) 'face reftex-cursor-selected-face) -(aset reftex-highlight-overlays 2 (make-overlay 1 1)) +(aset reftex-highlight-overlays 2 (with-temp-buffer (make-overlay 1 1))) (overlay-put (aref reftex-highlight-overlays 2) 'face reftex-cursor-selected-face) -- 2.42.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--