GNU bug report logs - #14120
invalid load-history in emacsen that CANNOT_DUMP

Previous Next

Package: emacs;

Reported by: BT Templeton <bt <at> hcoop.net>

Date: Mon, 1 Apr 2013 22:55:01 UTC

Severity: normal

Found in version 27.0.50

Fixed in version 27.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: andrés ramírez <rrandresf <at> gmail.com>
Cc: 14120 <at> debbugs.gnu.org
Subject: bug#14120: invalid load-history in emacsen that CANNOT_DUMP
Date: Mon, 17 Feb 2020 12:46:14 -0500
> 2.  Put a breakpoint on lread.c:build_load_history and watch how
> many times it is called and with wich params. It seems a very long list
> of params

It's called too often, that's not workable.
I was thinking of putting an assertion in there instead, maybe something
like the patch below.

> The function above could be modified for removing the stringp
> validation. And every time load-history-filename-element is called
> when an error happens that function show me the file on the history to
> which the spurious symbol belongs to?

The problem is that the file name is the string that's not there :-(

But maybe showing us the complete `load-history` when the error (in
load-history-filename-element) is caught might give us enough of a hint
(by looking at the entries nearby to try and infer the order of
operations at the time the broken entry was added)?


        Stefan


diff --git a/src/lread.c b/src/lread.c
index c124d5a1d8..7f5f1394c7 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1876,8 +1876,14 @@ build_load_history (Lisp_Object filename, bool entire)
      front of load-history, the most-recently-loaded position.  Also
      do this if we didn't find an existing member for the file.  */
   if (entire || !foundit)
-    Vload_history = Fcons (Fnreverse (Vcurrent_load_list),
-			   Vload_history);
+    {
+      Lisp_Object tem = Fnreverse (Vcurrent_load_list);
+      eassert (EQ (filename, Fcar (tem)));
+      Vload_history = Fcons (tem, Vload_history);
+      /* FIXME: There should be an unbind_to right after calling us which
+         should re-establish the previous value of Vcurrent_load_list.  */
+      Vcurrent_load_list = Qt;
+    }
 }
 
 static void





This bug report was last modified 5 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.