Why is "PlayerLoop internal function has been called recursively"?
I have a project with three scenes: MainMenu, MainGame, and Tutorial. Both MainMenu and Tutorial work, but when I do a single click in the MainGame, it crashes on a WebGL build. Here is the Chrome console output after it crashes:
Uncaught RuntimeError: memory access out of bounds
at _free (wasm-function[52951]:0x10db4ed)
at __ZN17LowLevelAllocator4FreeEPvm (wasm-function[8927]:0x2bc581)
at __ZN21UnityDefaultAllocatorI17LowLevelAllocatorE10DeallocateEPv (wasm-function[13750]:0x4d1c93)
at __ZN13MemoryManager10DeallocateEPvRK10MemLabelIdPKci (wasm-function[4779]:0x183f1c)
at __Z19free_alloc_internalPvRK10MemLabelIdPKci (wasm-function[4889]:0x18c9a0)
at __Z25UnsafeUtility_CUSTOM_FreePvN16NativeCollection9AllocatorE (wasm-function[15238]:0x56d53d)
at dynCall_vii (wasm-function[53612]:0x1104fa0)
at Object.dynCall_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:25400:38)
at invoke_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:17122:24)
at _UnsafeUtility_Free_mAC082BB03B10D20CA9E5AD7FBA33164DF2B52E89 (wasm-function[36152]:0xb7d6cb)
at dynCall_viii (wasm-function[53625]:0x11050f0)
at Object.dynCall_viii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:25465:39)
at invoke_viii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:17252:25)
at _NativeArray_1_Deallocate_mDCC2D067B158C5D81AABE2D891457F7FAE176E39_gshared (wasm-function[33558]:0xab5961)
at __Z66NativeArray_1_Deallocate_mDCC2D067B158C5D81AABE2D891457F7FAE176E39P55NativeArray_1_tB31B70F26D775FF328C22A95A8368F635AE1B3E2PK10MethodInfo (wasm-function[33560]:0xab59ac)
at dynCall_vii (wasm-function[53612]:0x1104fa0)
at Object.dynCall_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:25400:38)
at invoke_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:17122:24)
at _NativeArray_1_Dispose_mF72DABC111FD83B36731EBA316BF9FD50426160B_gshared (wasm-function[33561]:0xab5a33)
at __Z63NativeArray_1_Dispose_mF72DABC111FD83B36731EBA316BF9FD50426160BP55NativeArray_1_tB31B70F26D775FF328C22A95A8368F635AE1B3E2PK10MethodInfo (wasm-function[23197]:0x77ec4d)
at dynCall_vii (wasm-function[53612]:0x1104fa0)
at Object.dynCall_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:25400:38)
at invoke_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:17122:24)
at _SpriteShapeController_BakeCollider_m2F7DBFEB86FFD7EB4C90E81B00CD220B01C22926 (wasm-function[23219]:0x781130)
at dynCall_vii (wasm-function[53612]:0x1104fa0)
at Object.dynCall_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:25400:38)
at invoke_vii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:17122:24)
at _SpriteShapeController_OnWillRenderObject_mE46E41924A2C2ACD9EB9032A33159B1289B5FD92 (wasm-function[23217]:0x7802be)
at __Z65RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017PFvvEPK10MethodInfoPvPS4_ (wasm-function[20055]:0x6b740e)
at dynCall_iiiii (wasm-function[53510]:0x11044c3)
at Object.dynCall_iiiii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:24890:40)
at invoke_iiiii (blob:http://localhost:53849/48429baf-edde-4828-8099-f09d233647bc:16102:33)
at __ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException (wasm-function[50922]:0x1096e9c)
at _il2cpp_runtime_invoke (wasm-function[50088]:0x107dc58)
at __Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb (wasm-function[5073]:0x199a0d)
at __ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb (wasm-function[5071]:0x1997cb)
at __ZN13MonoBehaviour19HandleNotificationsEPviR11MessageData (wasm-function[14237]:0x508015)
at __ZN16MessageForwarder13HandleMessageEPviR11MessageData (wasm-function[5862]:0x1e46d8)
at __ZN10GameObject14SendMessageAnyERK17MessageIdentifierR11MessageData (wasm-function[5860]:0x1e4661)
at __ZN5Unity9Component14SendMessageAnyERK17MessageIdentifierR11MessageData (wasm-function[5859]:0x1e443e)
at __Z9CullSceneR11CullResults (wasm-function[13304]:0x4a3fbc)
at __ZN6Camera10CustomCullERK23CameraCullingParametersR11CullResultsb (wasm-function[12512]:0x43922e)
at __ZN13RenderManager13RenderCamerasEiPFvvES1_ (wasm-function[12482]:0x43445d)
at __Z12PlayerRenderb (wasm-function[12480]:0x433b43)
at __ZZ23InitPlayerLoopCallbacksvEN45PostLateUpdateFinishFrameRenderingRegistrator7ForwardEv (wasm-function[12405]:0x42ec0f)
at __Z17ExecutePlayerLoopP22NativePlayerLoopSystem (wasm-function[11914]:0x3f55c3)
at __Z17ExecutePlayerLoopP22NativePlayerLoopSystem (wasm-function[11914]:0x3f55d8)
at __Z10PlayerLoopv (wasm-function[11901]:0x3f4705)
at __ZL8MainLoopv (wasm-function[11890]:0x3f249e)
at dynCall_v (wasm-function[53587]:0x1104d26)
An abnormal situation has occurred: the PlayerLoop internal function has been called recursively. Please contact Customer Support with a sample project so that we can reproduce the problem and troubleshoot it.
Unity.Collections.LowLevel.Unsafe.UnsafeUtility:Free(Void*, Allocator)
Unity.Collections.NativeArray`1:Deallocate()
Unity.Collections.NativeArray`1:Dispose()
UnityEngine.U2D.SpriteShapeController:BakeCollider()
UnityEngine.U2D.SpriteShapeController:OnWillRenderObject()
[./Runtime/Misc/PlayerLoop.cpp line 377]
(Filename: ./Runtime/Misc/PlayerLoop.cpp Line: 377)
This won't happen when I debug the game within Unity, but when I do a WebGL Development Build (and regular Build), it will give this error. I've tracked my memory usage and I don't ever see it peek at any point. What could be causing this?
Unity: 2019.3.8f1 Build: WebGL (Dev Build) Source code: https://github.com/javaknight1/savemygrandparents
Thanks!
Answer by ravery90 · Apr 21, 2020 at 03:28 PM
So, I figured out what the problem (sorta) was. For one of my prefabs, instead of an image, I used Unity's engine to make the sprite shape. So, I took a screenshot of that and created a new sprite with the new screenshotted sprite image.
Why does this cause this? Not sure. But once I created the new prefab sprite, everything worked.
Thank you, man. Your post fixed my headache)) I just started using new 2019 version of unity, saw this new Sprite Shape and thought it would be a good idea to use it for my simple project.
Your answer
Follow this Question
Related Questions
Web GL game performance drop while hosting 0 Answers
WebGL Build don't work 0 Answers
Touch on chrome webgl Gui.Button not working 0 Answers
WebGL crash on instanitate 0 Answers
Unity 5.3.4f1 WebGL builds no longer works on Mac OSX... anyone have any ideas? 2 Answers