Jump to content

Recommended Posts

View File

Made a plugin to help try and fix some of the crashes I've been seeing in http://www.loverslab.com/topic/46913-how-to-debug-ctd/. You can turn each individual fix on / off in the SKSE/Plugins/CrashFixPlugin.ini, default settings recommended but if you have problems with something and you know what you're doing you can change. If you want to see exactly what crashes are fixed (with addresses) and a small explanation of my best understanding of the crash then check the INI file or readme on the nexus mod page.

 

This plugin is meant to fix some common crashes AFTER you have followed STEP guides and sensible modding rules! It does not fix problems that come from modding irresponsibly or conflicts between mods.

 

How to use the memory allocator patch?
1. Open CrashFixPlugin.ini and find "UseOSAllocators=0"
2. Change it to "UseOSAllocators=1"
3. Download and install SKSE Plugin Preloader
4. Start game, if you get an error saying that memory patch could not be applied read the message for help, otherwise you're good to go.
(5.) Causes game to crash and you use ENB? Set ExpandSystemMemoryX64=false in enblocal.ini
(6.) Causes game to crash more frequently (especially with UNP RaceMenu sliders)? Try AlignHeapAllocate=1 in CrashFixPlugin.ini

 

Tips for additional stability:
(These are things I've observed and Not 100% fact!)

 

If you don't have some lines listed below in your INI it means they are set to default value.

 

Data/SKSE/SKSE.ini (not needed if UseOSAllocators=1 in CrashFixPlugin.ini):

  • Set DefaultHeapInitialAllocMB:Memory to 768. If you are using a lot of mods or higher uGrid than 5 then set 1024. Helps with CTD during save load, especially if you can load the save after qasmoke. Max value is 1280. If you are using ENB you may get CTD on startup with higher value than 768 and ExpandSystemMemoryX64 true in enblocal.ini!
  • Set ScrapHeapSizeMB:Memory to 256. Game can't use more than 256 of this and setting higher serves no purpose.

Skyrim.ini:

  • uExterior Cell Buffer:General - setting this too high causes crashes more, especially when game wants to unload many cells at once. If you set 0 or just remove it from your INI then game decides this and that's the best way.
  • bPreemptivelyUnloadCells:General - setting this 1 will mean game purges cell buffers and unload cell whenever it is possible. Default is 0 which means keep cell in memory until we need the space for other cells. I find 0 to be better, there's no reason to unload cell immediately, the buffer was implemented for a reason.
  • fPostLoadUpdateTimeMS:Papyrus - setting higher will cause longer loading. Mine is 500, seems to work well for me. You can try 750 or even 1000+ if you have a lot of script-heavy mods.
  • fUpdateBudgetMS:Papyrus - remove (this sets to default 1.2). If you have a lot of script heavy mods and a good PC you can set higher for example 2.0, however this can reduce your FPS when a lot of things are happening.
  • fExtraTaskletBudgetMS:Papyrus - remove (this sets to default 1.2). See above.
  • bEnableLogging:Papyrus - set 0. There's no reason to log papyrus unless you are developing a mod. Writing to file constantly is not good for performance. Papyrus logs have nothing to do with finding causes for crashes, although you can use this to find misbehaving mod scripts which can be helpful, I'd recommend to disable it for normal gameplay though.
  • bEnableTrace:Papyrus - set 0. See above.
  • Any other papyrus setting - delete. Changing the papyrus from default will just cause instability or lagged scripts.
  • iPresentInterval:Display - VSync enabled or disabled. You shouldn't need to change this as default value is 1 and that's good.

Safety Load (not needed if UseOSAllocators=1 in CrashFixPlugin.ini):
Install Safety Load if you have a infinite loading screen or freeze at any point. It fixes a bug in memory allocation that causes deadlock. Yes you still need this if you have SKSE memory patch, no they don't do the same thing. SKSE memory patch hides the problem of deadlock for longer because it allocates a larger memory block. If you don't have freeze or infinite loading screen at all then you don't need this!

 


Stable uGridsToLoad:
Don't use this. It causes memory corruption and does nothing unless you are changing your uGridsToLoad setting in INI often (I don't know why you would).

 

ENB:
I'm not an expert in ENB, but these two I recommend in enblocal.ini:
ExpandSystemMemoryX64=false
ReduceSystemMemoryUsage=true

 

Bashed Patch:
You should make this. It helps resolve a lot of conflicts between mods, especially related to leveled lists which can be a big problem. If there are no conflicts this doesn't really do any harm but even a small mod list usually has some.

 

LOOT:
LOOT can be a good tool to help resolve issues with ordering, but it is not perfect, sometimes it places mods incorrectly, use your best judgement. LOOT can also warn you about other potential problems with mods.

 

