From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <10206101701.AA17158@clio.rice.edu> Subject: Re: unixy sbrk and win2k To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Mon, 10 Jun 2002 12:01:40 -0500 (CDT) Cc: djgpp-workers AT delorie DOT com In-Reply-To: from "Eli Zaretskii" at Jun 10, 2002 08:20:37 AM X-Mailer: ELM [version 2.5 PL2] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > > The following patch to crt0.S seems to have fixed the problem: > > Could you please tell what problem is that? I understand it's related to > Emacs session being shut down by NTVDM, but IIRC we found and discussed > several specific issues related to that. I'd like to understand which > aspects should be solved by this patch. The problem sequence: 1) Enable unixy sbrk; enable any hardware interrupt to 32-bit code 2) call sbrk() ; it moves the DPMI memory block to a different address. 3) before we can change CS selector to point to new memory block, a hardware interrupt happens. The CS for the interrupt points to invalid memory; NTVDM exits. The other problems (with ds_alias) still exist but they are minor. ds_alias is only used by exceptions (or if the user presses CTRL-C, etc). This is very infrequent (so hitting a few hundred instruction window is even more rare - I couldn't even make it happen). However, any hardware interrupt (like a key upstroke break interrupt) are very common. Normally we look at it, and ignore it, but it requires the Protected mode CS to be there. We disable interrupts (or try) so this won't happen til we are finished moving. However Win2K was ignoring the disable request and sending the interrupt in the middle of the move (sigh).