delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/31/20:20:13

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Thu, 31 Aug 2000 20:18:47 -0400
To: cygwin AT sources DOT redhat DOT com
Subject: Re: DLL naming conventions
Message-ID: <20000831201847.A22959@cygnus.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: cygwin AT sources DOT redhat DOT com
References: <20000831194146 DOT 867 DOT qmail AT web120 DOT yahoomail DOT com> <20000831154242 DOT B7880 AT cygnus DOT com> <39AEC3AD DOT 42FE1CB9 AT ece DOT gatech DOT edu> <20000831171339 DOT A15393 AT cygnus DOT com> <39AEDDC9 DOT D4315497 AT ece DOT gatech DOT edu>
Mime-Version: 1.0
User-Agent: Mutt/1.3.6i
In-Reply-To: <39AEDDC9.D4315497@ece.gatech.edu>; from cwilson@ece.gatech.edu on Thu, Aug 31, 2000 at 06:35:53PM -0400

On Thu, Aug 31, 2000 at 06:35:53PM -0400, Charles S. Wilson wrote:
>Cygwin has libz.dll
>GIMP has (a different) libz.dll (sorry to pick on you, Tor; I know you
>don't even use the name libz.dll for your zlib dll, but let me use GIMP
>as an example, okay?)
>  -- assume for the moment that libz.dll uses 'shared regions' whatever
>those are. DATA exports? I dunno.
>
>You run a cygwin program from /usr/bin -- it'll load & use the cygwin
>libz.dll in /usr/bin. Fine.
>
>Then you run GIMP. It loads *it's* version of libz.dll. Blammo! Problem.
>'shared region' mismatch or whatever. If libz.dll uses shared regions...
>
>Or vice versa: you run GIMP first, and it works. Then you run a cygwin
>app that depends on libz.dll and blammo!.
>
>How can this problem be fixed, short of (a) never ever exporting DATA --
>if that's what 'shared regions' are(???) or (b) using different names
>for the dlls -- and we're back to the 'cyg' prefix, or assuming that all
>those OTHER people will use different prefixes and leave us alone...

Cygwin's shared region problem comes about because it uses the name
'cygwin' when naming shared memory regions.

If the mythical 'libz' uses the name 'libz' then naming your version
of libz.dll 'chuck.wilson.libz.version.1.1a.dll' will not solve that.

Shared memory usage really has nothing to do with DLL naming.

>(niggling little question: do all dll's set aside a 'shared region'? or
>only those that export DATA items?  If a dll doesn't use a 'shared
>region' then you wouldn't see these sorts of errors, as long as the two
>dlls were ABI/API compatible -- or would you? )

The accepted way to share information is with CreateFileMapping and
MapViewOfFile.  There is also a method for sharing data by marking
a section in the dll as "shared".  Microsoft has said that that's not
guaranteed to work, but I've never seen it fail.

So, again, cygwin is somewhat unique in being able to detect when there
are two versions in use.  It can do this because it uses shared memory
for things like pid info, etc.  Not every DLL will do this.  And, if
a DLL does do this the problem is not necessarily rectified by renaming
the DLL.  In fact, I think it is unlikely.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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