TES5Edit cleaning:
Do this! LOOT can tell you which mods need cleaning.

 

Playthrough:
Don't install or uninstall mods (with ESP files) in the middle of playthrough. Even changing the order can be very bad, especially if you use bashed patch or anything with SkyProc (requiem, perkus maximus). This of course applies to ESP files! Graphics mods and pure SKSE plugins are fine most of the time.

 

Common issues:

 

UseOSAllocators=1 and crashing when touching sliders in character creation or otherwise.
Set AlignHeapAllocate=1 in CrashFixPlugin.ini, downside is increased load time and increased memory usage.

 

UseOSAllocators=1 and crashing on game startup or loading save or shortly after.
Set ExpandSystemMemoryX64=false in enblocal.ini

 

Game says message box "running out of memory" and crashes.
Set ReduceSystemMemoryUsage=true in enblocal.ini

 

Ground textures flickering weird.
Set ExpandSystemMemoryX64=false in enblocal.ini

 

Changelog
12 - 28/08/2016

  • Errors or warnings from Crash Fixes is now also logged to file - enabled by default. The file appears in Data/SKSE/Plugins/CrashFixPluginLog.txt
  • Added automatic crash dump analysis, disabled by default. It creates files in Data/SKSE/Plugins/CrashLog/crash_timestamp.txt
  • Warn user if they have bad ENB settings on startup.
  • Added a crash fix related to Enderal.
  • Added a crash fix related to magic effects list.
  • Skyrim will display warning if actor has unexpectedly NULL TESCombatStyle form. It tries to display the actor form ID so you can check it out yourself.
  • Changed a bit how the corrupt NIF crash is detected, it might help avoid some false positives.


11 - 29/06/2016

  • Added a message to help track down crashes that may be caused by a corrupted NIF.
  • Changed how the message boxes are displayed if Crash Fixes wants to display a message. Maybe it helps a bit with the problem where message goes behind the game's screen and can't see it? Report in comments, for me it works. Also the message boxes from this mod now clearly say they are from this mod.
  • Added couple more null pointer check patches.
  • Added a message when failed to allocate a texture, usually because of running out of VRAM.
  • Added a custom implementation of block allocator for very small allocations. This may help reduce fragmentation but does not eliminate it. Disabled by default. Read the INI for more information.

10 - 21/05/2016

9 - 20/05/2016

  • Fixed actor value fix not working.
  • Added fix to manually patch movaps when AlignHeapAllocate is disabled.
  • Removed one option that didn't do anything in the end.
  • Extended one magic effect projectile fix to apply to all uses of that function.
  • Fixed save game string count 65536 fix didn't work completely.
  • AlignHeapAllocate fix is now disabled by default, too many people didn't like the downside of longer loading and more memory usage.
  • Added option to completely disable Skyrim's memory allocation system and use regular C malloc. Currently not possible to enable since I don't have permission to upload the modified skse_steam_loader.dll

8 - 03/05/2016

  • Added fix for more than 65535 strings in save game.
  • Added warning message if your SKSE memory patch is not active.

7 - 28/04/2016

  • Added 2 more fixes.
  • Added 1 more crash with message about what may be causing it.

6 - 25/01/2016

  • Adjusted StrCmp fix, should detect crash better.
  • Added 2 more error messages when specific crashes happen to let user know what they could try.
  • Tried to make INI explanations a little bit better.

5 - 20/01/2016

  • Added 2 more possible fixes. See last 2 entries of INI file or readme.

4 - 17/01/2016

  • Fixed another crash related to memory alignment. See last INI entry for details.

3 - 10/01/2016

  • Adjusted memory alignment fix code a bit.
  • Added 1 more possible fix reported in how to debug thread.

2 - 05/01/2016

  • Removed all the deadlock stuff.

 

 

Check out my other mod Bug fixes.


  • Submitter
  • Submitted
    01/04/2016
  • Category
  • Requires
  • Special Edition Compatible

 

Link to comment

Interesting. Will give it a try and let you know. Curious if maybe it could have  a negative effect long term on a save though, maybe sometimes better to crash than not and end up baking something that's now broken into your save file.

 

Does it output to a log anywhere when it's fixes are triggered? Would be nice to know if/when it's actually doing something; rather than just a general "I haven't crashed in a while" feeling that may or may not be related to using it.

Link to comment

It's possible, can never tell with Skyrim. I just made this today so I haven't had time to test its long time effects.

 

About the log, I can't really tell for sure with the deadlock stuff if it prevented freeze or not and many of the fixes actually come from changing how memory is aligned so there's no log. I could add a log to some of the more direct stuff though.

 

INI file has descriptions of the things it does. And you can turn each on / off. I don't know how to explain better than what's in there.

 

