WebGL - RuntimeError: index out of bounds

Hi,

I am relatively new to Unity but have done enough to get a project running happily with a windows build. I’ve now switched to WebGL and not only does it take 25 minutes to do a build but at the end I get the following error:

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

exception thrown: RuntimeError: index out of bounds,_ZN16VirtFuncInvoker1IP54JsonContract_tCE7553F62CB1EEE2300A18884423B047DC37B545P6Type_tE6InvokeEtP12Il2CppObjectS3@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[23216]:0x92c7c7
_LightLambda_MakeRunDelegateCtor_mB6E6BAEB27F7705C0BAB1EFD54EE3EA280A1A69F@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[57564]:0xf62fd0
dynCall_iii@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[70951]:0x124a721
unityFramework/Module.dynCall_iii@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.framework.js:25561:38
invoke_iii@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.framework.js:16415:17
_LightLambda_GetRunDelegateCtor_mA841316E5CC120E42A5D0E0CEB3E7B93D76C9B67@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[57556]:0xf62151
_LightLambda_MakeDelegate_mCB81E1A383A6CD5B1EA863901ACCDB1C74411096@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[57555]:0xf61f68
_LightDelegateCreator_CreateDelegate_m73E62449D8D5D977983994B21CBFFF6E7FA1F3EA@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[57553]:0xf61ef9
_LightDelegateCreator_CreateDelegate_m048F0096129EAF532301C21F0BEE45E16C446E54@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[57552]:0xf61ea7
_LambdaExpression_Compile_mEE1F1656478AA473C869C5709FB368ED97EBD343@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[40863]:0xc3fe19
_LambdaExpression_Compile_m048FA82F0A218295A345F878FB5D0AB390F02BE6@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[40862]:0xc3fdce
dynCall_iii@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.wasm:wasm-function[70951]:0x124a721
unityFramework/Module.dynCall_iii@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.framework.js:25561:38
invoke_iii@file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.framework.js:16415:17

etc…

I’m using Unity 2020.1.2f1 and firefox for my test. It may be related to the fact I’m using Templates as if I do a simple hello world popup it seems to work when calling javascript from a c# script but as soon as I do some real code like calling Socket.IO from C# then I get the above error. The problem is that I can’t see any clue as to what the problem is and like I said it works in Windows mode.

Any help on making some sense of the error would be great.

Thanks

Matt

These errors are at the bottom. I’ve messaged support as it suggests but received an automated reply saying there’s currently a 10 day response time.

Uncaught RuntimeError: index out of bounds
dynCall_iii file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.framework.js:25561
invoke_iii file:///C:/Xyndata/Matt/Builds/WebGL/Build/WebGL.framework.js:16415

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.
(Filename: ./Runtime/Misc/PlayerLoop.cpp Line: 377)

It would seem the issue is that I’m using a Restful service Asset with async calls. Apparently WebGL is single threaded. Going through and converting everything to Co-routines. Hopefully that will fix it.

1 Like

As to the build speed. My colleague has a 6 year old Apple Mac with a lower spec and is doing the same build in 10 minutes when it takes me 20-30 minutes. So may be at the weekend I will wipe my laptop and put the bare minimum on to do a true test before I buy a new PC for Unity work.

Well I am pleased to let everyone know that I converted all the async calls to coroutines and its all working. Yay :slight_smile: (Thats WebGL, Rest and Sockets)

As to the speed of build I also reinstalled Windows (as I heard that has helped some people) with a keep nothing option. (Now I’m thinking perhaps I should of deleted partitions and formatted my drive first to make sure - oh well), but I have the same build speeds after tests. Its odd because a 6 year old mac building in 7 minutes vs a 4 your old Windows laptop doing it in 35minutes. Time for a new desktop PC. I believe new Intel, AMD and NVidia launches are due this September 2020.
I’ll probably go with AMD due to its PIE4.0 ability and also an NVidia RTX3090 or NVidia RTX3090Ti. Plus a fast SSD and 64GB Ram. That should sort my build times :slight_smile:

5 Likes