Xcode Guard Malloc 和设备调试:找不到“libgmalloc.dylib”图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13396907/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:38:35  来源:igfitidea点击:

Xcode Guard Malloc and on Device Debugging: 'libgmalloc.dylib' image not found

xcodemalloc

提问by jww

I enabled memory checking in Xcode (Edit Scheme -> Options). I'm now getting the following when I perform on device debugging: dyld: could not load inserted library '/usr/lib/libgmalloc.dylib' because image not found. The measure was taken proactively in hopes of catching mistakes early in the cycle.

我在 Xcode 中启用了内存检查(编辑方案 -> 选项)。现在我就在下面当我在设备调试完成:dyld: could not load inserted library '/usr/lib/libgmalloc.dylib' because image not found。该措施是主动采取的,希望能在周期早期发现错误。

Is memory checking not valid on a device? It appears its valid since it was acknowledged and investigated according to http://lists.apple.com/archives/xcode-users/2012/Mar/msg00271.html. Also, Xcode had no complaints during compile and link. If its not valid for a device, why is Xcode inserting the library? Are there any solutions? Googling returned a few hits, but I did not see any concrete solutions.

内存检查在设备上无效吗?它似乎是有效的,因为它根据http://lists.apple.com/archives/xcode-users/2012/Mar/msg00271.html得到确认和调查。此外,Xcode 在编译和链接过程中没有任何抱怨。如果它对设备无效,为什么 Xcode 插入库?有什么解决办法吗?谷歌搜索返回了一些点击,但我没有看到任何具体的解决方案。

How does one enable Xcode Guard Malloc when debugging on a device?

在设备上调试时如何启用 Xcode Guard Malloc?

回答by Amit Singh

You can't use GuardMalloc on the device.

您不能在设备上使用 GuardMalloc。

回答by jww

To work around, I created two new Xcode schemes. One is named 'XXX Device' and does not include the malloc guards; the second is 'XXX Simulator' and does include the malloc guards.

为了解决这个问题,我创建了两个新的 Xcode 方案。一个名为“XXX Device”,不包括 malloc 保护;第二个是“XXX Simulator”并且包含 malloc 守卫。

Adding a scheme for device/simulator purposes is questionable (http://www.cocoabuilder.com/archive/xcode/303307-why-does-xcode-create-nonsensical-destinations-in-every-scheme.html). Apparently, Dave Duncan has not encountered an issue where Xcode does not do something correctly (or he does not use tools such as malloc guards).

添加用于设备/模拟器目的的方案是有问题的(http://www.cocoabuilder.com/archive/xcode/303307-why-does-xcode-create-nonsensical-destinations-in-every-scheme.html)。显然,Dave Duncan 没有遇到 Xcode 没有正确执行某些操作的问题(或者他没有使用 malloc 守卫等工具)。

This reeks of Cupertino software junk. +1 to Apple and its crappy QA department (if it exists) which let another bug fly free.

这是库比蒂诺软件垃圾的恶臭。+1 给 Apple 及其蹩脚的 QA 部门(如果存在),这让另一个错误自由飞翔。

回答by kgaidis

As others answered, you can notuse Enable Guard Mallocon device, but you can use it on simulator.

正如其他人回答的那样,您不能Enable Guard Malloc在设备上使用,但可以在模拟器上使用它。

All 3 other memory management options, as of Xcode 7.3.1, canbe used on device: Enable Malloc Scribble, Enable Malloc Guard Edgesand Enable Zombie Objects.

从 Xcode 7.3.1 开始,所有其他 3 个内存管理选项可以在设备上使用:Enable Malloc ScribbleEnable Malloc Guard EdgesEnable Zombie Objects

回答by Ankish Jain

Rebooting device fixed it. iOS hasn't updated. Really bad !

重新启动设备修复了它。iOS 没有更新。特别糟糕 !