From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#3892: corrupting load-in-progress value with "let" Date: Tue, 21 Jul 2009 12:27:05 -0400 Message-ID: References: <47712C91-B427-4C1C-8731-F8BE9463A4A3@raeburn.org> Reply-To: Stefan Monnier , 3892@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248194323 4807 80.91.229.12 (21 Jul 2009 16:38:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2009 16:38:43 +0000 (UTC) Cc: 3892@emacsbugs.donarmstrong.com To: Ken Raeburn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 21 18:38:36 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MTIMM-0007d5-Ej for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Jul 2009 18:38:34 +0200 Original-Received: from localhost ([127.0.0.1]:37633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTIML-00054z-Vi for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Jul 2009 12:38:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTILU-0004DC-D4 for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 12:37:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTILO-00048J-SL for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 12:37:39 -0400 Original-Received: from [199.232.76.173] (port=37354 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTILO-000485-Lg for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 12:37:34 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34908) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTILM-00044j-LD for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 12:37:33 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6LGbTX7028420; Tue, 21 Jul 2009 09:37:30 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6LGU7JJ026902; Tue, 21 Jul 2009 09:30:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 21 Jul 2009 16:30:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3892 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3892-submit@emacsbugs.donarmstrong.com id=B3892.124819363126685 (code B ref 3892); Tue, 21 Jul 2009 16:30:07 +0000 Original-Received: (at 3892) by emacsbugs.donarmstrong.com; 21 Jul 2009 16:27:11 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from tomts22-srv.bellnexxia.net (bc.sympatico.ca [209.226.175.184]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6LGR60J026678 for <3892@emacsbugs.donarmstrong.com>; Tue, 21 Jul 2009 09:27:07 -0700 Original-Received: from toip7.srvr.bell.ca ([209.226.175.124]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20090721162706.SKTR19329.tomts22-srv.bellnexxia.net@toip7.srvr.bell.ca> for <3892@emacsbugs.donarmstrong.com>; Tue, 21 Jul 2009 12:27:06 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsgEAG+JZUpBXrWz/2dsb2JhbACBUdFnhAwFgUA Original-Received: from bas1-montreal02-1096725939.dsl.bell.ca (HELO ceviche.home) ([65.94.181.179]) by toip7.srvr.bell.ca with ESMTP; 21 Jul 2009 12:29:38 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id DA137B41BF; Tue, 21 Jul 2009 12:27:05 -0400 (EDT) In-Reply-To: <47712C91-B427-4C1C-8731-F8BE9463A4A3@raeburn.org> (Ken Raeburn's message of "Tue, 21 Jul 2009 00:01:12 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 21 Jul 2009 12:37:39 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29539 Archived-At: > The variable load-in-progress is defined in the C code with DEFVAR_BOOL > applied to an int variable. Since file loading can be invoked recursively, > the int value is incremented and decremented when loading begins and ends, > and should in theory be zero only when no file is being loaded. > However, if we're loading a .el file from source, the C code in > lread.c:Fload calls out to the load-source-file-function, which winds up > calling code in mule.el, which uses "let" on load-in-progress. > The let/unwind support doesn't save and restore the integer value for > a Lisp_Misc_Boolfwd variable, just the boolean state. So after loading of > test3.el finishes above, load-in-progress is restored from its old > *boolean* value, and gets the value 1 instead of 2 as it should have. > When test2.elc is done loading, it drops to zero and it looks like we're > not currently loading any files, even though we're in the middle of loading > test.elc still. Good catch. > On the assumption that DEFVAR_BOOL variables really ought to just be used as > booleans (I haven't checked other boolean variables though), and we don't > want to change the Lisp-visible binding to an integer (or "if > load-in-progress" would stop working right), I'm working on a patch to make > load-in-progress an actual boolean, and put the file- > loading depth counter elsewhere, inaccessible to Lisp (since it's > inaccessible now). I think we should drop the counter altogether, and use specbind instead. Stefan