X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3CE0BBBC.452A75DD@gmx.net> From: Anton Helm X-Mailer: Mozilla 4.72 [en] (WinNT; I) X-Accept-Language: en,de,de-AT,no,sv,fi MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: segfault on context switch References: <31542 DOT 1020351804 AT www41 DOT gmx DOT net> <3cd20320 DOT sandmann AT clio DOT rice DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 39 Date: Tue, 14 May 2002 08:24:44 +0100 NNTP-Posting-Host: 62.252.9.96 X-Complaints-To: abuse AT ntlworld DOT com X-Trace: newsfep1-win.server.ntli.net 1021361164 62.252.9.96 (Tue, 14 May 2002 08:26:04 BST) NNTP-Posting-Date: Tue, 14 May 2002 08:26:04 BST Organization: ntlworld News Service To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Charles, Thanks for your kind advice. I downloaded new binaries today, recompiled, relinked and the problem disappeared. Happy context-switching ... ;-) Tony Charles Sandmann wrote: > > > The program is reading/writing data from/to a com port using > > the svasync library. No problems in plain DOS, but when I'm > > running WinNT4.0 and do a context switch (Alt-TAB) while the > > program is running I get a segfault in malloc(). No problems > > without context switch though ... > > > Does that ring a bell anywhere? Is this a known WinNT "feature"? > > I suspect you are turfing up a known problem with Windows NT - it > does not allow address wrap on selector limits. If a malloc asks > for a memory block and it is returned "below" the starting address, > in Win9x we just wrap the address space around (4Gb) to access it. > > NT won't allow this, silently fails the selector limit set, then > any access to that memory (malloc) fails. Alt-Tab causes things > outside the VDM to happen which causes a memory block at a low > address to free up. > > > I'm using DJGPP v2.03 with GCC v2.95.3, binaries about 6 months old. > > Check your lib\crt0.o - if it is dated earlier than December 2001 try > upgrading to the djdev203.zip on Simtel (refreshed version). This is > one of the fixes I put in the refresh. Windows 2000 caused this problem > at a much higher frequency than Windows NT so I fixed it. > > If you have the the updated crt0.o - it's possible that I botched the > patch - a full register list/traceback might help identify the problem.