This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DLL naming conventions


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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]