https://bugs.winehq.org/show_bug.cgi?id=54829
Bug ID: 54829 Summary: Unhandled exception: page fault on write access to, invalid program stack in 64-bit code Product: Wine Version: 8.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: philipp.heimpel@gmail.com Distribution: ---
Created attachment 74334 --> https://bugs.winehq.org/attachment.cgi?id=74334 Error Details
When running wine VCarveDesktopTrialEdition.exe I receive the following error:
Unhandled exception: page fault on write access to, invalid program stack in 64-bit code
Installation went fine and without errors
Download link: https://storage.googleapis.com/vectric_public/VCarveDesktopTrialEdition_Setu...
Debian GNU/Linux 11 (bullseye)
https://bugs.winehq.org/show_bug.cgi?id=54829
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download CC| |xerox.xerox2000x@gmail.com Status|UNCONFIRMED |NEW Ever confirmed|0 |1 URL| |https://storage.googleapis. | |com/vectric_public/VCarveDe | |sktopTrialEdition_Setup.exe Summary|Unhandled exception: page |Unhandled exception in |fault on write access to, |VCarveDesktopTrialEdition: |invalid program stack in |page fault on write access, |64-bit code |invalid program stack in | |64-bit code
--- Comment #1 from Louis Lenders xerox.xerox2000x@gmail.com --- Confirming
Just before the crash there's a call to: 00d4:Call kernelbase.GetSystemWow64DirectoryA(08c34684,00000008) ret=1440836ac 00d4:Call ntdll.RtlInitUnicodeString(009afbf0,7b08fc40 L"C:\windows\syswow64") ret=7b017cae 00d4:Ret kernelbase.GetSystemWow64DirectoryA() retval=00000014 ret=1440836ac
If you put a hack in kernelbase so that that call fails, the application starts fine for me; I guess maybe a different code path is than chosen (?)
Looks like it might have to do with wow64 support (?)
Hack to make the program start:
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index b676c50c416..06bd47e242c 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2201,7 +2201,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetSystemWindowsDirectoryW( LPWSTR path, UINT coun */ UINT WINAPI /* DECLSPEC_HOTPATCH */ GetSystemWow64DirectoryA( LPSTR path, UINT count ) { - if (!is_win64 && !is_wow64) + if (!is_win64 && !is_wow64 || 1) { SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return 0;
https://bugs.winehq.org/show_bug.cgi?id=54829
--- Comment #2 from philipp.heimpel@gmail.com --- Thank you for the fast reply.
Since you mention that you found a hack to fix this.
Will this eventually be fixed in some release or is my only option to patch it locally https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/kernelbase/file.c#L22... and recompile?
https://bugs.winehq.org/show_bug.cgi?id=54829
--- Comment #3 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to philipp.heimpel from comment #2)
Will this eventually be fixed in some release or is my only option to patch it locally https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/kernelbase/file. c#L2204 and recompile?
I guess for now that is the only option. If the crash is indeed due to some wow64 issue, i hope for you it might be fixed in some of upcoming releases as there seems to be some work going on there. But for now I guess the stupid hack+recompile is only option
https://bugs.winehq.org/show_bug.cgi?id=54829
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Unhandled exception in |Vectric VCarve Desktop |VCarveDesktopTrialEdition: |Trial crashes on start |page fault on write access, | |invalid program stack in | |64-bit code |
https://bugs.winehq.org/show_bug.cgi?id=54829
michal.lohnisky@seznam.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michal.lohnisky@seznam.cz
--- Comment #4 from michal.lohnisky@seznam.cz --- I got same issue with VCarve Pro Trial Edition 11.555. But it works on WINEARCH=win32 .
https://bugs.winehq.org/show_bug.cgi?id=54829
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fgouget@codeweavers.com
--- Comment #5 from François Gouget fgouget@codeweavers.com --- What happens is that the 64-bit version of VCarve tries to write to the kernelbase.dll memory, probably to hook some APIs, and fails because kernelbase.dll is mapped read-only. Note that kernelbase.dll is also mapped read-only on Windows.
This happens shortly after the GetSystemWow64DirectoryA() call so hacking it to mark kernelbase.dll as writable allows it to start up.
Also GetSystemWow64DirectoryA() returns ERROR_CALL_NOT_IMPLEMENTED on 32-bit Windows so hacking the 64-bit version to return that probably causes VCarve to take the working 32-bit code path.
Furthermore VCarve calls VirtualProtect() to mark all of its own executable's segments in memory as writable. So one would expect it to do so for kernelbase.dll too in Wine...
https://bugs.winehq.org/show_bug.cgi?id=54829
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tmwsr3@gmail.com
--- Comment #6 from François Gouget fgouget@codeweavers.com --- *** Bug 53924 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=54829
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |defsnotaburner0@gmail.com
--- Comment #7 from François Gouget fgouget@codeweavers.com --- *** Bug 54630 has been marked as a duplicate of this bug. ***