http://bugs.winehq.org/show_bug.cgi?id=24963
Summary: Okad2: Unhandled page fault at address 0x00007f8a during startup Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: pandolfo@gis.net
Created an attachment (id=31617) --> (http://bugs.winehq.org/attachment.cgi?id=31617) a description of the page fault plus an annotated backtrace
During program startup, Okad2-xx-pd (xx = version) generates an unhandled page fault when loading an icon. The page fault is caused by CreateFileW as it processes the name of the file from the parameter list. The name pointer is 0x00007f8a, which is an address in an unmapped page. This value is also an index into Windows resources, selecting the hourglass icon.
What has happened is that the application was attempting to load the hourglass icon and passed in BOTH the Windows resource index and a flag indicating LOADFROMFILE. Wine attempted to load-from-file and looked for the file name through the "name" parameter (0x00007f8a) generating the page fault. Native Windows appears to give the value of the "name" pointer precedence and determines that the "name" parameter is actually a resource number; hence it does not page fault and runs Okad2 normally.
Wine *DOES* check the "name" parameter to see if it is a resource index, but several subroutine calls later it forgets this fact and branches based on the LOADFROMFILE bit. The backtrace has been annotated to provide both a description and source lines involved in the decision.
This behavior was found in the latest version of Wine for Debian (.1.42) and in a MacOS X version.
http://bugs.winehq.org/show_bug.cgi?id=24963
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #31617|video/x-flv |text/plain mime type| | Attachment #31617|wine-pf-expl |wine-pf-expl.txt filename| |
http://bugs.winehq.org/show_bug.cgi?id=24963
Michael Pandolfo pandolfo@gis.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.1.42
http://bugs.winehq.org/show_bug.cgi?id=24963
--- Comment #1 from Michael Pandolfo pandolfo@gis.net 2010-10-30 18:56:59 CDT ---
Okad2 is described and linked to at this web page:
http://greenarraychips.com/home/documents/greg/cf-releases.htm
and can be downloaded directly from this link:
http://greenarraychips.com/home/documents/greg/code/af-34k2-ga144-1-10-PD.zi...
http://bugs.winehq.org/show_bug.cgi?id=24963
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #2 from Dan Kegel dank@kegel.com 2010-10-31 00:06:56 CDT --- I tried writing a little test for this behavior:
/* Test a system cursor with LR_LOADFROMFILE incorrectly specified, as Okad2 does */ handle = LoadImageA(NULL, IDC_APPSTARTING, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE|LR_LOADFROMFILE); ok(handle != NULL, "LoadImage() from system resource with LR_LOADFROMFILE failed.\n");
but on Vista, it crashed. Okad2, on the other hand, runs on Vista. So I don't know what's going on. Can you write a small C program that succeeds on Windows and fails on Wine in the same way as Okad2?
http://bugs.winehq.org/show_bug.cgi?id=24963
Andrew Nguyen arethusa26@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #3 from Andrew Nguyen arethusa26@gmail.com 2010-10-31 16:07:27 CDT --- (In reply to comment #2)
I tried writing a little test for this behavior:
/* Test a system cursor with LR_LOADFROMFILE incorrectly specified, as
Okad2 does */ handle = LoadImageA(NULL, IDC_APPSTARTING, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE|LR_LOADFROMFILE); ok(handle != NULL, "LoadImage() from system resource with LR_LOADFROMFILE failed.\n");
but on Vista, it crashed. Okad2, on the other hand, runs on Vista. So I don't know what's going on. Can you write a small C program that succeeds on Windows and fails on Wine in the same way as Okad2?
NT-based platforms seem to have a compatibility hack within user32 or thereabouts that looks at the PE optional header version fields. I ran an unmodified user32_crosstest.exe with your test through the test bot, which showed that LoadImageA on platforms older than Win2k3 fail with the test parameters, while Vista and newer platforms crash.
After using a PE editor on user32_crosstest.exe to change the required OS version, image version, and subsystem version to match Okad2's values, running that executable through the test bot showed that LoadImageA succeeds for the given parameters on all platforms except Win98.
Do we want to replicate the exact compatibility check, or should we just change LoadImage to succeed/fail as it does on Win2k3 and older?
http://bugs.winehq.org/show_bug.cgi?id=24963
--- Comment #4 from butraxz@gmail.com 2013-06-30 08:55:52 CDT --- This ticket has not been updated for over 900 days.
Is this still an issue in wine version 1.6-rc4 or higher or is this to be closed as abandoned ?
http://bugs.winehq.org/show_bug.cgi?id=24963
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://greenarraychips.com/ | |home/documents/greg/code/af | |-34k2-ga144-1-10-PD.zip
http://bugs.winehq.org/show_bug.cgi?id=24963
--- Comment #5 from Dan Kegel dank@kegel.com --- sha1sum of my copy from 2010: b54cfc88e86e7c09edec4b8f37426e9cffb29e18
http://bugs.winehq.org/show_bug.cgi?id=24963
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Summary|Okad2: Unhandled page fault |Okad2 crashes on startup |at address 0x00007f8a |(LoadImage of OEM cursor |during startup |with LR_LOADFROMFILE flag | |set)
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello folks,
--- quote --- After using a PE editor on user32_crosstest.exe to change the required OS version, image version, and subsystem version to match Okad2's values, running that executable through the test bot showed that LoadImageA succeeds for the given parameters on all platforms except Win98. --- quote ---
many older apps relying on old/broken Win32 API behaviour can be safely identified by looking at NT optional header 'MajorSubsystemVersion' field (and possibly 'MinorSubsystemVersion' if needed).
Wine already makes use of this in some places to work around broken behaviour.
Dump of 'Okad2-41-pd.exe' PE header with 'LordPE' tool:
--- snip --- ... ->Optional Header Magic: 0x010B (HDR32_MAGIC) MajorLinkerVersion: 0x02 MinorLinkerVersion: 0x32 -> 2.50 SizeOfCode: 0x00000200 SizeOfInitializedData: 0x00000400 SizeOfUninitializedData: 0x00000200 AddressOfEntryPoint: 0x00001000 BaseOfCode: 0x00001000 BaseOfData: 0x00002000 ImageBase: 0x10000000 SectionAlignment: 0x00001000 FileAlignment: 0x00000200 MajorOperatingSystemVersion: 0x0001 MinorOperatingSystemVersion: 0x0000 -> 1.00 MajorImageVersion: 0x0001 MinorImageVersion: 0x0061 -> 1.97 MajorSubsystemVersion: 0x0003 MinorSubsystemVersion: 0x000A -> 3.10 Win32VersionValue: 0x00000000 SizeOfImage: 0x20000000 SizeOfHeaders: 0x00000400 CheckSum: 0x00000000 Subsystem: 0x0003 (WINDOWS_CUI) DllCharacteristics: 0x0000 SizeOfStackReserve: 0x00100000 SizeOfStackCommit: 0x00001000 SizeOfHeapReserve: 0x00100000 SizeOfHeapCommit: 0x00001000 LoaderFlags: 0x00000000 NumberOfRvaAndSizes: 0x00000010 ... --- snip ---
The app has MajorSubsystemVersion.MinorSubsystemVersion set to '3.10'.
A compatibility workaround for those old apps can be implemented by using GetProcessVersion() and check for '< 0x400' condition.
--- snip --- 0012FF44 00000000 ; hInst = NULL 0012FF48 00007F8A ; Name = OCR_APPSTARTING 0012FF4C 00000002 ; Type = IMAGE_CURSOR 0012FF50 00000000 ; DesiredX = 0 0012FF54 00000000 ; DesiredY = 0 0012FF58 00000050 ; Flags = LR_LOADFROMFILE|LR_DEFAULTSIZE --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=24963
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/user32-LR_LOAD | |FROMFILE Status|NEW |STAGED CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, michael@fds-team.de, | |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=24963
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de Staged patchset|https://github.com/wine-com |https://github.com/wine-sta |pholio/wine-staging/tree/ma |ging/wine-staging/tree/mast |ster/patches/user32-LR_LOAD |er/patches/user32-LR_LOADFR |FROMFILE |OMFILE
https://bugs.winehq.org/show_bug.cgi?id=24963
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #7 from Zebediah Figura z.figura12@gmail.com --- Also affects Monopoly (2000). To replicate this bug you will first need to work around bug 18971 (by copying font files into C:\windows\fonts) and bug 42908 (by changing the Selected3DDevice in C:\Program Files\Hasbro Interactive\Monopoly\DirectX.ini to the index of a hardware device; for me this was 3.)