0

Mecanim Playables hard crash

mcyp 1 month ago in Melee updated by james jung 4 weeks ago 2

Hello,

we've come across a very unpleasant crash that happens in Editor but also on PlayStation4. It's a hard crash without an error and it causes the Unity Editor to completely crash and shut down without any reportable bug.

It can be reproduced on Unity 2019.4.5f but also Unity 2019.4.10f. 

What we have is a scene with a first level in which a team fight takes place. Player's companion fights against enemy NPCs with the use of Melee Combat system. The crash happens (not everytime, but with enough attempts it can be reproduced fairly regularly) when the player is looking away from the fight and then rotates the camera towards the spot where the companion fights the NPCs. Since it happens only sometimes, the crash probably occurs during a single frame.

The only thing I can say with certainty is that when the Melee Module is not used but the companion uses the same animation (through Character Gesture) as in a Melee Clip to simply swing the weapon around (which means the NPCs do NOT react - no HitReaction clip is triggered) the crash does NOT happen. 


One more thing I can include is a call stack (it is same in both the Editor and on PS4):


On PS4:

eboot.bin![Inline Function] OffsetPtr::IsNull() Line 119 C++
eboot.bin![Inline Function] OffsetPtr::Get() Line 124 C++
> eboot.bin!mecanim::ValueArrayCopy(const mecanim::ValueArray* apSourceValueArray, mecanim::ValueArray* apDestinationValueArray) Line 564 C++
eboot.bin!AnimationLayerMixerPlayable::LayerMixerProcess(AnimationPlayableEvaluationConstant* constant, AnimationPlayableEvaluationInput* input, AnimationPlayableEvaluationOutput* output, AnimationPlayableProcessFunc processFunc, AnimationLayerMixerPlayableFunc singleLayerMixerFunc, AnimationLayerMixerPlayableFunc layerMixerBeginFunc, AnimationLayerMixerPlayableMixingFunc layerMixerFunc) Line 468 + 18 bytes C++
eboot.bin!AnimationLayerMixerPlayable::ProcessAnimation(AnimationPlayableEvaluationConstant* constant, AnimationPlayableEvaluationInput* input, AnimationPlayableEvaluationOutput* output) Line 524 + 111 bytes C++
eboot.bin!AnimationMixerPlayable::ProcessAnimation(AnimationPlayableEvaluationConstant* constant, AnimationPlayableEvaluationInput* input, AnimationPlayableEvaluationOutput* output) Line 327 + 139 bytes C++
eboot.bin!`anonymous namespace'::ProcessPlayableGraph(Animator::AnimatorJob& job, AnimationPlayableEvaluationConstant& playableConstant, AnimationPlayableEvaluationInput& playableInput, AnimationPlayableEvaluationOutput& playableOutput, PreFunc preFunc, BeginFunc beginFunc, MixFunc mixFunc, EndFunc endFunc, AnimationPlayableProcessFunc processFunc) Line 169 C++
eboot.bin!Animator::ProcessAnimationsStep(Animator::AnimatorJob& job) Line 298 + 14 bytes C++
eboot.bin!UnityEngine::Animation::BlockRangeJob::Job(UnityEngine::Animation::BlockRangeJob* jobData, unsigned int index) Line 24 C++
eboot.bin!JobQueue::Exec(JobInfo* info, atomic_word tag, int count) Line 566 C++
eboot.bin!JobQueue::WaitForJobGroupID(JobGroupID groupID, enum JobQueue::JobQueueWorkStealMode workStealMode) Line 1608 + 28 bytes C++
eboot.bin!CompleteFenceInternal(JobFence& fence, enum WorkStealMode workStealMode) Line 31 C++
eboot.bin![Inline Function] SyncFence(JobFence& fence) Line 290 C++
eboot.bin!Animator::UpdateAvatars(const PlayableOutputPtrArray& outputs, bool doFKMove, bool doRetargetIKWrite, bool updateGraph) Line 1247 C++
eboot.bin!Animator::SetVisibleRenderers(bool visible) Line 2402 C++
eboot.bin![Inline Function] EventManager::InvokeEventCommon(EventManager* pEventManager, EventManager::EventIndex index, void* senderUserData, int eventType, EventManager* __formal0, EventManager::EventIndex __formal1, void* __formal2, int __formal3) Line 162 C++
eboot.bin!EventManager::InvokeEvent(EventManager::EventIndex index, void* senderUserData, int eventType) Line 135 C++
eboot.bin!Renderer::RendererBecameVisible() Line 227 C++
eboot.bin!SkinnedMeshRenderer::RendererBecameVisible() Line 1085 C++
eboot.bin!RendererScene::UpdateVisibility(const IndexList* visible) Line 486 C++
eboot.bin![Inline Function] CallbackArray2::Invoke(const IndexList* t1, const RendererCullData* t2, const IndexList* __formal0, const RendererCullData* __formal1) Line 385 + 110 bytes C++
eboot.bin![Inline Function] CullSendEvents(CullResults& results, BaseRendererArray& needsCullCallback) Line 349 C++
eboot.bin!CullScene(CullResults& results) Line 610 C++
eboot.bin!CullScriptable(const ScriptableRenderContext& context, const ScriptableCullingParameters& cullingParameters) Line 393 + 8 bytes C++
eboot.bin![Inline Function] ScriptableRenderPipeline_Bindings::Internal_Cull(ScriptableCullingParameters& parameters, const ScriptableRenderContextManaged& renderLoop, ManagedCullResults* results) Line 26 C++
eboot.bin!ScriptableRenderContext_CUSTOM_Internal_Cull_Injected(Scripting::ManagedNames::ICallType_Generated_UnityEngine_Rendering_ScriptableCullingParameters& parameters, const Scripting::ManagedNames::ICallType_Generated_UnityEngine_Rendering_ScriptableRenderContext& renderLoop, ICallType_IntPtr_Argument results) Line 51562 C++
Il2CppUserAssemblies.prx!ScriptableRenderContext_Internal_Cull_Injected_mBF4FAD3354E079A2BE20FE65B3D510EE33398B60(ScriptableCullingParameters_t6A67B80E38DC00AFE4310607B38FE65BCECAD21D* ___parameters0, ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B* ___renderLoop1, intptr_t ___results2, const RuntimeMethod* method) Line 23186 C++
Il2CppUserAssemblies.prx!ScriptableRenderContext_Internal_Cull_mFD76253744E69C86617B1CB320C206A0347269A2(ScriptableCullingParameters_t6A67B80E38DC00AFE4310607B38FE65BCECAD21D* ___parameters0, ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B ___renderLoop1, intptr_t ___results2, const RuntimeMethod* method) Line 22544 + 20 bytes C++
Il2CppUserAssemblies.prx!ScriptableRenderContext_Cull_m193842B732EFDA3A6B462A06D4B656C0551F4889(ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B* __this, ScriptableCullingParameters_t6A67B80E38DC00AFE4310607B38FE65BCECAD21D* ___parameters0, const RuntimeMethod* method) Line 23041 C++
Il2CppUserAssemblies.prx!UniversalRenderPipeline_RenderSingleCamera_m1875052AE9E91DBA9FD1FD4388C5A70BC8634EA9(ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B ___context0, CameraData_t79D7E913FDDBBC7EE49ECB379E24104E367E1340 ___cameraData1, bool ___requiresBlitToBackbuffer2, bool ___anyPostProcessingEnabled3, const RuntimeMethod* method) Line 26195 + 5 bytes C++
Il2CppUserAssemblies.prx!UniversalRenderPipeline_RenderCameraStack_m87C9FFBA9DA1E2210AB86C7A3B2BD1D655C85641(ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B ___context0, Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34* ___baseCamera1, const RuntimeMethod* method) Line 26739 + 185 bytes C++
Il2CppUserAssemblies.prx!UniversalRenderPipeline_Render_m6465592CA34215951C64EC3C88CF64BE3523DE89(struct UniversalRenderPipeline_t0A4BF1DA8675DDFDFF2B831F2BF0411BD98BA1D9* __this, ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B ___renderContext0, CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* ___cameras1, const RuntimeMethod* method) Line 25889 C++
Il2CppUserAssemblies.prx!VirtActionInvoker2::Invoke(Il2CppMethodSlot slot, RuntimeObject* obj, ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B p1, CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* p2) Line 73 + 59 bytes C++
Il2CppUserAssemblies.prx!RenderPipeline_InternalRender_m3601304F718BEEDCC63FAC61AF865392A1B97159(RenderPipeline_t3205828FC36F92006A0ABF441A6629B0D40BBB8B* __this, ScriptableRenderContext_t7A3C889E3516E8C79C1C0327D33ED9601D163A2B ___context0, CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* ___cameras1, const RuntimeMethod* method) Line 19294 + 33 bytes C++
Il2CppUserAssemblies.prx!RenderPipelineManager_DoRenderLoop_Internal_mF16D72874EE44C297C2D0623933207B448BFCD32(RenderPipelineAsset_t035BB053FBF333AF0D3351D90AD49676338BF2BC* ___pipe0, intptr_t ___loopPtr1, const RuntimeMethod* method) Line 20258 + 31 bytes C++
Il2CppUserAssemblies.prx!RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_RuntimeObject_IntPtr_t(Il2CppMethodPointer methodPointer, const RuntimeMethod* methodMetadata, void* obj, void** args) Line 44619 + 31 bytes C++
Il2CppUserAssemblies.prx!il2cpp::vm::Runtime::Invoke(const MethodInfo* method, void* obj, void** params, Il2CppException** exc) Line 545 + 44 bytes C++
Il2CppUserAssemblies.prx!il2cpp_runtime_invoke(const MethodInfo* method, void* obj, void** params, Il2CppException** exc) Line 1074 + 21 bytes C++
eboot.bin!scripting_method_invoke(ScriptingMethodPtr method, ScriptingObjectPtr object, ScriptingArguments& arguments, ScriptingExceptionPtr* exception, bool convertArgs) Line 285 C++
eboot.bin!ScriptingInvocation::Invoke(ScriptingExceptionPtr* exception, bool convertArguments) Line 273 + 5 bytes C++
eboot.bin!ScriptableRenderContext::ExtractAndExecuteRenderPipeline(const dynamic_array& cameras, PostProcessCullResults* postProcessCullResults, void* postProcessCullResultsData) Line 1178 C++
eboot.bin!RenderManager::RenderCamerasWithScriptableRenderLoop(const int displayId) Line 268 C++
eboot.bin!RenderManager::RenderCameras(const int displayId, RenderManager::PostPerCameraFunctor preImageEffectsPerCameraCall, RenderManager::PostPerCameraFunctor postImageEffectsPerCameraCall) Line 276 + 5 bytes C++
eboot.bin!PlayerRender(bool present) Line 896 C++
eboot.bin!InitPlayerLoopCallbacks::PostLateUpdateFinishFrameRenderingRegistrator::Forward() Line 1292 C++
eboot.bin!ExecutePlayerLoop(NativePlayerLoopSystem* system) Line 332 C++
eboot.bin!ExecutePlayerLoop(NativePlayerLoopSystem* system) Line 355 C++
eboot.bin!PlayerLoop() Line 434 C++
eboot.bin!UNITY_main(void* __formal0) Line 512 C++
eboot.bin!main(int argc, const char** argv) Line 918 + 5 bytes C++
eboot.bin!_start + 63 bytes C++ 

and in Editor:

========== OUTPUTTING STACK TRACE ==================

0x00007FF7D0C2262F (Unity) mecanim::ValueArrayCopy<0>
0x00007FF7D0BE7261 (Unity) AnimationLayerMixerPlayable::LayerMixerProcess
0x00007FF7D0BE7FDA (Unity) AnimationLayerMixerPlayable::ProcessAnimation
0x00007FF7D0BD1FCC (Unity) AnimationMixerPlayable::MixerProcess
0x00007FF7D0BD2B0B (Unity) AnimationMixerPlayable::ProcessAnimation
0x00007FF7D0B8820D (Unity) `anonymous namespace'::ProcessPlayableGraph
0x00007FF7D0B87DFB (Unity) Animator::ProcessAnimationsStep
0x00007FF7D0B36948 (Unity) UnityEngine::Animation::BlockRangeJob::Job
0x00007FF7D311161D (Unity) JobQueue::Exec
0x00007FF7D3111D7D (Unity) JobQueue::ExecuteJobFromHighPriorityStack
0x00007FF7D3113973 (Unity) JobQueue::ProcessJobs
0x00007FF7D311901F (Unity) JobQueue::WorkLoop
0x00007FF7D366A393 (Unity) Thread::RunThreadWrapper
0x00007FFD3FEA7BD4 (KERNEL32) BaseThreadInitThunk
0x00007FFD41E4CE51 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

Any ideas?

Unity version:
2019.4.10f
Game Creator version:
1.1.9

To add more information:

We discovered that the same thing happens even in the Melee Example scene, where the player is supposed to fight a Boss, though with slight modification - we created another character and made the Boss fight the new character, leaving the Player as an observer (and changed the Camera motor to adventure so you could rotate it around). 

When did as first mentioned - looking at the fight, looking away and then back at the fight, it is possible (after numerous attempts) to crash the entire project with the same Call stack. 

I have the same symptoms. A simple solution is to set the Animate's culling mode to Always Animate. In the melee sample, the Animate's culling mode is basically a cull update transform.


However, I think the creators should come up with a different method. I also struggled with this.