From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Fabrice Popineau" Newsgroups: gmane.emacs.devel Subject: Re: patch to fileio.c Date: Fri, 7 Nov 2008 01:17:51 +0100 Message-ID: References: <87zlkfe7c2.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226078311 27184 80.91.229.12 (7 Nov 2008 17:18:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2008 17:18:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 07 18:19:34 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KyUzY-0000Em-I9 for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2008 18:19:29 +0100 Original-Received: from localhost ([127.0.0.1]:37994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KyUyR-0002OG-4N for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2008 12:18:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KyUqU-0003SB-F9 for emacs-devel@gnu.org; Fri, 07 Nov 2008 12:10:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KyUqS-0003QH-TF for emacs-devel@gnu.org; Fri, 07 Nov 2008 12:10:06 -0500 Original-Received: from [199.232.76.173] (port=49071 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KyUqS-0003Pv-DR for emacs-devel@gnu.org; Fri, 07 Nov 2008 12:10:04 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:50359 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KyUqS-0001N9-4f for emacs-devel@gnu.org; Fri, 07 Nov 2008 12:10:04 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1KyUqQ-0000Cj-Ab for emacs-devel@gnu.org; Fri, 07 Nov 2008 17:10:02 +0000 Original-Received: from lns-bzn-50f-62-147-239-182.adsl.proxad.net ([62.147.239.182]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Nov 2008 17:10:02 +0000 Original-Received: from fabrice.popineau by lns-bzn-50f-62-147-239-182.adsl.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Nov 2008 17:10:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lns-bzn-50f-62-147-239-182.adsl.proxad.net In-Reply-To: <87zlkfe7c2.fsf@cyd.mit.edu> X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105449 Archived-At: [ I'm posting my answer here too.] > Thanks for the patch. Your analysis sounds correct. > > However, I would like to test it first. Do you have a recipe for > demonstrating incorrect specpdl_ptr handling (e.g. a crash)? I compiled emacs with msvc, and it crashed all the time under the same circumstance. Visit a file, modify it outside emacs, and try to re-visit it. Emacs will detect that it has been modified and will ask about reloading it. The fd is closed twice because of the unwind_protect. With msvcrt.dll, the MS C library, this is a crash. I'm not sure that glibc is that picky. Possibly you won't see the problem. However, to make sure, and to test the patch, I added printf() statements at both places where fd can be closed, to trace what happened. Greetings, Fabrice