UE-8640 User crash: UDestructibleComponent::UpdateDestructibleChunkTM() update

Hi,

I know this was reported somewhere but not on this answerhub, probably on internal Epic’s mailing list where I can’t enter;)

I want to add some details to this issue, because I know how hard is to reproduce physx crashes, and even minimal info may be helpfull.

My engine version 4.7.1 compiled from sources.

Stack trace:

>	UE4Editor-Engine-Win64-Debug.dll!UDestructibleComponent::UpdateDestructibleChunkTM(TArray<physx::PxRigidActor const *,FDefaultAllocator> & ActiveActors) Line 1052	C++
 	UE4Editor-Engine-Win64-Debug.dll!FPhysScene::SyncComponentsToBodies(unsigned int SceneType) Line 795	C++
 	UE4Editor-Engine-Win64-Debug.dll!FPhysScene::EndFrame(ULineBatchComponent * InLineBatcher) Line 1009	C++
 	UE4Editor-Engine-Win64-Debug.dll!UWorld::FinishPhysicsSim() Line 203	C++
 	UE4Editor-Engine-Win64-Debug.dll!FEndPhysicsTickFunction::ExecuteTick(float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 255	C++
 	UE4Editor-Engine-Win64-Debug.dll!FTickTaskSequencer::FTickFunctionTask::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 322	C++
 	UE4Editor-Engine-Win64-Debug.dll!TGraphTask<FTickTaskSequencer::FTickFunctionTask>::ExecuteTask(TArray<FBaseGraphTask *,FDefaultAllocator> & NewTasks, ENamedThreads::Type CurrentThread) Line 669	C++
 	UE4Editor-Core-Win64-Debug.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,FDefaultAllocator> & NewTasks, ENamedThreads::Type CurrentThread) Line 301	C++
 	UE4Editor-Core-Win64-Debug.dll!FTaskThread::ProcessTasks(int QueueIndex, bool bAllowStall) Line 428	C++
 	UE4Editor-Core-Win64-Debug.dll!FTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 271	C++
 	UE4Editor-Core-Win64-Debug.dll!FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type CurrentThread) Line 940	C++
 	UE4Editor-Core-Win64-Debug.dll!FTaskGraphImplementation::WaitUntilTasksComplete(const TArray<TRefCountPtr<FGraphEvent>,TInlineAllocator<4,FDefaultAllocator> > & Tasks, ENamedThreads::Type CurrentThreadIfKnown) Line 984	C++
 	UE4Editor-Engine-Win64-Debug.dll!FTaskGraphInterface::WaitUntilTaskCompletes(const TRefCountPtr<FGraphEvent> & Task, ENamedThreads::Type CurrentThreadIfKnown) Line 188	C++
 	UE4Editor-Engine-Win64-Debug.dll!FTickTaskSequencer::ReleaseTickGroup(ETickingGroup WorldTickGroup, bool bBlockTillComplete) Line 187	C++
 	UE4Editor-Engine-Win64-Debug.dll!FTickTaskManager::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 722	C++
 	UE4Editor-Engine-Win64-Debug.dll!UWorld::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 696	C++
 	UE4Editor-Engine-Win64-Debug.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1121	C++
 	UE4Editor-Engine-Win64-Debug.dll!UGameEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 830	C++
 	UE4Editor-Win64-Debug.exe!FEngineLoop::Tick() Line 2259	C++
 	UE4Editor-Win64-Debug.exe!EngineTick() Line 52	C++
 	UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 145	C++
 	UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 191	C++

Is is crashing because user data for each ActiveActor is userData=0xdddddddddddddddd
Every RigidActor->userData is

-		ActiveActors	Num=34	TArray<physx::PxRigidActor const *,FDefaultAllocator> &
-		[0]	0x000000005aa78400 {...}	const physx::PxRigidActor *
+		physx::PxActor	{userData=0xdddddddddddddddd }	physx::PxActor

I was trying to find ActiveActors pointers in GApexModuleDestructible scenes but I can’t find them, they are probably deleted by APEX.

Whole listings for ActiveActors and destruction scenes below:

https://www.dropbox.com/s/kqktvhogedhued3/ActiveActors.txt?dl=0

Dropbox - Error - Simplify your life - scene 0 contains 5049 actors

Dropbox - Error - Simplify your life - scene 2 contains 7460 actors.

I hope this will help solve mystery around this crash, if not just close this thread.

Regards

Hi ,
don’t you see callstack in the question?
Crash logs? I don’t have them.

Hi,

Can you post your callstack and crash logs here so I can take a look? The crash logs can be found at \Unreal Projects\PROJECTNAME\saved\logs.

My apologies, I didn’t mean to type callstack. I’m quite used to asking for it immediately so it slipped my mind that it was already here! It is odd that it doesn’t produce any crash logs though. Are you able to reproduce this in a new project with no additional content?

Nope, this crash occurs once per 2 weeks in my project:)

I’m testing different solution for 2 days, so far without crash:

if (GApexModuleDestructible->owns(RigidActor))
		{
			if (const FDestructibleChunkInfo* DestructibleChunkInfo = FPhysxUserData::Get<FDestructibleChunkInfo>(RigidActor->userData))
			{
				if (DestructibleChunkInfo->OwningComponent.IsValid())

First check if GApexModuleDestructible owns this RigidActor then do rest of logic I believe it should secure crash.

And if it crash happen again or I decide that this change has impact on performance I will call:

UpdateDestructibleChunkTM

just after:

UpdateActiveTransforms(SceneType);

in void FPhysScene::ProcessPhysScene(uint32 SceneType)

Try deleting the binaries and intermediate folders from your project. After doing so, click the .uproject and generate VS project files, then attempt to build in VS. Does this build for you or does it still give you errors?

I think you are writing to wrong topic:)

Hey-

Sometimes when an error doesn’t readily reproduce in a new project as suggested trying, regenerating fresh files helps reestablish broken links between files. I do find it interesting that the callstack you posted here is slightly different from the original callstake that was reported with UE-8640. If your project is still crashing with the same error it may be helpful for us to see the project in order to investigate it directly. Would it be possible for you to upload the project to dropbox and send me a private message on the forums with a link to the project?

Cheers

Hi ,

I can’t give you my project and I don’t have small sample project with “repro”. Sorry.

Hi,

I played around with this a bit more today and was unable to reproduce the crash. Are you still seeing this in 4.7.1? Would it be possible to get more details about how you are setting up your test case?

Hi ,

Would it be possible to get more
details about how you are setting up
your test case?

Basically I’m making a game with lot of destructibles and explosions, it is really hard to reproduce this in my project once for 2 weeks :frowning:

I’m have been testing my “workaround” code described above since Apr 09, I’m unable to reproduce this crash.

I believe it may be related to some missing asynchronous apex scene locking which is improved in 4.8, so this crash may be fixed there.

You can close this question :slight_smile:

Regards