-
Creator 版本:2.3.4
-
目标平台: iOS真机
-
重现方式:使用2.3.4版本Creator构建含有WebAssembly调用的工程,在真机上调试(6sp iOS13.5.1,xr iOS13.1),触发即崩溃,xcode模拟器没问题
-
首个报错:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x111288040)
* frame #0: 0x0000000111288040
frame #1: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #2: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #3: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #4: 0x000000010393d6c4 WebAssemblyTest-mobile`Builtins_ArgumentsAdaptorTrampoline + 228
frame #5: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #6: 0x000000010393d6c4 WebAssemblyTest-mobile`Builtins_ArgumentsAdaptorTrampoline + 228
frame #7: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #8: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #9: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #10: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #11: 0x0000000103945024 WebAssemblyTest-mobile`Builtins_InterpreterEntryTrampoline + 804
frame #12: 0x00000001039423a4 WebAssemblyTest-mobile`Builtins_JSEntryTrampoline + 164
frame #13: 0x000000010394204c WebAssemblyTest-mobile`Builtins_JSEntry + 172
- 之前哪个版本是正常的: 2.4.3
- 手机型号: 只测试了6SP iOS13.5.1,XR iOS13.1
- 手机浏览器: Safari
- 编辑器操作系统: MAC 10.15
- 重现概率:100%
测试结果:
| 平台 | 构建Creator版本 | 可用 |
|---|---|---|
| iOS真机 | v2.3.4 | false |
| iOS模拟器 | v2.3.4 | true |
| Safari | v2.3.4 | true |
| Android | v2.3.4 | true |
| OPPO小游戏 | v2.3.4 | true |
| cocos模拟器 | v2.3.4 | true |
| ---- | ||
| iOS真机 | v2.4.3 | false |
| iOS模拟器 | v2.4.3 | false |
| Safari | v2.4.3 | true |
| Android | v2.4.3 | 未测试 |
| OPPO小游戏 | v2.4.3 | true |
| cocos模拟器 | v2.4.3 | true |
总结:
通过creator v2.3.4构建的跨平台工程,WASM可以正常运行在iOS模拟器/iOS Safari/Android/OPPO小游戏/CocosCreator模拟器等终端上并输出调用结果,但在iOS真机上运行会导致Xcode抛出异常,直接终止进程,且无法用try捕获;
通过creator v2.4.3构建的跨平台工程,WASM可以正常运行在iOS Safari/OPPO小游戏/CocosCreator模拟器等终端上并输出调用结果;在iOS真机/iOS模拟器上运行,JS抛出异常,报WebAssembly undefined,可以通过try捕获;`
提问
想知道问题出在哪?不支持webAssembly没关系,但不能进程也崩了。没时间升级Creator,所以求一个可以解决问题的简易方案。
demo见附件WebAssemblyTest.zip (226.9 KB)
