Cxbx-Reloaded / game-compatibility

Cxbx-Reloaded game compatibilty list, using GitHub issues
GNU General Public License v2.0
115 stars 29 forks source link

Monster 4x4: World Circuit [US-073] [1.01] #511

Open jeltaqq opened 6 years ago

jeltaqq commented 6 years ago

Description

* ReprotectVMA: VirtualProtect could not protect the vma! The error code was 87

Dumps

Xbe.txt

Status

Previous behavior:

None reported

Current behavior:

state-crashes

Screenshots

message

Additional Information

Tested with build 1cc0220b

PatrickvL commented 6 years ago

@Ergo720 Would you like to take a peek at this one?

ghost commented 6 years ago

Error 87 means an invalid parameter has been passed to VirtualProtect. I need a kernel log from a debug build of cxbx to understand better the issue, since release builds don't show the log from the manager. @jeltaqq can you create one please? Also, can you upload a kernel log from a release build for the other game issues you posted? Without such a log, we can't understand why the game is crashing

ghost commented 6 years ago

One more note: I actually encountered the same error in Panzer Dragoon ORTA when pressing the start button on the main menu. However, it only ever happened once and I couldn't reproduce it afterwards no matter how many times I tried. Probably this is a rare condition so I won't be surprised if @jeltaqq can't reproduce it now

jeltaqq commented 6 years ago

Debug build log KrnlDebug.txt

ghost commented 6 years ago

Thanks. The problem is that the game is passing PAGE_NOCACHE | PAGE_WRITECOMBINE to MmSetAddressProtect, which AFAIK is an invalid protection combination and will become 0 when VirtualProtect is called with it, which is indeed and invalid parameter. The fix is easy: a ternary operator checking for 0 in VirtualProtect will do it

PatrickvL commented 6 years ago

@ergo720 And what should be returned on either side of the ternary operator?

ghost commented 6 years ago

MmSetAddressProtect just fails and returns FALSE if PAGE_READWRITE or PAGE_READONLY are not set, independently of PAGE_NOCACHE | PAGE_WRITECOMBINE EDIT: to be more precise an internal function returns FALSE and causes MmSetAddressProtect to return immediately without changing anything. This can be emulated by skipping the call to VirtualProtect and not updating the permissions of the vma

jeltaqq commented 6 years ago

Description

Improve error ReprotectVMA, but has crash.

Received Exception Code 0xC0000005 @ EIP := 0x77D0DE33

Dumps

KrnlDebug.txt

Status

Previous behavior:

Crashed with * ReprotectVMA: VirtualProtect could not protect the vma! The error code was 87

Current behavior:

crashes

Screenshots

Additional Information

Tested with 735a4bcf