Dedicated Server Crashing if actor is destroyed and recieving tick events

So I was testing out my weapon system and the dedicated server option by default was producing some weird issues. I decided to run a true dedicated server and separate instances for each client. When doing so I had a few issues thrown at me which I fixed. However while I was shooting around and my projectiles were bouncing around my small box. All the sudden the dedicated server crashed with the below error.

As it references ticks and the only thing I currently have running ticks is the projectiles being fired I decided to investigate. Eventually I determined I could reproduce the issue by shooting off the map. When the projectile is destroyed by the garbage collector (I presume). I think I recall somewhere there being a setting for how many units below to destroy actors, but I forget where it is. The game still ticks to the projectile and causes a crash.

To fix this I put in a “is Valid” Check and a “is Actor Being Destroyed” Check. Still the tick crashes the server.

Am I missing something?

Below is the error log:

Assertion failed: Index >= 0 [File:d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\public\uobject\UObjectArray.h] [Line: 402] 



UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:421]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2117]
UE4Editor_CoreUObject!UObject::execLet() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1925]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:922]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:821]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:922]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:821]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:922]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:821]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:922]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:821]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:922]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4280]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1305]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\actor.cpp:646]
UE4Editor_Engine!AActor::ReceiveTick() [d:\build\++ue4+release-4.13+compile\sync\engine\intermediate\build\win64\ue4editor\inc\engine\engine.generated.1.cpp:2816]
UE4Editor_Engine!AActor::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\actor.cpp:844]
UE4Editor_Engine!AActor::TickActor() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\actor.cpp:831]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\actor.cpp:112]
UE4Editor_Engine!FTickFunctionTask::DoTask() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:251]
UE4Editor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:868]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:932]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:679]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:1776]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:520]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:1426]
UE4Editor_Engine!UWorld::RunTickGroup() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:706]
UE4Editor_Engine!UWorld::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1275]
UE4Editor_Engine!UGameEngine::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\gameengine.cpp:1057]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2834]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launch.cpp:156]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Hey ,

Can you show me what you are doing with your Projectile? Or, any information that you can give me so I can attempt to recreate your issue in order to bug it.

Thanks

Do Event Tick is a function I’ve kept playing with to attempt to fix the issue. I’ve also created a killz volume around the map and had the level destroy any actor that overlaps it. Which is working fine. But is still producing the same issue. Though it happens much less often. Prior as soon as any bullet hit the built in killz the dedicated server would crash. Now it takes a while for it to crash.

The error tracks down to
[2016.09.20-03.47.35:772][177]LogWindows:Error: Assertion failed: Index >= 0 [File:d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\public\uobject\UObjectArray.h] [Line: 402]

Script Stack:
PhysicsBulletBase_C.HandleDrag
PhysicsBulletBase_C.ExecuteUbergraph_PhysicsBulletBase
PhysicsBulletBase_C.ReceiveTick
223_Round_C.ExecuteUbergraph_223_Round
223_Round_C.ReceiveTick

223_Round is a simple child, Calls it’s default parent functions and has a single variable changed which is used to generate the bullet data upon construction. Other than that variable controlling the other variables from a table. All images are from PhysicsBulletBase.

I’m not a C++ Programmer but I am a programmer. So unfortunately the error report doesn’t mean a lot to me =(

Attached is the full log error from start to finish (Where the error outputs and crashes the server)[link text][4].

I’m running the following multiplayer options in the editor:

  • Number of Players: 2
  • Run Dedicated Server: true
  • Editor Multiplayer Mode: Play as Client

Everything else is default.

Oh and single instance is off.

There is nothing apparent that explains the crash. Can you show me what “223_Round” is?

Thanks

Like I said 223_Round is simply a child blueprint that I just change one variable in to give it different bullet properties.

But beyond anything that is in my blueprint the error clearly shows an event tick happening after the actor is destroyed. Which causes an error and thus a crash.

Come to think of it though, as the child blueprint has to call the parent scripts I put the do tick check in the child and it still did the same.

Should also be mentioned only the dedicated server and the additional client crash, play in editor has no issues.

Hey ,

So I have tried to reproduce the issue you are describing but cannot. Here is what I setup:

I essentially mark the projectile as “destroyed” with a boolean just before destroying it and then in the tick function of the projectile, if it is the dedicated server and that boolean was set to true, print out a string.

I haven’t seen this happen with probably 5000 projectile fired in testing.

Please let me know if you have anymore information on how I can reproduce this.

Thanks.

The issue as the logs show is in the handle drag function. I presume as the error has to do with an index of some sort that it has to do with the references to the projectile movement component or to variables themselves. The bullet never destroys itself currently. I hadn’t gotten that far. What is destroying it is a KillZ box.

The error always happens in the handle drag function. Though adding the checked to see if it was valid or not reduced the chance of the crash but it still happens.

Though I don’t believe this would have anything to do with it but here is how the firing goes:
Character input to fire.
Weapon receives character input to fire.
Weapon sends server command to create projectile.
Server calculates projectile spawn and trajectory.
Projectile is spawned by the server.

As a new test I went back to the original projectile and tested it as well. The original one was not multiplayer ready. In the editor session nothing happens. All works fine. But in the additional client windows they eventually kill out at the same point referencing the same error.

After more testing with both the original and the networked projectile it seems to be an issue caused by the “Use Single Process” Setting in the multiplayer options (advanced). Also Editor Multiplayer Mode is set to “Play as Client”. When checked on as it reads: “Spawn multiple player windows in a single instance of UE4. This will load much faster, but has the potential to have more issues.” I turned it off.

When off it produces the issue. When on it does not produce the issue. With that said I sorta want to build the game and the dedicated server and run it. But that should mimic the same issue I’m seeing now. Though I’m not in the code or UI yet to have that work yet.

As a cliff note try these settings in addition to what you described before:

  • [Editor Multiplayer Mode] “Play as Client”
  • [Use Single Process] false

Just ran a test where I shot 2500 projectiles in a row with those settings and didn’t have any issue.

In situations like this where I am having a difficult time reproducing the issue, we sometimes ask if you want to send the project over so I can have the same setup as you to reproduce the issue. If you are able to do this, you can send me a private message on the forums with the link, or if you dont care if other people have it, post it here. It’s up to you.

For now, there isn’t much more I can do to help other than say make sure your HandleDrag function is checked again for anything that may cause the issue.

I’ve sent a PM on the forums.

Hey ,

I believe the root of the issue relies on the market place asset you are using and not the engine. While debugging, there is a lot of logs warning you against trying to get a square root of a number less than 0 as well as a lot of trying to divide by zero.

Before we can consider it a bug, you need to clean up all of these errors.

I’ve already cleaned up those errors in my version. The error continues to persist. That error is also not related to the Handle Drag function. Those errors are part of the GetNewSpeed function. Like I said I already fixed them in my version.

The package that I sent you previously has been updated to reflect the fixes for those errors. Which still produces the issue in question. However now there are no other errors and/or warnings being produced.

Thanks for the feedback. The issue has been logged. You can follow it as it moves through the development staff, here:

https://issues.unrealengine.com/issue/UE-36378t