New execution behavior

Duane Clark dclark at akamail.com
Wed Feb 28 11:21:40 CST 2001


Howdy,

Here is a symptom that has crept into the recent version of wine. Since
I know how to make things work, this is just a post in case someone is
interested.

When I recently updated to the Feb 24 CVS version (from the Feb 4
version), I suddenly had the symptom that I could only run one program
at a time. In other words, I ran the program schedit (one I use
regularly), and it came up and worked fine. But when I then tried to
also run symed, it would not come up, but instead gave:

err:ntdll:RtlpWaitForCriticalSection Critical section 0x400f9ad0 
wait timed out, retrying (60 sec) fs=022f

Where the address 0x400f9ad0 is in:

disas 0x400f9ad0
0x400f9ad0 (peb_lock [rtl.c]): addb     %al,0x0(%eax)
0x400f9ad2 (peb_lock+0x2 [rtl.c]): addb %al,0x0(%eax)
0x400f9ad4 (peb_lock+0x4 [rtl.c]):
0x400f9ad6 (peb_lock+0x6 [rtl.c]):
0x400f9ad8 (peb_lock+0x8 [rtl.c]): addb %al,0x0(%eax)
0x400f9ada (peb_lock+0xa [rtl.c]): addb %al,0x0(%eax)
0x400f9adc (peb_lock+0xc [rtl.c]): addb %al,0x0(%eax)
0x400f9ade (peb_lock+0xe [rtl.c]): addb %al,0x0(%eax)
0x400f9ae0 (peb_lock+0x10 [rtl.c]): cmpb        $0,%al
0x400f9ae2 (peb_lock+0x12 [rtl.c]): addb        %al,0x0(%eax)
Wine-dbg>

Trying a couple other programs showed that this affected all of them. In
particular, one that is more readily available, Wordview97. For example,
I could run one instance of wordview, but not a second. This is running
wine along with a Win98 installation. 

It turns out the for some obscure reason I had the DLLs exactly as in
the sample config file, except that I had:

"DefaultLoadOrder" = "builtin, native, so"

Putting it the (presumably) right way fixed things (except a wordview
font problem):

"DefaultLoadOrder" = "native, builtin, so"

Here is info on the the loading of DLLs. The only differences I see with
native first is with ole32 being native instead of builtin, and that
rpcrt4 gets loaded much later.

Here is with "DefaultLoadOrder" = "native, builtin, so"

trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\kernel32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\advapi32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\gdi32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\user32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\ole32.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\mso97v.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module 'C:\Program
Files\WordView\wwint32v.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\shlwapi.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\comctl32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\shell32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\winspool.drv' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'krnl386.exe' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'system' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'wprocs' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'GDI.EXE' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\WINDOWS\SYSTEM\wineps.DLL' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'USER.EXE' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\WINDOWS\SYSTEM\x11drv.DLL' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'display' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\comdlg32.dll' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'commdlg.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\rpcrt4.dll' : native

And here is with "DefaultLoadOrder" = "builtin, native, so"

trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\kernel32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\advapi32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\gdi32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\user32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\rpcrt4.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\ole32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\mso97v.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module 'C:\Program
Files\WordView\wwint32v.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\shlwapi.dll' : native
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\comctl32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\shell32.dll' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\winspool.drv' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'krnl386.exe' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'system' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'wprocs' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'GDI.EXE' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\WINDOWS\SYSTEM\wineps.DLL' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'USER.EXE' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\WINDOWS\SYSTEM\x11drv.DLL' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'display' : builtin
trace:loaddll:MODULE_LoadLibraryExA Loaded module
'C:\windows\system\comdlg32.dll' : builtin
trace:loaddll:MODULE_LoadModule16 Loaded module 'commdlg.dll' : builtin

And here is a short message from Gerard, regarding a trace I had sent
him. Both traces are from running Wordview, where the first one came up
ok and the second crashed (the behavior changed when run with these
debug messages enabled):

Here is what your app (actually, probably rpcrt4 for Win9x) is doing :

Call kernel32.193:
CreateFileMappingA(ffffffff,00000000,00000004,00000000,00000400,7fbd4a7c
"rpcrt4sharedmem") ret=7fb9177b fs=008f
Ret  kernel32.193: CreateFileMappingA() retval=00000048 ret=7fb9177b
fs=008f
Call kernel32.419: GetLastError() ret=7fb9178e fs=008f
Ret  kernel32.419: GetLastError() retval=00000000 ret=7fb9178e fs=008f
Call kernel32.632:
MapViewOfFile(00000048,00000002,00000000,00000000,00000000) ret=7fb917ac
fs=008f
Ret  kernel32.632: MapViewOfFile() retval=40349000 ret=7fb917ac fs=008f
Call kernel32.553: HeapCreate(04000000,00001000,00000000) ret=7fb95c0f
fs=008f
Ret  kernel32.553: HeapCreate() retval=65430000 ret=7fb95c0f fs=008f
Call kernel32.551: HeapAlloc(65430000,00000000,00000040) ret=7fb95bf9
fs=008f
Ret  kernel32.551: HeapAlloc() retval=6543009c ret=7fb95bf9
fs=008f             

So, we have created a shared memory area and allocated memory at
65430000

Now here is what the next process is doing :

Call kernel32.193:
CreateFileMappingA(ffffffff,00000000,00000004,00000000,00000400,7fbd4a7c
"rpcrt4sharedmem") ret=7fb9177b fs=008f
Ret  kernel32.193: CreateFileMappingA() retval=00000048 ret=7fb9177b
fs=008f
Call kernel32.419: GetLastError() ret=7fb9178e fs=008f
Ret  kernel32.419: GetLastError() retval=000000b7 ret=7fb9178e fs=008f
Call kernel32.632:
MapViewOfFile(00000048,00000002,00000000,00000000,00000000) ret=7fb917ac
fs=008f
Ret  kernel32.632: MapViewOfFile() retval=40349000 ret=7fb917ac fs=008f
Call kernel32.380: GetCurrentProcessId() ret=7fb95d5b fs=008f
Ret  kernel32.380: GetCurrentProcessId() retval=0808e1b8 ret=7fb95d5b
fs=008f
Call user32.422: MessageBoxA(00000000,40474ae0 "Unhandled page fault on
read access to 0x654300b0 

We have opened the shared memory  (this is working since GetLastError
returns
that the file already exists  : 000000b7), and tried to access data at
0x654300b0. This is
failing it seems (you could try to run with -debugmsg +seh to confirm
that an 
exception is occuring there)

Note that the second process has allocated *no memory* at this place;
from where 
is coming this 654300b0 value ? I guess from the shared memory. 

Duane




More information about the wine-devel mailing list