RuntimeError: index out of bounds

Hello everyone!

Every now and again I get the following error on the WebGL build of my project:

The stack trace is not of much help to me since it contains “locations” like

and I am a bit at a loss about how to narrow down the search for the problem.

The second line in the stacktrace mentions _DownloadHandler_get_text which I assume refers to the DownloadHandlers text property, but it doesn’t really help me find the cause of the problem.

If anybody has any tipps on how to narrow down the search, I would greatly appreciate it.

More details in case they help

The project uses Mirror for networking, and the szene contains triangles which move to mouse click positions. It seems that the error occurs after such a click. The problem is not really common, but not rare either, but I could not find a way to reproduce it yet. The WebGL build is a development build.

Thanks in advance and best regards,
Patrick

1 Like

If you are using latest Unity version, can you try reporting the issue as a bug?

Hello jukka_j!

Thanks for your answer. I was using Unity 2020.1.13f, I updated to 2020.2.5f and will submit the bugreport when it happens again.

Is there anything I could look out for in the meantime, to help reproduce the issue?

Best regards,
Patrick

Unfortunately there is not much to go on here in terms of suggesting guidance on how to reproduce. If you have the full callstack next time it happens and can print it out here, that might help figure out what the flow is that causes it, and then try stressing that path in more ways.

Hello jukka_j!

Sorry for my delayed reply, I was away from Unity development and the forum for a while because of some private issues.

The error did not pop up recently, but I still have the stack trace from before if it helps:

Stacktrace

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
RuntimeError: index out of bounds
__ZN16VirtFuncInvoker0IP8String_tE6InvokeEtP12Il2CppObject@https://test.tld/Build/webgl.wasm:wasm-function[30768]:0xcae257
_DownloadHandler_get_text_mD89D7125640800A8F5C4B9401C080C405953828A@https://test.tld/Build/webgl.wasm:wasm-function[60341]:0x129eb95
_Logger_LogResponse_m69B0BC4961D61880DE3D943E03EB60792E444643@https://test.tld/Build/webgl.wasm:wasm-function[60025]:0x128e52b
dynCall_vii@https://test.tld/Build/webgl.wasm:wasm-function[68438]:0x13c8ac3
unityFramework/Module.dynCall_vii@https://test.tld/Build/webgl.framework.js:27995:38
invoke_vii@https://test.tld/Build/webgl.framework.js:19089:10
_U3CSendRequestEnumeratorU3Ed__19_MoveNext_m568AFCF73D2F83A8B1B2086CD4A5ED55A71BE316@https://test.tld/Build/webgl.wasm:wasm-function[32441]:0xd1e2d1
__ZN21InterfaceFuncInvoker0IbE6InvokeEtP11Il2CppClassP12Il2CppObject@https://test.tld/Build/webgl.wasm:wasm-function[30775]:0xcae6fe
_SetupCoroutine_InvokeMoveNext_m036E6EE8C2A4D2DAA957D5702F1A3CA51313F2C7@https://test.tld/Build/webgl.wasm:wasm-function[46333]:0xf80bbc
_Z164RuntimeInvoker_FalseVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5_VoidU2A_tC7FFEB695C165BD92A8656A0260E9CBC93892D9A_Int32_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046PFvvEPK10MethodInfoPvPS4@https://test.tld/Build/webgl.wasm:wasm-function[29022]:0xc7e74d
dynCall_iiiii@https://test.tld/Build/webgl.wasm:wasm-function[68326]:0x13c7e72
unityFramework/Module.dynCall_iiiii@https://test.tld/Build/webgl.framework.js:27435:40
invoke_iiiii@https://test.tld/Build/webgl.framework.js:17969:17
__ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException@https://test.tld/Build/webgl.wasm:wasm-function[62368]:0x12dad4c
_il2cpp_runtime_invoke@https://test.tld/Build/webgl.wasm:wasm-function[61306]:0x12b964b
__Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb@https://test.tld/Build/webgl.wasm:wasm-function[6387]:0x250752
__ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb@https://test.tld/Build/webgl.wasm:wasm-function[6385]:0x250515
__ZN9Coroutine14InvokeMoveNextEP21ScriptingExceptionPtr@https://test.tld/Build/webgl.wasm:wasm-function[10751]:0x3b8a25
__ZN9Coroutine3RunEPb@https://test.tld/Build/webgl.wasm:wasm-function[10748]:0x3b86fa
__ZN9Coroutine17ContinueCoroutineEP6ObjectPv@https://test.tld/Build/webgl.wasm:wasm-function[10754]:0x3b8c4f
__ZN14AsyncOperation15InvokeCoroutineEv@https://test.tld/Build/webgl.wasm:wasm-function[11790]:0x41e9aa
__ZN29UnityWebRequestAsyncOperation15InvokeCoroutineEv@https://test.tld/Build/webgl.wasm:wasm-function[28442]:0xc71453
_ZN20UnityWebRequestProtoI24UnityWebRequestTransport16AtomicRefCounter14RedirectHelper14ResponseHelper15DownloadHandler13UploadHandler18CertificateHandler12HeaderHelper14AsyncOperationE19Job_InvokeCoroutineEPS8@https://test.tld/Build/webgl.wasm:wasm-function[28414]:0xc7022e
__ZN18BackgroundJobQueue21ExecuteMainThreadJobsEv@https://test.tld/Build/webgl.wasm:wasm-function[13520]:0x4bbe7e
__ZZ23InitPlayerLoopCallbacksvEN43EarlyUpdateExecuteMainThreadJobsRegistrator7ForwardEv@https://test.tld/Build/webgl.wasm:wasm-function[13668]:0x4d01f0
__Z17ExecutePlayerLoopP22NativePlayerLoopSystem@https://test.tld/Build/webgl.wasm:wasm-function[13187]:0x496017
__Z17ExecutePlayerLoopP22NativePlayerLoopSystem@https://test.tld/Build/webgl.wasm:wasm-function[13187]:0x49602c
__Z10PlayerLoopv@https://test.tld/Build/webgl.wasm:wasm-function[13172]:0x495022
__ZL8MainLoopv@https://test.tld/Build/webgl.wasm:wasm-function[13160]:0x493176
__Z28MainLoopUpdateFromBackgroundPv@https://test.tld/Build/webgl.wasm:wasm-function[13506]:0x4ba8cb
dynCall_vi@https://test.tld/Build/webgl.wasm:wasm-function[68405]:0x13c8708
unityFramework/Module.dynCall_vi@https://test.tld/Build/webgl.framework.js:27830:37
dynCall@https://test.tld/Build/webgl.framework.js:374:35
dynCall_wrapper@https://test.tld/Build/webgl.framework.js:357:12
wrapper@https://test.tld/Build/webgl.framework.js:3586:29
safeSetInterval/<@https://test.tld/Build/webgl.framework.js:10493:5

Thank you kindly for your answers and your support!

Best regards,
Patrick

This issue does look like something we would need a bug report about. Any chance you’d be able to submit a bug report with a test case?

There is one issue related to garbage collection that I recall was fixed not that long ago, that would occassionally throw a crash in coroutines. The fix should be available in the latest point releases. You might try updating to the latest point release if you aren’t already, and see if that might affect the issue.

Hello jukka_j!

If I can reproduce it again, I will file a bugreport with the issue. Thanks for looking into this!

Best regards,
Patrick

Hey guys, I get this issue from a default URP build. I always thought WebGL was just broken for a couple of years now. Everytime I use it, I get similar errors.