Random crash - Access violation - code c0000005

Hello,

I am getting the above crash randomly and i sometimes find it hard to replicate. I reduced the game to be very basic to try and narrow down the problem. I am spawning in the Scarab NPC next to the player and a weapon drop. The crash occurs very randomly. It can happen as the game starts to run, 20 seconds in or not happen at all. Scarab is doing a very basic find random point in radius, then moving to that location using AI Move to and has nothing running in its BP. As the player i am performing no actions at all not even moving the mouse. The error is as follows:

MachineId:C879FE7244FF690B3E59F79A254CE0CD
EpicAccountId:836dbd1febcb45009669ac7dd7a4f948

Access violation - code c0000005 (first/second chance not available)

UE4Editor_Engine!UActorComponent::GetOwner() + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:249]
UE4Editor_Engine!SetHitResultFromShapeAndFaceIndex() + 676 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\collision\collisionconversions.cpp:288]
UE4Editor_Engine!ConvertQueryImpactHit() + 204 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\collision\collisionconversions.cpp:358]
UE4Editor_Engine!AddSweepResults() + 229 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\collision\collisionconversions.cpp:448]
UE4Editor_Engine!GeomSweepMulti_PhysX() + 3227 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\collision\physxcollision.cpp:1407]
UE4Editor_Engine!GeomSweepMulti() + 714 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\collision\physxcollision.cpp:1442]
UE4Editor_Engine!UWorld::SweepMulti() + 188 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\collision\worldcollision.cpp:272]
UE4Editor_Engine!UKismetSystemLibrary::BoxTraceMultiForObjects() + 977 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\kismetsystemlibrary.cpp:2208]
UE4Editor_Engine!UKismetSystemLibrary::execBoxTraceMultiForObjects() + 970 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\classes\kismet\kismetsystemlibrary.h:61]
UE4Editor_CoreUObject!UFunction::Invoke() + 180 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:3684]
UE4Editor_CoreUObject!UObject::CallFunction() + 1112 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:395]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() + 141 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1451]
UE4Editor_CoreUObject!UObject::execLetBool() + 334 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1370]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UObject::CallFunction() + 2707 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:516]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UFunction::Invoke() + 180 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:3684]
UE4Editor_CoreUObject!UObject::ProcessEvent() + 3036 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:924]
UE4Editor_Engine!AActor::ProcessEvent() + 259 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:529]
UE4Editor_Engine!AActor::ReceiveTick() + 74 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\intermediate\build\win64\inc\engine\engine.generated.1.cpp:1121]
UE4Editor_Engine!AActor::Tick() + 121 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:672]
UE4Editor_Engine!APawn::Tick() + 14 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\pawn.cpp:712]
UE4Editor_Engine!AActor::TickActor() + 78 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:660]
UE4Editor_HackNSlacks_5018!AHackNSlacksCharacter::TickActor() + 61 bytes [c:\users\aie\perforce\m.gonzalez_incpcclassic\hacknslacks\source\hacknslacks\hacknslackscharacter.cpp:219]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() + 580 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:119]
UE4Editor_Engine!FTickTaskSequencer::FTickFunctionTask::DoTask() + 214 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\ticktaskmanager.cpp:322]
UE4Editor_Engine!TGraphTask::ExecuteTask() + 445 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\async\taskgraphinterfaces.h:671]
UE4Editor_Core!FTaskThread::ProcessTasks() + 3125 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\async\taskgraph.cpp:428]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() + 77 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\async\taskgraph.cpp:271]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() + 511 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\async\taskgraph.cpp:984]
UE4Editor_Engine!FTaskGraphInterface::WaitUntilTaskCompletes() + 367 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\async\taskgraphinterfaces.h:188]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() + 432 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\ticktaskmanager.cpp:187]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() + 1182 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\ticktaskmanager.cpp:722]
UE4Editor_Engine!UWorld::RunTickGroup() + 102 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\leveltick.cpp:696]
UE4Editor_Engine!UWorld::Tick() + 2971 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\leveltick.cpp:1114]
UE4Editor_UnrealEd!UEditorEngine::Tick() + 5618 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1329]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() + 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
UE4Editor!FEngineLoop::Tick() + 4179 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Attached is the saved error logs.

link text

Hi drakky,

I was able to locate your individual crash in the reports. Are you still seeing this crash occur?

Yes we are still receiving the crash

