Add ID of blocking thread and friendly error message to criticalsection timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, inspired by the reassuring noises Gaim makes when it segfaults, here
is a patch to make Wine give users some tips when a critical section
times out. We should probably do the same for when winedbg is triggered
by an exception. If it's too annoying we can have them toggled on/off at
configure time, so packages meant for end users can include them, and
developer builds do not.

ChangeLog:
Human readable explanation in RtlpWaitForCriticalSection
Add the ID of the blocking thread to the error message
Index: dlls/ntdll/critsection.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/critsection.c,v
retrieving revision 1.19
diff -u -r1.19 critsection.c
--- dlls/ntdll/critsection.c	4 Apr 2003 19:41:31 -0000	1.19
+++ dlls/ntdll/critsection.c	12 Jun 2003 14:45:13 -0000
@@ -155,14 +155,19 @@
         {
             const char *name = (char *)crit->DebugInfo;
             if (!name) name = "?";
-            ERR( "section %p %s wait timed out, retrying (60 sec) tid=%04lx\n",
-                 crit, debugstr_a(name), GetCurrentThreadId() );
+            ERR( "section %p %s wait timed out in thread 0x%04lx, blocked by 0x%04lx, retrying in 60 seconds\n",
+                 crit, debugstr_a(name), GetCurrentThreadId(), (DWORD)crit->OwningThread );
+	     MESSAGE("WARNING: A part of the software you are running under emulation has deadlocked.\n");
+	     MESSAGE("This is probably due to a bug in Wine, and has occurred through no fault of your own.\n");
+	     MESSAGE("You may have to terminate the program at this point by pressing Ctrl-C, or it may\n");
+	     MESSAGE("recover and continue to run. If this problem is reproducable, please report it to the\n");
+	     MESSAGE("WineHQ bug tracking database at http://bugs.winehq.com/, and quote the above error code.\n");
             time.QuadPart = -60000 * 10000;
             status = NtWaitForSingleObject( sem, FALSE, &time );
             if ( status == WAIT_TIMEOUT && TRACE_ON(relay) )
-            {
-                ERR( "section %p %s wait timed out, retrying (5 min) tid=%04lx\n",
-                     crit, debugstr_a(name), GetCurrentThreadId() );
+	      {
+		ERR( "section %p %s wait timed out in thread %04lx, blocked by 0x%04lx, retrying in 5 minutes\n",
+		     crit, debugstr_a(name), GetCurrentThreadId(), (DWORD) crit->OwningThread );
                 time.QuadPart = -300000 * (ULONGLONG)10000;
                 status = NtWaitForSingleObject( sem, FALSE, &time );
             }

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux