Segfaults in RtlTryEnterCriticalSection ?

Sylvain Petreolle spetreolle at
Thu Mar 13 03:48:03 CST 2003

What information could be usefull to debug a segfault in
RtlTryEnterCriticalSection ?
Since March beginning I have segfaults into programs that used to run

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 8925)]
0x400ba904 in RtlTryEnterCriticalSection (crit=0x40240570) at
1918        __asm__ __volatile__( ".byte 0x64\n\tmovl 0x24,%0" : "=r"
(ret) );
(gdb) bt
#0  0x400ba904 in RtlTryEnterCriticalSection (crit=0x40240570) at
#1  0x4009355c in TryEnterCriticalSection (crit=0x40240570) at
#2  0x400b15f3 in __pthread_mutex_trylock (mutex=0x4212b180) at
#3  0x42073999 in calloc () from /lib/i686/
#4  0x410c69e7 in s8790 () from /usr/X11R6/lib/modules/dri/

(gdb) list -
1908    {
1909        DWORD ret;
1910        __asm__ __volatile__( ".byte 0x64\n\tmovl 0x20,%0" : "=r"
(ret) );
1911        return ret;
1912    }
1914    extern inline DWORD WINAPI GetCurrentThreadId(void);
1915    extern inline DWORD WINAPI GetCurrentThreadId(void)
1916    {
1917        DWORD ret;
gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x400ba8e4 to 0x400ba924:
0x400ba8e4 <RtlTryEnterCriticalSection+32>:     or     $0x74,%al
0x400ba8e6 <RtlTryEnterCriticalSection+34>:     or    
0x400ba8ec <RtlTryEnterCriticalSection+40>:     leave
0x400ba8ed <RtlTryEnterCriticalSection+41>:     ret    $0x4
0x400ba8f0 <RtlTryEnterCriticalSection+44>:     mov    $0x1,%eax
0x400ba8f5 <RtlTryEnterCriticalSection+49>:     lock xadd %eax,(%edx)
0x400ba8f9 <RtlTryEnterCriticalSection+53>:     incl   0x8(%esi)
0x400ba8fc <RtlTryEnterCriticalSection+56>:     mov    $0x1,%ecx
0x400ba901 <RtlTryEnterCriticalSection+61>:     jmp    0x400ba8e7
0x400ba903 <RtlTryEnterCriticalSection+63>:     nop
0x400ba904 <RtlTryEnterCriticalSection+64>:     mov    %fs:0x24,%eax
0x400ba90a <RtlTryEnterCriticalSection+70>:     mov    %eax,0xc(%esi)
0x400ba90d <RtlTryEnterCriticalSection+73>:     movl   $0x1,0x8(%esi)
0x400ba914 <RtlTryEnterCriticalSection+80>:     jmp    0x400ba8fc
0x400ba916 <RtlTryEnterCriticalSection+82>:     mov    %esi,%esi
0x400ba918 <RtlLeaveCriticalSection>:   push   %ebp
0x400ba919 <RtlLeaveCriticalSection+1>: mov    %esp,%ebp
0x400ba91b <RtlLeaveCriticalSection+3>: mov    0x8(%ebp),%ecx
0x400ba91e <RtlLeaveCriticalSection+6>: push   %ebx
0x400ba91f <RtlLeaveCriticalSection+7>: mov    0x8(%ecx),%eax
0x400ba922 <RtlLeaveCriticalSection+10>:        dec    %eax
0x400ba923 <RtlLeaveCriticalSection+11>:        call   0x400ba928
End of assembler dump.

Sylvain Petreolle
spetreolle at 
Fight Spam ! EuroCauce:
ICQ #170597259

"Don't think you are. Know you are." Morpheus, in "Matrix".

Do You Yahoo!? -- Une adresse gratuite et en français !
Yahoo! Mail :

More information about the wine-devel mailing list