This is the mail archive of the cygwin-developers@sourceware.cygnus.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: 19991024 snapshot problems


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:
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;
 }
 

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