Edit: added source code. If you have questions about some particular change then ask.

Link to comment

Updated, removed all the dead lock stuff. Use safety load instead, it handles the same problem except way better and correctly instead of what I did. With safety load and this mod I couldn't get the game to crash on Ugrid 15 and flew all the way to Riften with uGrid 17 before it crashed.

 

Edit: got into game with uGrid 19. :D

Link to comment

Will it help with the "pure virtual function call" ctd, sometimes occurs when starting sexlab scenes?

 

Had this crash just now and investigated a bit (it was at end of scene for me), it had something to do with actor's movement controller but I couldn't get a lot of info. I'll try if I can get it to happen again.

Link to comment

So decided to have a go with this because..... (well just because).

 

Anyway is the 'This save is corrupt' message box, with a nice clean back to main menu functionality, something this mod introduced? (Because if so it's totally worth the price of entry. If not - and I've never seen that message before - it obviously fixed something. Normally crappy saves just CTD. Oh, and yes the save was corrupt because it crashed save tool, but at least it means I won't have to reload the sodding game again in the future on a crapped out save).

Link to comment

No it's not from my mod, you have something different going on there. Maybe Skyrim has this built in, I've never seen it either :P

 

Nope, I don't think I had anything else going on. Just loaded this for a more prolonged evaluation. (i.e. just the normal, play, save, play, load, etc, play CTD, load, oh! that last save was bolloxed thing).

 

So Interesting. (You might be probably, unintentionally in effect, "beating the fuck out of the wings of the butterfly with nuclear weapons")

Link to comment

I've been using version 1 of this since yesterday and so far so good.  Just upping to V2 now and installing SL1.61 that just came out.

 

Regarding Safety Load, I thought that plugin was replaced by patches added to recent versions of SKSE?

Link to comment

I thought the same because everyone said so but it's not. I checked the source code of Safety Load and it does something completely different, it fixes a bug in memory allocation that causes deadlocks, SKSE changes the heap sizes that are allocated, completely different thing. Maybe people are confused because SKSE replaces the sheson's memory patch and they confused it with Safety Load?

 

TLDR: Safety Load is mandatory still, nothing replaced it.

Link to comment

I thought the same because everyone said so but it's not. I checked the source code of Safety Load and it does something completely different, it fixes a bug in memory allocation that causes deadlocks, SKSE changes the heap sizes that are allocated, completely different thing. Maybe people are confused because SKSE replaces the sheson's memory patch and they confused it with Safety Load?

 

TLDR: Safety Load is mandatory still, nothing replaced it.

 

Post on Reddit about SKSE and safety-load that says what your saying that they don't do exactly the same thing. I have no idea if this is accurate or not, but put it out there for the discussion at hand. I know your programmer so you know way more than I do on the subject.

 

Some comments from that post....

 

"Safety Load doesn't do exactly the same thing as SKSE, so if you are running SKSE, memory blocks log says it's working correctly and you aren't running out of memory, but you still get ILS, it may be worth installing. I don't know of anyone with this issue though.

SKSE increases the size of the memory blocks so you don't run out of memory while loading.

Safety Load makes it so not as many objects have to load while on load screen/the game doesn't sit there and wait for objects to load when you don't have the memory to load them."

 

If you get ILS - install Safety Load

If you don't get ILS - don't install Safety Load

There's no reason to install it if you aren't experiencing ILS (which, for 95% of people, is solved by SKSE)

 

In the DynDOLOD FAQ and discussion thread Sheson repeatedly says to remove it. Must be something to it then.

 

Hope this helps and keep up the good work on the crash dump analysis, could be very helpful for this and future beth games.

 

Link to comment

I have SKSE memory patch with ENBoost and I still have ILS sometimes, but after installing Safety Load v1.2 I don't have that problem, also my game seem more stable even during normal gameplay, so Safety Load must be doing something else beside fixing ILS bugs (maybe that's why we have option in Safety Load.ini file to use it only for ILS).

Link to comment

I've been experiencing freezes recently, for no apparent reason. Most of the time it happens while moving fast, while sprinting on horseback or while using the sprint shout. As my uGrid is 5, doubt this would help me, is there anything else I can do in order to find out root of the issue?

 

My current SKSE.INI settings:

 

DefaultHeapInitialAllocMB=768

ScrapHeapSizeMB=512

 

The defaults below seem to make it worse.

 

DefaultHeapInitialAllocMB=512

ScrapHeapSizeMB=256

 

SoS Full, Wet & Cold, SexLab Aroused, Predator Vision are of course the usual suspects. One of them is most likely the culprit.

Link to comment

So Safety Load can be used along with The SKSE memory patch and Enboost without problems?  I thought it was always 'use one or the other.'  is that not true?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use