This is the mail archive of the cygwin-developers@cygwin.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]
Other format: [Raw text]

Re: hang in sig_wait waiting for debug lock


Hi!

Thursday, 05 September, 2002 Christopher Faylor cgf@redhat.com wrote:

CF> Any word on this?  Have you determined which thread has the lock?
CF> It should be easy to do by looking at the muto structure.

I'm having a hard time trying to reproduce this reliably. This change

Index: debug.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/debug.cc,v
retrieving revision 1.39
diff -u -p -2 -r1.39 debug.cc
--- debug.cc    6 Aug 2002 03:40:40 -0000       1.39
+++ debug.cc    6 Sep 2002 12:24:09 -0000
@@ -79,5 +79,5 @@ out:
 }
 
-#ifdef DEBUGGING_AND_FDS_PROTECTED
+#ifdef DEBUGGING
 void
 setclexec (HANDLE oh, HANDLE nh, bool not_inheriting)
Index: fhandler.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/fhandler.cc,v
retrieving revision 1.134
diff -u -p -2 -r1.134 fhandler.cc
--- fhandler.cc 30 Aug 2002 15:47:09 -0000      1.134
+++ fhandler.cc 6 Sep 2002 12:24:10 -0000
@@ -1172,7 +1172,9 @@ void
 fhandler_base::set_inheritance (HANDLE &h, int not_inheriting)
 {
-#ifdef DEBUGGING_AND_FDS_PROTECTED
+#ifdef DEBUGGING
   HANDLE oh = h;
 #endif
+  if (!h) 
+    return;
   /* Note that we could use SetHandleInformation here but it is not available
      on all platforms.  Test cases seem to indicate that using DuplicateHandle
@@ -1183,5 +1185,5 @@ fhandler_base::set_inheritance (HANDLE &
                             DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
     debug_printf ("DuplicateHandle failed, %E");
-#ifdef DEBUGGING_AND_FDS_PROTECTED
+#ifdef DEBUGGING
   if (h)
     setclexec (oh, h, not_inheriting);

eliminates a host of strange errors i've seen in debugging mode,
including a debug muto one.

Changelog states, however, that setclexec stuff isn't needed. Yet i
can't see why we shouldn't process protected handle list as long as we
recreating handles during set-close-on-exec operation. Can you give a
comment?

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


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