From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#3892: marked as done (corrupting load-in-progress value with "let") Date: Sat, 15 Aug 2009 23:15:09 +0000 Message-ID: References: <87fxbslllh.fsf@cyd.mit.edu> <47712C91-B427-4C1C-8731-F8BE9463A4A3@raeburn.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1250378109-4961-0" X-Trace: ger.gmane.org 1250378886 24160 80.91.229.12 (15 Aug 2009 23:28:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Aug 2009 23:28:06 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 16 01:27:59 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 1McSfE-0006Cc-6I for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Aug 2009 01:27:57 +0200 Original-Received: from localhost ([127.0.0.1]:40005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McSfD-0002Zk-JY for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Aug 2009 19:27:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McSeK-0001mO-Gq for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:27:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McSeG-0001f1-3V for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:26:59 -0400 Original-Received: from [199.232.76.173] (port=40911 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McSeF-0001ey-ON for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:26:55 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43719) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1McSeF-00022d-5T for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:26:55 -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 n7FNQnPa006821; Sat, 15 Aug 2009 16:26:52 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7FNF9aC005000; Sat, 15 Aug 2009 16:15:09 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 3892 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:30235 Archived-At: This is a multi-part message in MIME format... ------------=_1250378109-4961-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sat, 15 Aug 2009 19:10:34 -0400 with message-id <87fxbslllh.fsf@cyd.mit.edu> and subject line Re: bug#3892: corrupting load-in-progress value with "let" has caused the Emacs bug report #3892, regarding corrupting load-in-progress value with "let" to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 3892: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D3892 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1250378109-4961-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 21 Jul 2009 04:27:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6L4QxmZ030817 for ; Mon, 20 Jul 2009 21:27:01 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MT6wM-0008O3-Ob for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 00:26:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MT6wM-0008Np-34 for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 00:26:58 -0400 Received: from [199.232.76.173] (port=38064 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MT6wL-0008Nl-SJ for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 00:26:57 -0400 Received: from [76.119.237.235] (port=64696 helo=raeburn.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MT6wL-0002nx-Gd for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2009 00:26:57 -0400 Received: from [10.0.0.172] (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id n6L41CA5010557; Tue, 21 Jul 2009 00:01:12 -0400 (EDT) Message-Id: <47712C91-B427-4C1C-8731-F8BE9463A4A3@raeburn.org> From: Ken Raeburn To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: corrupting load-in-progress value with "let" Mime-Version: 1.0 (Apple Message framework v935.3) Date: Tue, 21 Jul 2009 00:01:12 -0400 X-Mailer: Apple Mail (2.935.3) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-Greylist: delayed 1542 seconds by postgrey-1.27 at monty-python; Tue, 21 Jul 2009 00:26:55 EDT With these source files: ==> test.el <== (message "test: load-in-progress %S" load-in-progress) (let ((load-path (cons "." load-path))) (load "test2")) (message "test: load-in-progress %S" load-in-progress) ==> test2.el <== (message "test2: load-in-progress %S" load-in-progress) (load "test3") (message "test2: load-in-progress %S" load-in-progress) ==> test3.el <== (message "test3: load-in-progress %S" load-in-progress) and test.el and test2.el byte-compiled but test3.el only present in source form, the resulting output shows that load-in-progress is inconsistent: % ./b/Inst/bin/emacs --batch -l test.elc test: load-in-progress t Loading test2... test2: load-in-progress t Loading /tmp/emacs-23.0.96/test3.el (source)... test3: load-in-progress t test2: load-in-progress t test: load-in-progress nil % I'm working with the CVS sources and 23.0.96 prerelease code, but can reproduce the behavior in 22.1 as shipped with Mac OS X. 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. There is code (in C mode, among others) which checks whether a file is being loaded, so this can have a behavioral impact under certain conditions. I haven't actually triggered the problem in my normal usage patterns though. 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). Ken ------------=_1250378109-4961-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 3892-done) by emacsbugs.donarmstrong.com; 15 Aug 2009 23:09:37 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FN9ZMC003982 for <3892-done@emacsbugs.donarmstrong.com>; Sat, 15 Aug 2009 16:09:36 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 5195057E21C; Sat, 15 Aug 2009 19:10:34 -0400 (EDT) From: Chong Yidong To: 3892-done@emacsbugs.donarmstrong.com Subject: Re: bug#3892: corrupting load-in-progress value with "let" Date: Sat, 15 Aug 2009 19:10:34 -0400 Message-ID: <87fxbslllh.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Closing the bug (see 2009-07-25 checkin to trunk by Ken Raeburn). ------------=_1250378109-4961-0--