http://bugs.winehq.org/show_bug.cgi?id=11987
Summary: RtlpWaitForCriticalSection timeout in NeedForSpeed III Product: Wine Version: 0.9.57. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: luis.montes@dslextreme.com
Created an attachment (id=11312) --> (http://bugs.winehq.org/attachment.cgi?id=11312) patch changing the RtlpWaitForCriticalSection in dlls/ntdll/critsection.c to look for exit thread status
When trying to play Need for Speed III, Hot Pursuit, the screen freezes about 3 out of 4 tries at startup for about 5 min before closing. Upon exit, the terminal shows an error: err:ntdll:RtlpWaitForCriticalSection section 0x7efec984 "loader.c: loader_section" wait timed out in thread 001d, blocked by 001b, retrying (60 sec)
By running with WINEDEBUG=+relay I found out that the thread 001b seems to have exit, but apparently it never released the critical section, thus the error. I hunted down the place where the message is printed and if I modify the code to look in the dead thread's exit status for anything other than STILL_ACTIVE then the program always starts (but I still can't get -d3d0 to use hardware acceleration at a decent rate |-(
After playing for a while with this patch in, upon exit I find the following: err:ntdll:RtlpWaitForCriticalSection section 0x60041bd0 "?" wait timed out in thread 0022, blocked by 0009, retrying (60 sec) err:ntdll:RtlpWaitForCriticalSection section 0x60041bb8 "?" wait timed out in thread 0022, blocked by 0021, retrying (60 sec) err:ntdll:RtlpWaitForCriticalSection section 0x60041bd0 "?" wait timed out in thread 0009, blocked by 0022, retrying (60 sec)
I think that implies that the threads are now getting confused because I did not *released* the critical section held by the dead thread, the new thread got the critical section along with the dead, and who knows what's wineserver thinking about that. Anybody has any ideas how to properly fix it?
http://bugs.winehq.org/show_bug.cgi?id=11987
--- Comment #1 from Alexandre Julliard julliard@winehq.org 2008-03-11 06:25:50 --- Please attach the relay trace that shows the problem.
http://bugs.winehq.org/show_bug.cgi?id=11987
--- Comment #2 from Luis A. Montes luis.montes@dslextreme.com 2008-03-11 23:19:21 --- Created an attachment (id=11332) --> (http://bugs.winehq.org/attachment.cgi?id=11332) nfs3.exe ran with WINEDEBUG=+relay
http://bugs.winehq.org/show_bug.cgi?id=11987
--- Comment #3 from Luis A. Montes luis.montes@dslextreme.com 2008-03-11 23:20:03 --- (From update of attachment 11332) (In reply to comment #1)
Please attach the relay trace that shows the problem.
I put back the original 0.9.57 wine ntdll.dll.so and ran it as: WINEDEBUG=+relay wine nfs3.exe >&/tmp/nfs3-relay.txt
relay seems to slow down something so that the problem is less frequent, say 1 out of 4 tries, but sure enough, I got it to fail. Big file, though, so I'm gzip-ing it. At line 148569 thread 001b closes. It closes the handles and deletes a critical section. The next time you find 001b is in line 173432 where the time out message is printed, but the critical section numbers don't seem to match, not sure I'm comparing the right numbers. I'll try to dig a bit deeper. Meanwhile, here is the ziped file.
http://bugs.winehq.org/show_bug.cgi?id=11987
Jeff Zaroyko jeffzaroyko@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeffzaroyko@gmail.com
--- Comment #4 from Jeff Zaroyko jeffzaroyko@gmail.com 2008-03-14 05:31:53 --- This might be a duplicate of bug 11317, Luis, are you running NFS III on a SMP system?
I am and I also see the RtlpWaitForCriticalSection timeouts, so I tested running on one cpu using schedtool -a 0x1 -e wine nfs3.exe to set the cpu affinity and those errors disappear.
http://bugs.winehq.org/show_bug.cgi?id=11987
Luis A. Montes luis.montes@dslextreme.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE
--- Comment #5 from Luis A. Montes luis.montes@dslextreme.com 2008-03-14 21:51:42 --- (In reply to comment #4)
This might be a duplicate of bug 11317, Luis, are you running NFS III on a SMP system?
I am and I also see the RtlpWaitForCriticalSection timeouts, so I tested running on one cpu using schedtool -a 0x1 -e wine nfs3.exe to set the cpu affinity and those errors disappear.
Thanks for the info. Indeed, I'm running in a SMP machine and the errors are gone if I use schedtool. So this is a duplicate.
*** This bug has been marked as a duplicate of bug 11317 ***
http://bugs.winehq.org/show_bug.cgi?id=11987
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Austin English austinenglish@gmail.com 2008-10-31 13:58:28 --- Closing duplicate.