Ok, can you update to 4.7.4 and see if that fixes your crash? It looks like this particular crash hasn’t occurred since the 31st of March, and 4.7.4 had many crash and bug fixes included.

Thanks very much!

hi drakky, just checking in as I haven’t heard back from you. Also we’ve had a new update that addressed many issues and crashes, it’s 4.7.5.

Thanks!

Hey wittlief sorry for the delayed response we have been on a break. I just tried running it from a different computer and seems the crash no longer happens. Once i get back to the office on Tuesday ill try it out there. Thanks :slight_smile:

Awesome! Lemme know how it works out.

I got the error at home, and back in the office it is still happening aswell at random times. We think we have figured out what is causing the error. When our weapon is duel wield it causes the crash, and when its single it doesn’t. We are just going through it now trying to figure it out why.

Hi drakky,

Were you able to discover anything new in regards to your crash?

As of yet we havnt worked it out, but we have spent only a little time trying to find the cause as we are trying to get a few other things done aswell. I will try keep you updated in how we are going with it.

Hi drakky,

As your investigation is still ongoing, I am going to close this out as resolved on our end. If you are able to add any new info, we can re-open this issue for more assistance. Good luck!

Spent a little time debugging this issue. Still getting the error but i have narrowed down a few things. First is the crash only happens when the weapons are in view of the main camera. If it is not in view i don’t get the crash (as of yet but extensive testing on it). Second is when i disable the controller on my NPC i don’t get the crash, but they are not doing anything. At the same time i tried using the controller of other AI that are working fine but i still get the crash.

I tried remaking the NPC blueprint and reattaching everything in blueprints but still no luck.

I want to hopefully work out what the issue is by the end of the week but who knows with these things :frowning:

I also just checked through the logs and now i always get this error before the crash:

LogCharacterMovement: ScarabNPC_C_3 is stuck and failed to move!

This wasnt in the previous logs, and the past 10 crashes i looked through this was the last errors before the crash.

Call stack ends at:

UE4Editor-CoreUObject.dll!FWeakObjectPtr::IsValid(bool bEvenIfPendingKill, bool bThreadsafeTest) Line 226

In Code the last call in the call stack is:

> UE4Editor-CoreUObject.dll!FWeakObjectPtr::IsValid(bool bEvenIfPendingKill, bool bThreadsafeTest) Line 226 C++

This error mostly shows what normally is called NullPointerException somewhere where youre trying to get something like the errorlog above for example: GetOwner() or GetWorld() and and and. Try to use a “if(!GetOwner())” to filter out if the object is NULL or not. If it is , youre pointing wrong and you should use to get it by another path.

If i open VS after the editor is open and attach it to the process, the break point is different to when i run the project through VS itself. It breaks here when VS gets attached after the editor has already been open:

UE4Editor-Engine.dll!FPhysicsIntegration2D::ShutdownPhysics() Line 311 C++.

@3HMonkey going through the call stack its hard to find out where and what is causing the issue. From what i have seen everything that has been called prior has been Unreal functions.

Hi drakky,

Does this crash occur in your packaged game, or is this during play in editor mode? There’s a known issue currently in testing wherein PIE in an area near a default spawn point, or if you build level with a camera in that area causes a crash. The known issue call stack has some similarities to yours and is also related to AI.

As your crash occurs almost immediately on start near the player I am wondering if it is related/the same. Can you try spawning your scarab away from the player start and see if you get the same crash? Or moving your player start to a different area entirely?

This might be something else entirely but I’d like to rule out the known issue if at all possible.

Thanks!

This is all in editor mode.

Tried spawning away from the AI but still get the crash. I have made a weapon spawner for testing. All were on separate sides of the map

If i spawn 3-4 weapons the crash occurs 50/50, but if i spam spawn the weapon without being on screen, it doesn’t crash until i can view the weapons on screen or just before they come in view range. But the player character has to be fairly close for the crash to occur.

So it doesn’t really matter where scarab is on the level (i dropped it off the edge :D) as long as the player is close to the weapon/weapons and they are in player view (or close too), the game will crash. The more weapons, the easier it is to crash.

Note the game still doesn’t crash with any of our other 7 AI.

Thanks for your quick replies wittlief.

Try to add a nullcheck like I posted above. Add these checks to all your Get…() functions and try to find out where and when the error occurs.
So when you gonna try to get something which is NULL the access violation comes up also when ure in the wrong direction.

Everything for the scarab is done through BP’s :frowning: