delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/10/25/13:52:59

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-developers-unsubscribe-archive-cygwin-developers=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Mon, 25 Oct 1999 13:55:14 -0400
To: Vadim Egorov <egorovv AT 1c DOT ru>
Cc: "cygwin-developers AT sourceware DOT cygnus DOT com" <cygwin-developers AT sourceware DOT cygnus DOT com>
Subject: Re: 19991024 snapshot problems
Message-ID: <19991025135514.A1555@cygnus.com>
Mail-Followup-To: Vadim Egorov <egorovv AT 1c DOT ru>,
"cygwin-developers AT sourceware DOT cygnus DOT com" <cygwin-developers AT sourceware DOT cygnus DOT com>
References: <3814410E DOT 6BA45D66 AT 1c DOT ru>
Mime-Version: 1.0
X-Mailer: Mutt 0.95.6i
In-Reply-To: <3814410E.6BA45D66@1c.ru>; from Vadim Egorov on Mon, Oct 25, 1999 at 03:37:50PM +0400

--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii

Thanks for reporting this.

I've applied your patch.

Your other problem was due to the changes that I made yesterday to the
DLL loading code.

Does the enclosed patch solve your problem?

cgf

On Mon, Oct 25, 1999 at 03:37:50PM +0400, Vadim Egorov wrote:
>Next I started to get 'Application failed to initialize properly 
>(0xc0000005)' message during x-applications startup. GDB shows the 
>following stack:

--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=p

Index: dll_init.cc
===================================================================
RCS file: /cvs/cvsfiles/devo/winsup/dll_init.cc,v
retrieving revision 1.22
diff -u -p -r1.22 dll_init.cc
--- dll_init.cc	1999/10/25 02:07:05	1.22
+++ dll_init.cc	1999/10/25 17:49:57
@@ -126,7 +126,7 @@ add (HMODULE h, char *name, per_process 
       _max += INC;
     }
 
-  _list[_last].name = name ? strdup (name) : NULL;
+  _list[_last].name = name && type == LOAD ? strdup (name) : NULL;
   _list[_last].handle = h;
   _list[_last].p = p;
   _list[_last].type = type;
@@ -372,32 +372,33 @@ DllList::forkeeLoadDlls ()
   _in_forkee = 1;
   int try2 = 0;
   for (int i = 0; i < _last; i++)
-    {
-      const char *name = _list[i].name;
-      HINSTANCE handle = _list[i].handle;
-      HINSTANCE h = LoadLibraryEx (name, NULL, DONT_RESOLVE_DLL_REFERENCES);
+    if (_list[i].type == LOAD)
+      {
+	const char *name = _list[i].name;
+	HINSTANCE handle = _list[i].handle;
+	HINSTANCE h = LoadLibraryEx (name, NULL, DONT_RESOLVE_DLL_REFERENCES);
 
-      if (h == handle)
-	{
-	  LoadLibrary (name);
-	  FreeLibrary (h);
-	}
-      else if (try2)
-	api_fatal ("unable to remap %s to same address as parent -- %p", name, h);
-      else
-	{
-	  FreeLibrary (h);
-	  reserve_upto (name, (DWORD) handle);
-	  try2 = 1;
-	  i--;
-	  continue;
-	}
-      if (try2)
-	{
-	  release_upto (name, (DWORD) handle);
-	  try2 = 0;
-	}
-    }
+	if (h == handle)
+	  {
+	    LoadLibrary (name);
+	    FreeLibrary (h);
+	  }
+	else if (try2)
+	  api_fatal ("unable to remap %s to same address as parent -- %p", name, h);
+	else
+	  {
+	    FreeLibrary (h);
+	    reserve_upto (name, (DWORD) handle);
+	    try2 = 1;
+	    i--;
+	    continue;
+	  }
+	if (try2)
+	  {
+	    release_upto (name, (DWORD) handle);
+	    try2 = 0;
+	  }
+      }
   _in_forkee = 0;
 }
 

--cNdxnHkX5QqsyA0e--

- Raw text -


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