https://bugs.winehq.org/show_bug.cgi?id=46401
Bug ID: 46401 Summary: MTA: San Andreas: "Problem with sandbox environment" error during startup Product: Wine Version: 4.0-rc4 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntoskrnl Assignee: wine-bugs@winehq.org Reporter: rafalh92@outlook.com Distribution: ---
Newest version of Multi Theft Auto: San Andreas are unplayable due to "Problem with sandbox environment" error (error code is CN03) during startup. It stopped working for me after MTA upgrade to newest version (it worked on newest Wine 3.0-rc4 with old version of MTA). I regtested it using MTA nightly binaries in https://nightly.mtasa.com: mtasa_xp-1.5.6-rc-14682-20181005.exe - works mtasa_xp-1.5.6-rc-14719-20181021.exe - does not work
There is no stacktrace information in logs but a lot of "Unhandled page fault". It was caused by winedevice.exe crashing during driver loading (MTA uses kernel driver FairplayKD.sys for its anticheat system). When I enabled normal crash handling for winedevice.exe (no idea why it's disabled by default in kernel32) I got stacktrace for the issue and it seems its caused by improper relocation handling in load_driver_module. This function in case of non-page-aligned driver handles relocations outside of loader and does it a bit different than the loader. Default wine PE loader first loads all sections, process relocations and then protects the pages from what I seen. Code in load_driver_module processes relocations after pages are already protected so it unprotects each page with relocations, update addresses and then changes protection back. It does it one page at a time. Problem with MTA happens because there is a relocation on a page boundary. Only one page is unprotected so exception is raised. When I updated the code to unprotect next page as well it worked good and MTA worked again. I have a patch ready and going to send it after the issue is created.