From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27642: 26.0.50; Assertion failure with nested load Date: Thu, 13 Jul 2017 21:08:25 +0300 Message-ID: <83lgnsgqg6.fsf@gnu.org> References: <83d195iu70.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1499969354 27611 195.159.176.226 (13 Jul 2017 18:09:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Jul 2017 18:09:14 +0000 (UTC) Cc: p.stephani2@gmail.com, 27642@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 13 20:09:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dViXx-0006h5-RG for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jul 2017 20:09:05 +0200 Original-Received: from localhost ([::1]:33392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dViY3-0007HL-Ad for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jul 2017 14:09:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dViXx-0007H8-Kv for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 14:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dViXu-0001ky-EY for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 14:09:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dViXu-0001k5-AS for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 14:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dViXt-0000Oe-TO for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 14:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jul 2017 18:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27642 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27642-submit@debbugs.gnu.org id=B27642.14999693161492 (code B ref 27642); Thu, 13 Jul 2017 18:09:01 +0000 Original-Received: (at 27642) by debbugs.gnu.org; 13 Jul 2017 18:08:36 +0000 Original-Received: from localhost ([127.0.0.1]:37332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dViXU-0000Nz-8C for submit@debbugs.gnu.org; Thu, 13 Jul 2017 14:08:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dViXT-0000No-4u for 27642@debbugs.gnu.org; Thu, 13 Jul 2017 14:08:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dViXK-0000nJ-VM for 27642@debbugs.gnu.org; Thu, 13 Jul 2017 14:08:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dViXK-0000n5-Sf; Thu, 13 Jul 2017 14:08:26 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3629 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dViXK-0008JE-7c; Thu, 13 Jul 2017 14:08:26 -0400 In-reply-to: (message from Paul Eggert on Wed, 12 Jul 2017 14:25:00 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134515 Archived-At: > Cc: 27642-done@debbugs.gnu.org > From: Paul Eggert > Date: Wed, 12 Jul 2017 14:25:00 -0700 > > On 07/12/2017 07:52 AM, Eli Zaretskii wrote: > > I guess the safety harness installed by Paul should be improved to > > support recursive calls to 'load'. Until then, I installed a > > temporary work-around, just to let people who build with assertions > > enabled work in Emacs without crashes in these cases. > > Your fix is not merely a temporary workaround, as it should work even if > there are recursive calls with errors. Closing the bug report, and thanks. Glad I could fix this, but something is still bothering me. AFAIU, the infile object is used throughout lread.c, and the places that use it insist on it not being a NULL pointer. Example: DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, doc: /* Don't use this yourself. */) (void) { if (!infile) error ("get-file-char misused"); Next, my reading of the code is that close_infile_unwind is normally called whenever Fload returns. So if there is a recursive call to Fload, the inner call will clobber the value of infile set by the outer call, and when the inner call returns, infile will become a NULL pointer when close_infile_unwind is called. Doesn't that get in the way of the outer call, if it then tries to resume its readevalloop? Or did I miss something? TIA