From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: defun.foo--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56643: 29.0.50; Help-mode bookmarks not loading with native compilation Date: Tue, 19 Jul 2022 13:45:19 +0000 Message-ID: Reply-To: defun.foo@proton.me 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="16681"; mail-complaints-to="usenet@ciao.gmane.io" To: 56643@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 19 18:12:40 2022 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 1oDppu-00049e-9r for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 18:12:38 +0200 Original-Received: from localhost ([::1]:35956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDppt-00065a-79 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 12:12:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDppK-00065E-I8 for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 12:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDppK-0002zs-A2 for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 12:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDppK-00033H-5Q for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: defun.foo@proton.me Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jul 2022 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56643 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.165824711411713 (code B ref -1); Tue, 19 Jul 2022 16:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jul 2022 16:11:54 +0000 Original-Received: from localhost ([127.0.0.1]:55003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDpp9-00032n-GA for submit@debbugs.gnu.org; Tue, 19 Jul 2022 12:11:53 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDnXb-0006ra-5n for submit@debbugs.gnu.org; Tue, 19 Jul 2022 09:45:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDnXa-0004Sn-Nw for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 09:45:34 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]:17403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDnXX-0001LX-3h for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 09:45:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1658238327; x=1658497527; bh=B+yCDsmTmnc8iPCHk2w1+HenTWYNrB9dkFTTxZuJ+Ko=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=HwJaJMqrRR8+LLVcnKttiy4lvAUFTJIi03pbD1Lji29StJK0+06uPLbVW4dCl1mip +a5NxgVHpQmXSXDrvoLgfEhJk/2YBO98cHyuXEA6Do/1H2NRBfxxxLjG70Z+UCIjvx d68JMbeGDwLLrCyWEAqUbJPJcjuxoNZU5/ybFcnvAMVdaDjch9EFGTvfozjlFlVIns /96FMnZOQ0pnQiAWx5ZW7Prny64VAjSxyNpLxrTZLGghz7QySLt1eOLskuXriWCdFP echIUDOiHpHctV37amilJdYa2x5+LOeKdtaCNW/xlnQkX/xw4f684PEBTr+sSh/XGs g4EdqT7vcCGdg== Feedback-ID: 52178609:user:proton Received-SPF: pass client-ip=185.70.43.16; envelope-from=defun.foo@proton.me; helo=mail-4316.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 19 Jul 2022 12:11:50 -0400 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" X-ACL-Warn: , defun.foo@proton.me Xref: news.gmane.io gmane.emacs.bugs:237451 Archived-At: Overview: With native compilation enabled, adding a bookmark in a help buffer seems t= o work normally for the duration of the Emacs session, but when Emacs is re= started an "Invalid read syntax: '#'" error is thrown and the entire bookma= rk list fails to load. This appears to be caused by a compiled lambda being= serialized to the bookmark file in a way that is unreadable to the reader. Emacs version: 29.0.5, compiled from latest master branch on 7-18-2022, and started with e= macs -Q for both scenarios below. Steps to reproduce: 1. Ensure that native compilation is enabled by running M-x native-comp-ava= ilable-p 2. Run M-x describe-function {{any-function}} and move to the resulting *He= lp* buffer 3. Create a bookmark with C-x r m 4. Without quitting Emacs, kill the *Help* buffer, then run C-x r b to jump= back to the bookmark (this works as expected) 5. Quit Emacs (C-x C-c), and restart 6. Attempt to jump to the same bookmark again (running C-x r b), and observ= e that the bookmark list fails to load and throws an "Invalid read syntax: = '#'" error Here is an example of a help bookmark as it was serialized to the bookmarks= file (note the "help-fn" value): ("native-comp-bookmark" (position . 1) (last-modified 25301 49750 590832 312000) (help-fn . #) (help-args switch-to-buffer "*scratch*") (position . 1) (handler . help-bookmark-jump)) For comparison, I compiled Emacs without the native compilation flag (and v= erified that native-comp-available-p returned nil), and went through the sa= me steps above, creating a new bookmark. Jumping back to the bookmark after= restarting works as expected, and here is an example of that bookmark seri= alized without native comp: ("vanilla-bookmark" (position . 1) (last-modified 25301 49238 861856 736000) (help-fn . #[514 "\301=01!\205=07\0\211=18\302=02!)\207" [describe-function-orig-buffer buffer-live-p describe-funct= ion] 4 "\n\n(fn FUNCTION BUFFER)"]) (help-args switch-to-buffer "*scratch*") (position . 1) (handler . help-bookmark-jump)) I did find an older similar bug (#24573 https://lists.gnu.org/archive/html/= bug-gnu-emacs/2016-09/msg00971.html) which was causing the same error due t= o a buffer object being serialized. This was fixed by saving just the buffe= r name, but I'm not sure there's any comparable way to save a reference to = a compiled lambda. Any advice would be much appreciated though!