Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Date: Mon, 25 Oct 1999 13:55:14 -0400 To: Vadim Egorov Cc: "cygwin-developers AT sourceware DOT cygnus DOT com" Subject: Re: 19991024 snapshot problems Message-ID: <19991025135514.A1555@cygnus.com> Mail-Followup-To: Vadim Egorov , "cygwin-developers AT sourceware DOT cygnus DOT com" References: <3814410E DOT 6BA45D66 AT 1c DOT ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=cNdxnHkX5QqsyA0e 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--