Frequent Crashes With "EXCEPTION_ACCESS_VIOLATION"

Getting a ton of crashes with this error log:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff

UE4Editor_CoreUObject 
UE4Editor_CoreUObject 
UE4Editor_Core 
UE4Editor_Core 
UE4Editor_Core 
UE4Editor_Core 
UE4Editor_Core 
kernel32 
ntdll

It’s all blueprints and I have no clue where it’s really coming from. It often happens when I start or stop PIE but it also happens at other times and the error is so vague so it’s been tough to track down. Anyone got any ideas?

Hi NineDGuy

Could you post the full log trace, please?

You can find logs in [ProjectName]/Saved/Logs.

Thanks

Alex

Here’s a log that was generated from a crash I just got found at /Saved/Crashes/(Crash) though it seems to just end abruptly after some (unrelated) debug prints I have in.

And here’s what I found at the address you gave

Update: I’ve narrowed down that it’s likely a dispatcher issue. That’s what I suspected in the first place but a few other threads seem to confirm it, notably this one.

I’m unsubscribing my dispatchers properly in Destruct/ReceiveDestroy/ReceiveEndPlay but I guess something isn’t actually being unsubbed? I go through and unsub each event that’s been subscribed to a dispatcher then I unscribe all events from each of the current object’s dispatchers. Not sure if I should be doing something differently?

Here’s the relevant part of the crash in the log. The TaskGraphThread varies between BP and NP and the number changes but the rest is always the same.

LogThreadingWindows: Error: Runnable thread TaskGraphThreadBP 25 crashed.
LogWindows: Error: === Critical error: ===
LogWindows: Error: 
LogWindows: Error: Fatal error!
LogWindows: Error: 
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
LogWindows: Error: 
LogWindows: Error: [Callstack] 0x00007ffbd2416896 UE4Editor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd225a2a5 UE4Editor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd2228e38 UE4Editor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd222fd91 UE4Editor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbcf14931a UE4Editor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbcf14a40d UE4Editor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbcf15254b UE4Editor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbcf5c32ef UE4Editor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbcf5c2f94 UE4Editor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc57197c24 KERNEL32.DLL!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc5736d4d1 ntdll.dll!UnknownFunction []
LogWindows: Error: 
LogWindows: Error: Crash in runnable thread TaskGraphThreadBP 25

Update 2: So now I’ve got a completely new theory. I’ve tracked it to the function I have bound to “OnGenerateWidget” on my combo box. For some reason unbinding it seems to make things run fine but the second that function is bound I get periodic crashes again (whether or not I interact with it).

Nothing seems immediately off with the function or the widget content that I’m using but that’s definitely the source of it.

Weeks from first finding this, finally figured it out! The spawnactor/createwidget nodes don’t update properly when you change variable types from a struct to a different type of struct which allows for mismatched types and then causes crashing when trying to actually access the values they contain.

Just submitted a bug ticket and I’ll mirror it here for anyone else that might run into this.

Issue:
SpawnActor / CreateWidget nodes don’t update allowing for mismatched types if they’re structs (causing frequent, seemingly unrelated crashes)

Repro:

  1. Create a BP actor called that will be spawned (a)

  2. Create a BP actor that will spawn (b)

  3. Create a variable of any type (c) on (a) and set it to expose on spawn (and instance editable)

  4. In (b), create a spawn actor node and set it to spawn type (a)

  5. Create a struct variable of type (c) and plug it into the spawn node to fill that variable on spawned actor (a)

  6. Go back to the blueprint for (a) and change that variable’s type to any other struct then compile

  7. Return to the blueprint for (b), you will now have a mismatched type of struct variable being plugged into the spawn node for (a)

7.1 If the spawn actor node isn’t updating to reflect the change, sometimes adding an extra variable on (a) will cause it to fully update. Regardless, you still have a mismatched type.

I first encountered this following a similar process with CreateWidget but in trying to repro I noticed it works the same with SpawnActor.

Results:
Mismatched type is accepted.

Expected:
Compile error with a red connection the way changed/mismatched variable types are usually handled.

Description:
In my case (doing this with widgets) I got frequent crashes documented in this thread. They would occur whether or not the widget was directly interacted with after a variable amount of time, sometimes on starting PIE, and sometimes on ending PIE.

Particularly nefarious because without a compile error, with delayed onset, and with an editor-level crash the actual issue wasn’t really traceable. Ended up just removing things piece by piece from my scene until I found the problem BP and then removing things from that piece by piece until I found the problem node.