Hy,
I've stumbled over problems trying to debug RtlCreateUserThread. The error I get depends on how I'm stepping through the code but seems to be caused by the syscall __NR_rt_sigprocmask (int 0x80 with eax=175). The thread for which procmask should get set is created by TIME_MMTimeStart in winmm/time.c;
Unfortunately I've no idea whether that's "normal" or how to fix ... If you want me to provide more info just tell me what you need to know.
I got three versions (common trace of all three versions see below):
========= FIRST VERSION: Stepping over 'sigprocmask( SIG_BLOCK, &block_set, &old_set );' ============= ... (COMMON TRACE) ... Wine-dbg> 241 struct __server_request_info * const req = req_ptr; Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> err:seh:setup_exception stack overflow 192 bytes in thread 000b eip 4023035b esp 405e0f40 stack 0x405e0000-0x406e0000 Invalid address for breakpoint 0, disabling it Invalid address for breakpoint 1, disabling it Invalid address for breakpoint 2, disabling it Invalid address for breakpoint 3, disabling it Process of pid=0000000a has terminated Wine-dbg> ======================================================================================================
========= SECOND VERSION: Stepping over 'int 0x80' with eax=0xAF (=175) ============================== ... (COMMON TRACE) ... Wine-dbg> 241 struct __server_request_info * const req = req_ptr; Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg>si 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc81 (wine_server_call+0x22 [server.c:244] in NTDLL.DLL): pushl %eax 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc82 (wine_server_call+0x23 [server.c:244] in NTDLL.DLL): leal 0x5884(%ebx),%eax 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc88 (wine_server_call+0x29 [server.c:244] in NTDLL.DLL): pushl %eax 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc89 (wine_server_call+0x2a [server.c:244] in NTDLL.DLL): pushl $0x0 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc8b (wine_server_call+0x2c [server.c:244] in NTDLL.DLL): call 0x40211788 (_init+0x46c in ntdll.dll.so) 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 0x40211788 (_init+0x46c in ntdll.dll.so): jmp *0x11c(%ebx) Wine-dbg> 0x400cdb10 (NTDLL.DLL.toupper+0x64a0 in libc.so.6): pushl %ebp Wine-dbg> 0x400cdb11 (NTDLL.DLL.toupper+0x64a1 in libc.so.6): movl %esp,%ebp Wine-dbg> 0x400cdb13 (NTDLL.DLL.toupper+0x64a3 in libc.so.6): subl $8,%esp Wine-dbg> 0x400cdb16 (NTDLL.DLL.toupper+0x64a6 in libc.so.6): movl %esi,0x0(%esp) Wine-dbg> 0x400cdb19 (NTDLL.DLL.toupper+0x64a9 in libc.so.6): movl $0x8,%esi Wine-dbg> 0x400cdb1e (NTDLL.DLL.toupper+0x64ae in libc.so.6): movl %edi,0x4(%esp) Wine-dbg> 0x400cdb22 (NTDLL.DLL.toupper+0x64b2 in libc.so.6): movl 0x8(%ebp),%edi Wine-dbg> 0x400cdb25 (NTDLL.DLL.toupper+0x64b5 in libc.so.6): movl 0xc(%ebp),%ecx Wine-dbg> 0x400cdb28 (NTDLL.DLL.toupper+0x64b8 in libc.so.6): movl 0x10(%ebp),%edx Wine-dbg> 0x400cdb2b (NTDLL.DLL.toupper+0x64bb in libc.so.6): xchgl %ebx,%edi Wine-dbg> 0x400cdb2d (NTDLL.DLL.toupper+0x64bd in libc.so.6): movl $0xaf,%eax Wine-dbg> 0x400cdb32 (NTDLL.DLL.toupper+0x64c2 in libc.so.6): int $0x80 Wine-dbg> fixme:seh:UnhandledExceptionFilter Unhandled error on debug event: 0 0x400cdb36 (NTDLL.DLL.toupper+0x64c6 in libc.so.6): cmpl $-4096,%eax Wine-dbg> ======================================================================================================
========= THIRD VERSION: Stepping into 'int 0x80' with eax=0xAF (=175) =============================== ... (COMMON TRACE) ... Wine-dbg> 241 struct __server_request_info * const req = req_ptr; Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg>si 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc81 (wine_server_call+0x22 [server.c:244] in NTDLL.DLL): pushl %eax 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc82 (wine_server_call+0x23 [server.c:244] in NTDLL.DLL): leal 0x5884(%ebx),%eax 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc88 (wine_server_call+0x29 [server.c:244] in NTDLL.DLL): pushl %eax 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc89 (wine_server_call+0x2a [server.c:244] in NTDLL.DLL): pushl $0x0 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); 0x4024cc8b (wine_server_call+0x2c [server.c:244] in NTDLL.DLL): call 0x40211788 (_init+0x46c in ntdll.dll.so) 244 sigprocmask( SIG_BLOCK, &block_set, &old_set ); Wine-dbg> 0x40211788 (_init+0x46c in ntdll.dll.so): jmp *0x11c(%ebx) Wine-dbg> 0x400cdb10 (NTDLL.DLL.toupper+0x64a0 in libc.so.6): pushl %ebp Wine-dbg> 0x400cdb11 (NTDLL.DLL.toupper+0x64a1 in libc.so.6): movl %esp,%ebp Wine-dbg> 0x400cdb13 (NTDLL.DLL.toupper+0x64a3 in libc.so.6): subl $8,%esp Wine-dbg> 0x400cdb16 (NTDLL.DLL.toupper+0x64a6 in libc.so.6): movl %esi,0x0(%esp) Wine-dbg> 0x400cdb19 (NTDLL.DLL.toupper+0x64a9 in libc.so.6): movl $0x8,%esi Wine-dbg> 0x400cdb1e (NTDLL.DLL.toupper+0x64ae in libc.so.6): movl %edi,0x4(%esp) Wine-dbg> 0x400cdb22 (NTDLL.DLL.toupper+0x64b2 in libc.so.6): movl 0x8(%ebp),%edi Wine-dbg> 0x400cdb25 (NTDLL.DLL.toupper+0x64b5 in libc.so.6): movl 0xc(%ebp),%ecx Wine-dbg> 0x400cdb28 (NTDLL.DLL.toupper+0x64b8 in libc.so.6): movl 0x10(%ebp),%edx Wine-dbg> 0x400cdb2b (NTDLL.DLL.toupper+0x64bb in libc.so.6): xchgl %ebx,%edi Wine-dbg> 0x400cdb2d (NTDLL.DLL.toupper+0x64bd in libc.so.6): movl $0xaf,%eax Wine-dbg> 0x400cdb32 (NTDLL.DLL.toupper+0x64c2 in libc.so.6): int $0x80 Wine-dbg>ni err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 4024e090 esp 4001bc60 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b880 stack 0x405e0000-0x406e0000 err:seh:setup_exception nested exception on signal stack in thread 000f eip 400cdb35 esp 4001b4b4 stack 0x405e0000-0x406e0000 ... INFINITE LOOP, PATTERN NOW REPEATING UNTIL 'killall -9 wine-pthread' ... ======================================================================================================
============================================ COMMON TRACE ============================================ merlin@Merlin:/my/hom/merlin/.wine/fake_windows/Program Files/Bullfrog/Keeper> winedbg KEEPER95.EXE fixme:console:SetConsoleCtrlHandler (0x40615b43,1) - no error checking or testing yet WineDbg starting on pid e Breakpoint 1 at 0x004f1ed0 Unable to add breakpoint, will check again any time a new DLL is loaded Loaded debug information from ELF '/usr/local/bin/wine-pthread' ((nil)) Breakpoint 2 at 0x4000dd60 (_end+0x2fef9d60) Loaded debug information from ELF '/usr/local/lib/libwine.so.1' (0x4003a000) No debug information in ELF '/lib/i686/libpthread.so.0' (0x40053000) No debug information in ELF '/lib/i686/libc.so.6' (0x400a4000) No debug information in ELF '/lib/libdl.so.2' (0x401d7000) No debug information in ELF '/lib/i686/libm.so.6' (0x401da000) No debug information in ELF '/lib/ld-linux.so.2' (0x40000000) Loaded debug information from ELF '/usr/local/lib/wine/ntdll.dll.so' (0x401fe000) Loaded debug information from ELF '/usr/local/lib/libwine_unicode.so.1' (0x40274000) Loaded debug information from ELF '/usr/local/lib/wine/kernel32.dll.so' (0x40480000) No debug information in 32bit DLL 'C:\Program Files\Bullfrog\Keeper\KEEPER95.EXE' (0x400000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\NTDLL.DLL' (0x40220000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\KERNEL32.DLL' (0x404b0000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\ADVAPI32.DLL' (0x40780000) Loaded debug information from ELF '/usr/local/lib/wine/gdi32.dll.so' (0x406e0000) Loaded debug information from ELF '/usr/local/lib/wine/advapi32.dll.so' (0x4076a000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\GDI32.DLL' (0x40700000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\USER32.DLL' (0x407e0000) Loaded debug information from ELF '/usr/local/lib/wine/winspool.drv.so' (0x4079c000) Loaded debug information from ELF '/usr/local/lib/wine/user32.dll.so' (0x407c1000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\WINSPOOL.DRV' (0x407b0000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\WINMM.DLL' (0x40920000) Loaded debug information from ELF '/usr/local/lib/wine/winmm.dll.so' (0x40914000) No debug information in 32bit DLL 'C:\PROGRAM FILES\BULLFROG\KEEPER\MSS32.DLL' (0x20000000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\RPCRT4.DLL' (0x40a20000) Loaded debug information from ELF '/usr/local/lib/wine/ole32.dll.so' (0x40988000) Loaded debug information from ELF '/usr/local/lib/wine/rpcrt4.dll.so' (0x40a04000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\OLE32.DLL' (0x409a0000) No debug information in 32bit DLL 'C:\PROGRAM FILES\BULLFROG\KEEPER\WSND7R.DLL' (0x10000000) No debug information in 32bit DLL 'C:\PROGRAM FILES\BULLFROG\KEEPER\SMACKW32.DLL' (0x40a4e000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\DDRAW.DLL' (0x40a90000) Loaded debug information from ELF '/usr/local/lib/wine/ddraw.dll.so' (0x40a66000) No debug information in ELF '/usr/X11R6/lib/libSM.so.6' (0x40021000) No debug information in ELF '/usr/X11R6/lib/libICE.so.6' (0x40b08000) No debug information in ELF '/usr/X11R6/lib/libXrandr.so.2' (0x4001c000) No debug information in ELF '/usr/X11R6/lib/libXrender.so.1' (0x40032000) No debug information in ELF '/usr/X11R6/lib/libXext.so.6' (0x40b1f000) No debug information in ELF '/usr/X11R6/lib/libX11.so.6' (0x40b2d000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\DPLAYX.DLL' (0x40c40000) Loaded debug information from ELF '/usr/local/lib/wine/dplayx.dll.so' (0x40c29000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\IPHLPAPI.DLL' (0x40ca0000) Loaded debug information from ELF '/usr/local/lib/wine/wsock32.dll.so' (0x40ae8000) Loaded debug information from ELF '/usr/local/lib/wine/ws2_32.dll.so' (0x40c66000) Loaded debug information from ELF '/usr/local/lib/wine/iphlpapi.dll.so' (0x40c8e000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\WS2_32.DLL' (0x40c70000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\WSOCK32.DLL' (0x40af0000) No debug information in ELF '/usr/lib/libfreetype.so.6' (0x40ccf000) No debug information in ELF '/usr/lib/libfontconfig.so.1' (0x40d25000) No debug information in ELF '/usr/lib/libexpat.so.0' (0x40d4d000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\X11DRV.DLL' (0x40d80000) Loaded debug information from ELF '/usr/local/lib/wine/x11drv.dll.so' (0x40d6d000) No debug information in ELF '/usr/lib/tls/libGL.so.1' (0x40df6000) No debug information in ELF '/usr/lib/tls/libGLcore.so.1' (0x40e53000) No debug information in ELF '/usr/X11R6/lib/libXcursor.so.1' (0x413a8000) No debug information in ELF '/usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2' (0x4002a000) No debug information in ELF '/usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2' (0x40caf000) No debug information in ELF '/usr/lib/gconv/ISO8859-15.so' (0x405dd000) No debug information in ELF '/usr/lib/libcups.so.2' (0x41415000) No debug information in ELF '/usr/lib/libssl.so.0.9.7' (0x41432000) No debug information in ELF '/usr/lib/libcrypto.so.0.9.7' (0x41462000) No debug information in ELF '/lib/libnss_files.so.2' (0x41554000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\WINEOSS.DRV' (0x41410000) Loaded debug information from ELF '/usr/local/lib/wine/wineoss.drv.so' (0x413f5000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\MSACM32.DLL' (0x41460000) Loaded debug information from ELF '/usr/local/lib/wine/msacm.drv.so' (0x41438000) Loaded debug information from ELF '/usr/local/lib/wine/msacm32.dll.so' (0x41450000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\MSACM.DRV' (0x41440000) No debug information in 32bit DLL 'C:\WINDOWS\SYSTEM\MIDIMAP.DRV' (0x41480000) Loaded debug information from ELF '/usr/local/lib/wine/midimap.drv.so' (0x41472000) In 32-bit mode. Wine-dbg>c Stopped on breakpoint 1 at 0x004f1ed0 (KEEPER95.EXE.EntryPoint in KEEPER95.EXE) Wine-dbg>b RtlCreateUserThread Many symbols with name 'RtlCreateUserThread', choose the one you want (<cr> to abort): [1]: 0x40596350 (RtlCreateUserThread in KERNEL32.DLL) [2]: 0x40252665 (RtlCreateUserThread [thread.c:208] in NTDLL.DLL) => 2 Breakpoint 3 at 0x40252665 (RtlCreateUserThread [thread.c:208] in NTDLL.DLL) Wine-dbg>c Stopped on breakpoint 3 at 0x40252665 (RtlCreateUserThread [thread.c:208] in NTDLL.DLL) 208 { Wine-dbg>s 209 struct startup_info *info = NULL; Wine-dbg> 210 HANDLE handle = 0; Wine-dbg> 211 TEB *teb = NULL; Wine-dbg> 212 DWORD tid = 0; Wine-dbg> 217 if (pipe( request_pipe ) == -1) return STATUS_TOO_MANY_OPENED_FILES; Wine-dbg> 218 fcntl( request_pipe[1], F_SETFD, 1 ); /* set close on exec flag */ Wine-dbg> 219 wine_server_send_fd( request_pipe[0] ); Wine-dbg> 267 vec.iov_base = (void *)&data; Wine-dbg> 268 vec.iov_len = sizeof(data); Wine-dbg> 270 msghdr.msg_name = NULL; Wine-dbg> 271 msghdr.msg_namelen = 0; Wine-dbg> 272 msghdr.msg_iov = &vec; Wine-dbg> 273 msghdr.msg_iovlen = 1; Wine-dbg> 279 cmsg.len = sizeof(cmsg); Wine-dbg> 280 cmsg.level = SOL_SOCKET; Wine-dbg> 281 cmsg.type = SCM_RIGHTS; Wine-dbg> 282 cmsg.fd = fd; Wine-dbg> 283 msghdr.msg_control = &cmsg; Wine-dbg> 284 msghdr.msg_controllen = sizeof(cmsg); Wine-dbg> 285 msghdr.msg_flags = 0; Wine-dbg> 288 data.tid = GetCurrentThreadId(); Wine-dbg> 289 data.fd = fd; Wine-dbg> 293 if ((ret = sendmsg( fd_socket, &msghdr, 0 )) == sizeof(data)) return; Wine-dbg> 299 } Wine-dbg> 221 SERVER_START_REQ( new_thread ) Wine-dbg> 223 req->suspend = suspended; Wine-dbg> 224 req->inherit = 0; /* FIXME */ Wine-dbg> 225 req->request_fd = request_pipe[0]; Wine-dbg> 226 if (!(status = wine_server_call( req ))) Wine-dbg> 241 struct __server_request_info * const req = req_ptr; Wine-dbg>
(LAST 3 LINES REPEATED IN ABOVE VERSIONS TO MAKE CLEAR WHERE THEY START) ======================================================================================================