Xcode保护Malloc和设备调试:“libgmalloc”。dylib图片没有找到

时间:2022-01-20 21:25:33

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中启用了内存检查(编辑Scheme ->选项)。现在,当我在设备调试上执行以下操作时,我得到了如下的结果:dyld:不能装入插入库的/usr/lib/libgmalloc。dylib,因为没有找到图像。这项措施是主动采取的,希望能在早期发现错误。

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保护Malloc ?

4 个解决方案

#1


64  

You can't use GuardMalloc on the device.

你不能在设备上使用GuardMalloc。

#2


60  

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设备”,不包括malloc守卫;第二个是“XXX模拟器”,包括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-do -xcode-create- nonsensicaldestin -in- 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给苹果和它的crappy QA部门(如果它存在的话),让另一只虫子*飞行。

#3


9  

As others answered, you can not use Enable Guard Malloc on device, but you can use it on simulator.

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

All 3 other memory management options, as of Xcode 7.3.1, can be used on device: Enable Malloc Scribble, Enable Malloc Guard Edges and Enable Zombie Objects.

所有其他3个内存管理选项,如Xcode 7.3.1,可以在设备上使用:启用Malloc Scribble,启用Malloc保护边缘并启用僵尸对象。

#4


2  

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

重启设备固定它。iOS没有更新。真的不好!

#1


64  

You can't use GuardMalloc on the device.

你不能在设备上使用GuardMalloc。

#2


60  

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设备”,不包括malloc守卫;第二个是“XXX模拟器”,包括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-do -xcode-create- nonsensicaldestin -in- 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给苹果和它的crappy QA部门(如果它存在的话),让另一只虫子*飞行。

#3


9  

As others answered, you can not use Enable Guard Malloc on device, but you can use it on simulator.

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

All 3 other memory management options, as of Xcode 7.3.1, can be used on device: Enable Malloc Scribble, Enable Malloc Guard Edges and Enable Zombie Objects.

所有其他3个内存管理选项,如Xcode 7.3.1,可以在设备上使用:启用Malloc Scribble,启用Malloc保护边缘并启用僵尸对象。

#4


2  

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

重启设备固定它。iOS没有更新。真的不好!