Closed barotto closed 5 months ago
Not encountered yet on v0.17. Closing for now.
It's back. Apparently the EIP register is restored with a wrong value (a small offset from the correct one).
The state of the CPU is not entirely saved into a savestate file, specifically the decoded data of the previously executed instruction. If the state is saved during the execution of an instruction with a REP prefix, after a restore the repeated instruction must be decoded again. This can't be done correctly without resetting the prefetch queue (which is currently not done hence the crash of the running guest program). Unfortunately resetting the prefetch queue can potentially break programs with self modifying code.
In some (still unknown) circumstances, overwriting a slot results in a corrupted savestate.
Noticed during testing Windows 3.1 in 386 mode. Trying to load the savestate ends in Windows crashing to the DOS prompt. Hard to replicate (not even sure it's specific to overwriting a slot.)
Cause finally determined. It's not savestate corruption. See below.