delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/09/10:03:07

Message-ID: <51CC8BA6EC01D1118E3200A024B9625B347996@mailhost.probe.co.uk>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Win95 DPMI and ___djgpp_hw_exception
Date: Tue, 9 Dec 1997 15:01:15 -0000
MIME-Version: 1.0

Joshua James Turpen writes:
> Ok, after being pointed out that my code doesn't lock the touched code
and
> variables, here is a completely bulletproof program (as far as I can
> tell) that crashes under Win95 DPMI. 

As Eli pointed out, you still aren't locking the variables correctly.
But I don't
think that is likely to be the cause of your problem: in my experience
Win95 
is quite lenient about such things (it tends to let you get away with
the 
mistake for a few weeks or months, before it decides to crash and
destroy 
your hard drive :-) while cwsdpmi will catch the problem from the start.
Since
you say it works under DOS but not under Win95, it seems likely that the
problem lies elsewhere...

I don't have the libc sources here to check the exact details of the 
___djgpp_hw_exception routine, so please forgive me if this turns out
not to be the case, but it occurs to me that you are making quite a few
assumptions about exactly what this function will do for you. In
particular
you aren't saving any registers except the ones that you modify
directly,
and you aren't switching the stack. Will ___djgpp_hw_exception take
care of this, or is it something that you should do first? The DPMI
server will make sure you have some kind of stack set up before it
calls your handler, so you can safely push the old register values, but
this is unlikely to be part of your normal data segment. Since gcc
assumes that ss == ds, it would cause major problems if this routine
was called while some other stack was in use...

> This is a very scary bug.  If it does turn out to be a bug in Win95
DPMI,
> it's really going to hurt DJGPP, since the ___djgpp_hw_exception trick
is
> the basis of signals under DJGPP.

I would tend to suspect your program before accusing Win95 or djgpp of
a bug :-) Sure, there are lots of problems with Win95, but thousands of
people
have been running djgpp under it for several years now, so it seems
unlikely
that any such fundamental flaws will have gone undiscovered...

	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019