This is the mail archive of the cygwin@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: fork + dlls


I had written earlier (and on an empty stomach):
> 
> This has been a bug since day one, and one that needs a bit of redesign
> of the code in winsup/dll_init.cc to do it right. The current code there
> is quite complex, and overly so in some cases, and someone who knows more 
> about it needs to take a look. 

I was confused. My local hack was completely unnecessary since the code
is actually all there, albeit a bit too complex for me to comprehend at
first [and here's where I plug in the empty stomach bit].

The following should fix Eric's testcase that uses dlsym across fork.

The strcmp->strcasecmp is necessary since the get_full_path_of_dll()
in dlfcn.cc doesn't necessarily have the same case as the name returned 
by GetModuleFileName() checked by DllList::recordDll. Amazing how these
little things can steer you in the wrong direction!

Chris, the case-insensitive filename comparison should fix the problem 
you had mentioned. Could you please check?

Sat May 22 19:03:47 1999  Mumit Khan  <khan@xraylith.wisc.edu>

	* dll_init.cc (DllList::recordDll): Forkee must reload dlopened
	DLLs. Also use strcasecmp, not strcmp to compare file name.

Index: dll_init.cc
===================================================================
RCS file: /home/khan/CVSROOT/cygwin/cygwin-dev/winsup/dll_init.cc,v
retrieving revision 1.1.1.1
diff -u -3 -p -p -r1.1.1.1 dll_init.cc
--- dll_init.cc	1999/05/21 23:51:12	1.1.1.1
+++ dll_init.cc	1999/05/23 01:04:44
@@ -185,6 +185,7 @@ DllList::recordDll (HMODULE h, per_proce
     {
       type = LOAD;
       _numberOfOpenedDlls++;
+      forkeeMustReloadDlls (1);
     }
 
   if (type == LOAD && _dlopenedLib !=0)
@@ -193,7 +194,7 @@ DllList::recordDll (HMODULE h, per_proce
     GetModuleFileName (h, buf, MAX_PATH);
     // it is not the current dlopened lib
     // so we insert one empty lib to preserve place for current dlopened lib
-    if (strcmp (_dlopenedLib, buf) != 0)
+    if (strcasecmp (_dlopenedLib, buf) != 0)
       {
       if (_dlopenIndex == -1)
 	_dlopenIndex = add (0, 0, NONE);

--
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]