delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2019/08/17/21:34:35

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Rod Pemberton <invalid AT lkntrgzxc DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [PATCH] exec: fix inversions in leak detection logic
Date: Sat, 17 Aug 2019 21:17:31 -0400
Organization: Aioe.org NNTP Server
Lines: 53
Message-ID: <qja8q7$h45$2@gioia.aioe.org>
References: <964e3268-2f75-ee73-ab5a-b01bf1aadb98 AT yandex DOT ru>
<qj9iq5$1iqb$2 AT gioia DOT aioe DOT org>
<7551dfde-01be-7633-3d12-aab8533b66c7 AT yandex DOT ru>
NNTP-Posting-Host: +15yR2JuBIwiofOqK4kSZw.user.gioia.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse AT aioe DOT org
X-Notice: Filtered by postfilter v. 0.9.2
Bytes: 3014
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x7I1Uc8a006388
Reply-To: djgpp AT delorie DOT com

On Sat, 17 Aug 2019 23:47:50 +0300
"stsp (stsp2 AT yandex DOT ru) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
wrote:

> 17.08.2019 22:02, Rod Pemberton пишет:

> > I'm confused by this patch, but I'm also not familiar with what the
> > code does.  
>
> In fact, the leaks I am aware of, are coming from
> the fact that many DPMI servers do not do the
> automatic clean-up of all resources that were
> allocated _and not freed_ by the _non-first_ DPMI
> client. 

I don't know what you mean by this.

AIUI, only one DPMI host is active, the very first one loaded.  AIUI,
the first DPMI host controls protected-mode (PM) entirely.  Other
DPMI hosts defer to the first DPMI host, i.e., by not loading or not
installing.  You seem to be implying that many different DPMI hosts are
present and functioning, all using/sharing the same GDT and IDT.  IIRC,
that's how VCPI works.

E.g., if you execute a DJGPP app in real-mode, the app startup code
checks to see if another DPMI host is present.  If another host is
present, the DJGPP DPMI host is not loaded, and the app will attempt
to use the in-memory DPMI host.  If no other host is present, the app
will load the selected DJGPP compatible host and use it.  If DJGPP app
is executed in virtual 8086 mode (V86 mode), i.e., Windows console, the
DJGPP app doesn't load it's DPMI host but uses Windows' DPMI host.

AFAIK, there is never more than one DPMI host loaded.  When a DJGPP app
unloads, it returns to real mode (RM).  SO, protected mode (PM) is free
to be used by another DPMI host.  I.e., no using/sharing of the same GDT
and IDT ever occurs.  Some other DPMI hosts don't return to RM, but
remain in V86 mode, i.e., keep control of PM and GDT and IDT.

> I.e. if some client frees his resources - no leak.

My understanding is that it's only Windows DPMI hosts which leak
descriptors.

> Which means, [...]

Anyway, this issue probably best reviewed by Eli or Charles.


Rod Pemberton
-- 
Let me say it yet again.  Reducing gun violence doesn't reduce
violence.  Dead is dead, whether by gun, car, hammer, club, or knife.


- Raw text -


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