5.6的std::string内存崩溃

我们项目在IOS第二次启动的时候,会调用protobuf处理字符串,当调用到了string.append这时候一定会发生崩溃,并且xcode提示:malloc: *** error for object 0x2b696ca30:

pointer being freed was not allocated,第一次启动或者删除掉包里cache下的dyld4文件就没有问题。

这跟我们之前碰上的UE析构了系统内存的崩溃很像,但是目前看来是operate [Content removed]

[Attachment Removed]

Hi,

根据线下交流,已知的一些方法好像你们都测试过,似乎没有解决你们的问题。不知道这个问题是否是shipping版才会出现,development版本是否没问题?

[Attachment Removed]

看起来像是这个问题导致的崩溃:

《Operator new/delete override only work for the first time for an iOS App on iOS16》

[Attachment Removed]

这个功能5.6的版本应该已经有了,在Project Settings里能否看到bEnableIOS16DynLinkerBugWAR?之前好像有人怀疑这个改法可能会导致苹果过审困难,可以先测试一下是否有效,再看看是否影响过审。

[Attachment Removed]

development也有这个问题

[Attachment Removed]

好的 我试下这个

[Attachment Removed]

我试了下 还是会崩溃

[Attachment Removed]

好的,暂时没有其他想法…

[Attachment Removed]

是否可以动态使用Ansi和mallocbined2呢 如果是IOS16的系统就切换到Ansi上?

[Attachment Removed]

引擎没有支持这样的功能,但理论上应该是可以做到的,可以用FPlatformMisc::IOSVersionCompare来比对版本,然后在FApplePlatformMemory::BaseAllocator里定制逻辑。

[Attachment Removed]