puerts icon indicating copy to clipboard operation
puerts copied to clipboard

[UE] Bug:

Open cf opened this issue 1 year ago • 7 comments

前置阅读 | Pre-reading

Puer的版本 | Puer Version

1.0.5

UE的版本 | UE Version

5.4.4

发生在哪个平台 | Platform

iOS

错误信息 | Error Message

Screenshot 2024-10-22 at 5 03 58 PM

v8::V8::SetFlagsFromString: crashes on iOS, but works fine on Mac/Editor

问题重现 | Bug reproduce

JsEnv = MakeShared<puerts::FJsEnv>(std::make_unique<puerts::DefaultJSModuleLoader>(TEXT("JavaScript")), std::make_shared<puerts::FDefaultLogger>(), 8089);
Screenshot 2024-10-22 at 5 14 36 PM

cf avatar Oct 22 '24 09:10 cf

v8 version?

chexiongsheng avatar Oct 22 '24 09:10 chexiongsheng

v8 version?

V10_6_194

cf avatar Oct 22 '24 21:10 cf

puerts 1.0.5 use 8.4.371.19, 9.4.146.24

chexiongsheng avatar Oct 22 '24 23:10 chexiongsheng

请问一下这个问题解决了吗? 我们项目也遇到了相同的问题。UE版本5.4.4,Puer版本1.0.5,v8版本9.4.146.24。 但是第一次启动IOS不崩溃,杀掉APP后重进,第二次触发这个堆栈,然后后续重复进必现: 企业微信截图_17333051961872

尝试关机后,再次启动app不崩溃,第二次进入崩溃;

jarodecho avatar Dec 04 '24 09:12 jarodecho

请问一下这个问题解决了吗? 我们项目也遇到了相同的问题。UE版本5.4.4,Puer版本1.0.5,v8版本9.4.146.24。 但是第一次启动IOS不崩溃,杀掉APP后重进,第二次触发这个堆栈,然后后续重复进必现: 企业微信截图_17333051961872

尝试关机后,再次启动app不崩溃,第二次进入崩溃;

应该和这个是同一个问题:https://github.com/Tencent/puerts/issues/1936

chexiongsheng avatar Dec 04 '24 11:12 chexiongsheng

Try download this version of v8: https://github.com/puerts/backend-v8/releases/tag/V8_11.8.172_with_new_wrap_241205.

Extract it to ThirdParty, then change JsEnv.Build.cs to using V11_8_172.

Similar problems have been solved in https://github.com/Tencent/puerts/issues/1936

chexiongsheng avatar Dec 05 '24 12:12 chexiongsheng

请问一下这个问题解决了吗? 我们项目也遇到了相同的问题。UE版本5.4.4,Puer版本1.0.5,v8版本9.4.146.24。 但是第一次启动IOS不崩溃,杀掉APP后重进,第二次触发这个堆栈,然后后续重复进必现: 企业微信截图_17333051961872

尝试关机后,再次启动app不崩溃,第二次进入崩溃;

这个现象,直接原因是iOS的new/delete运算符重载,在第一次app启动的时候生效,在第二次启动的时候不生效。 然后这个问题我们测试下来,在iOS16系统上面有,在iOS18系统上面没有。 写一个XCode demo app,做一个运算符重载的测试,就能重现。 https://developer.apple.com/forums/thread/707242 这个是Apple论坛搜索到的对应问题,但是还没有被解决。

目前怀疑是不同版本的dyld,在处理App首次启动和二次启动的时候,流程差异导致的 https://github.com/apple-oss-distributions/dyld

image

可以让UE用Binned1或者Ansi的内存分配器,来绕过这个问题。当然,也可以去掉项目中所有使用的std::string这类容器,应该也不会有这个问题。

zhaojunmeng avatar Dec 05 '24 14:12 zhaojunmeng