delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/28/15:46:36

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 28 Feb 2003 15:46:27 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: bug report - DLL failure on win ME with gcc-3
Message-ID: <20030228204627.GA13666@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20030228133404 DOT 420ee242 DOT steven DOT obrien2 AT ntlworld DOT com>
Mime-Version: 1.0
In-Reply-To: <20030228133404.420ee242.steven.obrien2@ntlworld.com>
User-Agent: Mutt/1.5.1i

On Fri, Feb 28, 2003 at 01:34:04PM +0000, Steven O'Brien wrote:
>Hi
>I think I've found the problem with dlopen()/fork() on Win ME as
>reported in
>http://cygwin.com/ml/cygwin/2003-02/msg02221.html
>If I'm right, it also applies to win 95/98.
>
>in dll_init.cc: (dll_list::load_after_fork) a call is made to 
>LoadLibraryEx (d.name, NULL, DONT_RESOLVE_DLL_REFERENCES);
>
>According to the MSDN library, at
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/loadlibraryex.asp
>the symbol DONT_RESOLVE_DLL_REFERENCES is not supported on win 9x/Me. It
>does not say what the result of using this value on those platforms is.
>I suspect that this breaks the LoadLibraryEx call, so that the
>subsequent FreeLibrary call ends up deallocating memory that was never
>allocated, hence the crash.
>
>I have tried a patched version of dll_init.cc that uses plain
>LoadLibrary instead of LoadLibraryEx on win 9x/Me, and with this patched
>cygwin1.dll my test program runs correctly on all platforms. I have
>attached the patch (cvs diff -up dll_init.cc). Could someone please
>review this patch and apply it if it is acceptable?

I've looked at the patch.  I don't exactly understand why it's
necessary, though.  If it was necessary, you'd think that we'd have a
number of people complaining that dynamically linked DLLs don't work on
ME.

FWIW, the patch bypasses cygwin conventions by checking for version number
in the middle of a function.  See the wincap functionality for how this
is supposed to be handled.

I wonder if just a simple test for NULL being returned from
LoadLibraryEx is all that is required.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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