I encountered a save corrupting bug. And after many hours of isolating it I finally figured out what is causing this, and I can easily reproduce it on a new vanilla save with only one mod installed: USSEP. Here are the steps to reproduce.
Click New Game, wait for intro to finish and you have your hands freed. This pushes us well past stage 70 of MQ101.
Install USSEP version 4.2.2. Wait for it to finish running the retroactive scripts, which can take quite a while due to them purposefully calling wait(). Checked my Papyrus.0.log to ensure they had all finished.
Save, Exit, and update to USSEP 4.2.4b.
Now, every single time you load this save, and a subsequent save, you will see the following two entries in your Papyrus.0.log:
[05/24/2021 - 05:14:09PM] VM is thawing...
[05/24/2021 - 05:14:09PM] USSEP 4.2.3 Retroactive Updates Complete
[05/24/2021 - 05:14:09PM] USSEP 4.2.4 Retroactive Updates Complete
Every time. As Arthmoor recently said these scripts should only run once, but they clearly aren't. I figured out why. In USSEP_VersionTrackingScript we see the following code.
;Previous USLEEP script was handling tracking for both, bring over its version value if it's greater than 307, which was the last USLEEP retro script version.
;Some of the stuff in the USSEP retro scripts should not be run twice.
if( USLEEPVersionTracking.LastVersion > 307 )
LastVersion = USLEEPVersionTracking.LastVersion
if( LastVersion < 424 )
if( LastVersion < 406 )
Elseif( LastVersion < 407 )
Elseif( LastVersion < 408 )
Elseif( LastVersion < 413 )
Elseif( LastVersion < 414 )
Elseif( LastVersion < 415 )
Elseif( LastVersion < 417 )
Elseif( LastVersion < 420 )
Elseif( LastVersion < 421 )
Elseif( LastVersion < 423 )
Elseif( LastVersion < 424 )
This script is flagged to run on OnPlayerLoadGame(), which fires everytime the player loads a save. Thus everytime it loads the game, the LastVersion gets reset to the stale USLEEPVersionTracking.LastVersion, which in the case of an update from 4.2.2 this var will equal 421. Which means as the code continues it will satisfy the conditions to trigger Retro423.Process().
Which brings us to the save corrupting symptom of this simple bug. It's quite delayed. You have to save and load a vanilla game 59 times to have your save corrupted. What is happening is that Retro423.Process() was only intended to be run once, and it adds 4 entries to a Level Item. Run it 59 times though, and it ends up adding 236 entries! That's on top of vanilla's 20 entries, so 20+236 = 256. However, Leveled Items can only have 255 entries. If you add more than this via scripts, the save is corrupted. How this manifests itself is that when the game engine attempts to create a new save, you get an instant CTD. The same exception code you get from circular leveled lists, which also cause a CTD on save.
Is this a bug I should report in the tracker? Or is it perhaps possible that USSEP does not support updating from one version to the next? I attempted to report this earlier, but Arthmoor marked it "Invalid". I probably did not do a good enough job of describing things, it seems like Arthmoor thought this had something to do with ReSaver. It doesn't. It can even be reproduced in a brand new save with only one mod, USSEP. Since this issue was already closed (And props on the fast triage! I wish our team was that quick.) I figured I should open a topic and discuss it first. If folks, especially if Arthmoor, agreed it's a bug that merits fixing, then I'd open a new issue with a better description. Plus my better understanding of the problem, after working a few more hours to further isolate and reproduce.
If you guys need my full Papyrus Logs or anything let me know, I purposefully made copies every step of the way. Thanks for a great mod!