From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14120: invalid load-history in emacsen that CANNOT_DUMP Date: Mon, 17 Feb 2020 12:46:14 -0500 Message-ID: References: <87fvz9rhqq.fsf@olor.terpri.org> <861rqtjq10.fsf@gmail.com> <86zhdhi19t.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="91924"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 14120@debbugs.gnu.org To: =?UTF-8?Q?andr=C3=A9s_?= =?UTF-8?Q?ram=C3=ADrez?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 17 19:20:11 2020 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 1j3l05-000NlD-8J for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Feb 2020 19:20:09 +0100 Original-Received: from localhost ([::1]:50222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3l04-0004PF-8q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Feb 2020 13:20:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40255) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3kU3-0000Jc-Lv for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:47:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3kU2-00013Q-K7 for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3kU2-000136-Da for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3kU2-00007Q-B2 for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Feb 2020 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14120 X-GNU-PR-Package: emacs Original-Received: via spool by 14120-submit@debbugs.gnu.org id=B14120.1581961592422 (code B ref 14120); Mon, 17 Feb 2020 17:47:02 +0000 Original-Received: (at 14120) by debbugs.gnu.org; 17 Feb 2020 17:46:32 +0000 Original-Received: from localhost ([127.0.0.1]:39181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3kTY-00006k-C7 for submit@debbugs.gnu.org; Mon, 17 Feb 2020 12:46:32 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3kTW-00006Y-Ps for 14120@debbugs.gnu.org; Mon, 17 Feb 2020 12:46:31 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2D00D81053; Mon, 17 Feb 2020 12:46:25 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1204080EC2; Mon, 17 Feb 2020 12:46:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1581961576; bh=m74v29Qz6EovITX6OirkXhIwLbBKLKoPwHc67zgJ62Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ALjcozA8qiDGBa6uU58UAg8MebbbuRbiUifIdJ8OtfNTn3bSLe4XE5p/ZUKwP3Rf4 Wl+6CMlFm6+xIj9xGfg28La9/EVxkKc8vRRPMR68h+mLGM0uqx+8d/FqcUOVIaARgf aGwjybpXWpRL0NG7MdV3o32Mss9y4D3fxJX9XQR6HY80Or0DKLC2Dy3x8YVaNeGS8H x1MhDsIu27rXQsMu3+Mzd7ZmKzk7X+7Q5DeeApTyORxNTgZwBSb4DTGdEMeG3GhJdA ipSlT1hLtUys34SCEtCoQQWAwGe+aacwxlmplZ/8g2bjWHOS+iPDKqkvhicLew/Lr5 siloCJDmcGDDg== Original-Received: from pastel (unknown [157.52.14.222]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A4A5E1202A1; Mon, 17 Feb 2020 12:46:15 -0500 (EST) In-Reply-To: <86zhdhi19t.fsf@gmail.com> ("=?UTF-8?Q?andr=C3=A9s_?= =?UTF-8?Q?ram=C3=ADrez?="'s message of "Mon, 17 Feb 2020 17:14:54 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:176153 Archived-At: > 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