Access Violation c0000005 (first/ second chance not available)

Hey I get this error while trying to possess some pawns in a multiplayer game.

MachineId:1806E65A4B387E3A383C6383C5D3FA44
EpicAccountId:e5f0b580a4754296b924b8ab6cd82685

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

UE4Editor_Core!scalable_msize() + 44 bytes [d:\perforce\pitbull-tburnsvs2013\ue4\engine\source\thirdparty\inteltbb\inteltbb-4.0\src\tbbmalloc\frontend.cpp:2615]
UE4Editor_Core!FMallocTBB::Realloc() + 51 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\hal\malloctbb.cpp:70]
UE4Editor_Core!FHeapAllocator::ForAnyElementType::ResizeAllocation() + 37 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\containers\containerallocationpolicies.h:348]
UE4Editor_Engine!UCharacterMovementComponent::ReplicateMoveToServer() + 3145 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\charactermovementcomponent.cpp:5465]
UE4Editor_Engine!UCharacterMovementComponent::TickComponent() + 587 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\charactermovementcomponent.cpp:842]
UE4Editor_Engine!UActorComponent::ConditionalTickComponent() + 199 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:1042]
UE4Editor_Engine!FActorComponentTickFunction::ExecuteTick() + 1001 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:602]
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<FTickTaskSequencer::FTickFunctionTask>::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]

This node is in level BP and fires off whenever a player character overlaps with trigger box. It should only allow client who triggered event to reach possess nodes. Any idea what’s going on?

Hi shgs_sls,

I’ve replicated setup you’ve described, and running game in editor doesn’t crash. Are you able to create a new project with this setup and get this crash?

Please go to project’s Saved\Logs folder and and attach log for this crash. Thanks!

A wild guess:

If you have a server, you would need to let server possess pawn if you are a client. So when your branch goes into the “false” you need to run a “Run on Server” function inside your PlayerController, so he will possess character. This will also possess character for local client version.

You may try to work with pawn somewhere without checking if it is null.

If only client called “Possess” and not server, pawn might be null on server version of controller (or even on client one ,because it doesn’t have right to possess pawn?). This will cause an access violation error.

Access violation means you are trying to use a reference/pointer which isn’t filled. In compare to other variable types like int or float, a pointer can be empty and not pointing to an actor that is spawned. If you try to get information (like position or something) from pointer, and it has no value in it (for example controller has nothing possessed) you will get this error.

error is definitly coming from an empty reference/pointer, but i cause is just a guess. Though it makes a bit sense regarding your setup.

This was it! How do I make this thread [RESOLVED] ?

Rly? Haha awesome! You can only accept answers. I will go ahead and convert my comment to an answer and accept it. Feel free to reopen question if something happens related to this question.

Have a nice day (:

Thanks, you too!

So, since adding a call on server. second cast to MyCharacter fails, which is weird because I get it form getPlayerCharacter and it dosen’t possess anything until after its casted

cast will fail as long as you don’t have a Pawn possessed. Because return is NULL.

Also “GetPlayerCharacter 0” will get Character of Instance that is calling node. If Server is a listen host and has a Character possessed, it will get his Character if he calls this. And if a client calls this, it will be clients one.

To check if something is localy controlled, you don’t need to compare it with a local instance. You can call “IsLocallyControlled” on Pawns.