From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: patch to fileio.c Date: Fri, 14 Nov 2008 21:01:50 +0200 Message-ID: References: <87zlkfe7c2.fsf@cyd.mit.edu> <87skpv3a35.fsf@cyd.mit.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1226689342 13872 80.91.229.12 (14 Nov 2008 19:02:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 19:02:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 14 20:03:22 2008 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 1L13wu-0004Ni-Et for ged-emacs-devel@m.gmane.org; Fri, 14 Nov 2008 20:03:20 +0100 Original-Received: from localhost ([127.0.0.1]:54026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L13vm-0003Em-CV for ged-emacs-devel@m.gmane.org; Fri, 14 Nov 2008 14:02:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L13vi-0003EX-HD for emacs-devel@gnu.org; Fri, 14 Nov 2008 14:02:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L13vh-0003EL-NU for emacs-devel@gnu.org; Fri, 14 Nov 2008 14:02:06 -0500 Original-Received: from [199.232.76.173] (port=33965 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L13vh-0003EI-Jg for emacs-devel@gnu.org; Fri, 14 Nov 2008 14:02:05 -0500 Original-Received: from mtaout4.012.net.il ([84.95.2.10]:40879) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L13vg-0002eg-Ty for emacs-devel@gnu.org; Fri, 14 Nov 2008 14:02:05 -0500 Original-Received: from conversion-daemon.i_mtaout4.012.net.il by i_mtaout4.012.net.il (HyperSendmail v2004.12) id <0KAC00C007LH4L00@i_mtaout4.012.net.il> for emacs-devel@gnu.org; Fri, 14 Nov 2008 21:03:55 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.205.49]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KAC00BCV7M8C000@i_mtaout4.012.net.il>; Fri, 14 Nov 2008 21:03:55 +0200 (IST) In-reply-to: <87skpv3a35.fsf@cyd.mit.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:105687 Archived-At: > From: Chong Yidong > Date: Thu, 13 Nov 2008 10:43:42 -0500 > > "Fabrice Popineau" writes: > > > [ 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. > > Does anyone else using Windows see this problem? I don't see the crashes, but if I run Emacs under GDB and put a breakpoint in w32.c:sys_close, I definitely see it being called twice for the same file descriptor on which Emacs opened the file in insert-file-contents.