delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/09/03:42:22

Date: Thu, 9 Aug 2001 09:23:49 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Selector Exhaustion
In-Reply-To: <10108090440.AA13158@clio.rice.edu>
Message-ID: <Pine.SUN.3.91.1010809091937.7420J-100000@is>
MIME-Version: 1.0
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

On Wed, 8 Aug 2001, Charles Sandmann wrote:

> Using a modified version of our "spawn" test routine, I tried the following:
> 1) Allocate a selector before spawning.
> 2) Spawn
> 3) Allocate another selector.
> 4) Free all selectors between the two selector values (inclusive).
> 
> Guess what?  I can clean up the selectors, no problem.  I can loop
> forever.  Where I would puke after 600 loops before, the current
> version will loop forever (well, at least as long as I've run it...)
> 
> This does have a few flaws - is assumes there won't be any selector
> holes.

It also assumes all the selectors in between belong to the child program, 
and thus are not used anymore.  Isn't that a dangerous assumption?

> But this seems like an effective
> way (at least on W2K) to get rid of the selector leakage.  Worth
> investigation to put in libc?

I'd say post the patch and lets ask people to patch their libraries, 
rebuild as many applications which spawn other programs, such as Make, 
GCC, Emacs, and Bash, and lets test how well does it work for some
time.

> C:\djgpp\tests\libc\dos>showme
> c:/djgpp/tests/libc/dos/showme.exe: tb=05390 ds=0587
> 
> C:\djgpp\tests\libc\dos>kill ntvdm
> process #1160 [ntvdm.exe] killed
> 
> C:\djgpp\tests\libc\dos>showme
> c:/djgpp/tests/libc/dos/showme.exe: tb=05390 ds=01af
> 
> C:\djgpp\tests\libc\dos>showme
> c:/djgpp/tests/libc/dos/showme.exe: tb=05390 ds=01af
> 
> You can see I need to reset the NTVDM occasionally.

This seems to be unlike what happens on Windows 9X, where exiting the 
parent application back to COMMAND.COM frees all the selectors.

- Raw text -


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