Closed ExpHP closed 3 years ago
Crash is at this line: https://github.com/ExpHP/thcrap-patches/blob/44ccb4d2b1fc202d87e2e22581d08841b2da7495/patches/anm_leak/global.asm#L369
batch_num
is somehow greater than the available number of batches...ECX = 0xC2
. That seems like it's probably pretty far outside the number of batchesIn stage 1 it's happening specifically during a call to EnemyFog::Destructor
.
Likewise in stage 2.
This function gets called once (with a reasonable ANM ID) as the midboss disappears off the edge of the screen. Then the second call consistently happens about 5 seconds after that. Weird.
Comparison of Fog in first and second calls. ecx+08 is the ANM ID
I've figured it out. Uggggh.
The issue is as follows: A crash occurs (with 100% certainty) at the clear of the next chapter after a midboss in LoLK (and ONLY LoLK).
(Clearly, I did not test LoLK very well with my last update. 🤦)
Here's the cause:
EnemyFog
, with an ANM ID for a snapshot VM.My choices appear to be:
Currently, I'm looking at the runtime lists in memory and noticing something weird. (with my patch enabled, all of the snapshot VMs suddenly have fast_id = 0x1fff
even though I thought I wasn't touching them?) This is making me lean towards option 1 because, honestly.... it'd be a whole lot easier to reason about what's going on if I could just rest assured that no goofy vanilla code is running.
Edit: Never mind that last bit, I'm seeing 0x1fff
because with the ultra patch it fills the entire snapshot fast array, and the snapshot list is stored FILO. (so the fast ids are 0x1fff 0x1fff 0x1fff ... 0x1fff 0x1fff 0x1ffe 0x1ffd ... 3 2 1 0
)
forgot to close in 46edfd543b800050c8af8aa1f2e78f49fa07e45b
From Project Tojiko via email:
I requested a replay to help further investigate.