Date: Thu, 9 Aug 2001 09:23:49 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Charles Sandmann cc: djgpp-workers AT delorie DOT com Subject: Re: Selector Exhaustion In-Reply-To: <10108090440.AA13158@clio.rice.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 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.