Webgl webview Ios 15.4

We have been working with the WebView option in my Unity app in which my app acts as display device for my Webgl games. Until recently everything was working fine but now recently on updating to ios15 the games started behaving weirdly so i went further ahead and updated to 15.4 . Now the Webgl build are popping up with a a JavaScript error only in safari browser and on macOS safari browser it crashes. Works perfectly on android and also macOS chrome. cant get a grip on what's wrong

Runtime Error: Out of bounds memory access(evaluating'dynCall_ii(index,a1)').wasm-function[24968]@@[wasm code]<?>.wasm-function[26322]@[wasmcode]wasm-stub@[native code]nvoke_ii@blob:https://

Replies

I also have this problem, and after updating to latest iOS 15.4.1 version, the problem is still there。

exception thrown: RuntimeError: Out of bounds memory access (evaluating 'Module["asm"]["dynCall_iiii"].apply(null, arguments)'),<?>.wasm-function[__ZN6il2cpp2vm13MetadataCache34GetTypeInfoFromTypeDefinitionIndexEi]@[wasm code]
<?>.wasm-function[__ZN6il2cpp2vm4Type8GetClassEPK10Il2CppType]@[wasm code]
<?>.wasm-function[__ZN6il2cpp2vm5Class14FromIl2CppTypeEPK10Il2CppTypeb]@[wasm code]
<?>.wasm-function[__ZN6il2cpp8metadata15GenericMetadata12InflateRGCTXEPK11Il2CppImagejPK20Il2CppGenericContext]@[wasm code]
<?>.wasm-function[dynCall_iiii]@[wasm code]
wasm-stub@[native code]
...
  • Found a temp solution in Unity forum: edit the file "Unity.app/Contents/il2cpp/libil2cpp/metadata/GenericMetadata.cpp" in a text editor.

    Find the function: "const Il2CppType GenericMetadata::InflateIfNeeded"*

    Add "#pragma clang optimize off" above the function, and add "#pragma clang optimize on" at the end of function.

Add a Comment

We are having the same problem, our unity-games are crashing with the out-of-memory-bounds-access.

With the Workaround mentioned by @guxiaoyu039 they are now starting without a crash but after a while the game elements start to flicker heavily. This hasn't been the case for iOS 15.3 and below. From Safari's WebGL canvas recording function we can see that the drawing order seems to be wrong.

The whole topic is being discussed here as well: https://forum.unity.com/threads/ios-15-webgl-2-issue.1176116/page-2

https://unitree.com/products/laikago, If you use safari on ios 15.4, the webpage just broke. But it used to work fine. So I guess it's apple's bug for webgl.

Someone a solution? Having the same issue but for me it seems it is UNITY/asm related. Seems if older builds of the same gallery (created on Intel MAC) don't have this problem. Any thoughts?

  • iOS 15.5 RC 2 seems to finally solve that issue.

Add a Comment