www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/05/17:49:13

To: djgpp AT delorie DOT com
Subject: Re: LONG: My INT31 handler isn't feeling too swell
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990404093438 DOT 19395L-100000 AT is> <7e7j4e$cr4$4 AT news DOT luth DOT se>
From: Michael Bukin <M DOT A DOT Bukin AT inp DOT nsk DOT su>
Date: 05 Apr 1999 00:25:08 +0700
In-Reply-To: ams@ludd.luth.se's message of "4 Apr 1999 11:41:02 GMT"
Message-ID: <20vhfc47t7.fsf@Sky.inp.nsk.su>
Lines: 61
X-Mailer: Gnus v5.5/Emacs 19.34
Reply-To: djgpp AT delorie DOT com

ams AT ludd DOT luth DOT se (Martin Str|mberg) writes:

> Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
> : 
> : On 3 Apr 1999, Martin Str|mberg wrote:
> : 
> : > I wonder what you people out there knowledgable in crash dumps have to
> : > say about this one.
> : 
> : Too many things went wrong there, so it's difficult to tell without
> : spending a nice long debugging session with your program (which I
> : cannot afford currently).

One other thing I noted is that you are trying to reuse any selector
freed with %ax=0x0001.  But this interrupt is used to free selectors
allocated by other DPMI functions too, not just %ax=0x0000.  Also, you
are not changing C flag, because when you are using iret, flags are
taken from stack.  IMHO, you should change flags on stack before using
iret.  Also, I think you should not use sti/cli in your interrupt
handler.

Anybody know what exactly is the problem with leaking descriptors on
Windows-9X?  Test program shows that Windows DPMI server has no
problems with allocating/deallocating selectors with 0x0000/0x0001, if
I make a loop which allocates/deallocates selectors, then it works
forever (I waited for 1000000 iteration and killed it with CTRL-C).

Windows may allocate some shadow descriptors for each application and
not free it when application terminates, but simple reuse of
descriptors will not work then, because we can only reuse deallocated
descriptors.  Or maybe Windows does not deallocate resources when
application terminates, then it might be possible to fix it by
deallocating all resources that program allocated itself.

Anyone has any ideas how to find out what is the problem with Windows
DPMI server?

> : 
> : Why did you need to spawn Bash?  I suggest to try COMMAND.COM first,
> : since Bash does some very complex tricks with DPMI functions.  It's
> : better to begin at the first grade...

I'm using the following code in my test programs:

if (_argc < 1)
  {
    fprintf (...);
    exit (1);
  }

/* Hook interrupts.  */

spawnvp (P_WAIT, _argv[1], _argv + 1);

And use the same code (without hooking interrupts) in another test
program which is then called from the first one.  I used it to
intercept which DPMI calls are executed by DJGPP programs (a lot of
them are used, still trying to interpret results).

-- 
Michael Bukin

- Raw text -


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