xcode Guard Malloc 不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9436854/
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-14 23:26:04  来源:igfitidea点击:

Guard Malloc doesn't work

iphoneiosxcodedebuggingprofiling

提问by Alexander

I'm experimenting with different profiling options that Xcode provides, but when I enabling Guard Mallocoption in Diagnosticstab and trying to run, I'm getting this error with immediate crash:

我正在尝试使用 Xcode 提供的不同分析选项,但是当我在“诊断”选项卡中启用Guard Malloc选项并尝试运行时,我收到此错误并立即崩溃:

dyld: could not load inserted library: /usr/lib/libgmalloc.dylib

And it is right, /usr/lib/doesn't contain this library. I've located it in:

没错,/usr/lib/不包含这个库。我把它定位在:

Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib/

So I've created link, and started Command Line Tool(just to be sure, because it apparently part of MacOS SDK), enabled Guard Malloc again but the problem remains.
I don't quite get where is a problem: does it new Xcode 4.3 inadvertence, problem with my system or planned decision by Apple to replace it with something else (maybe Instruments)?

所以我创建了链接,并启动了命令行工具(只是为了确定,因为它显然是 MacOS SDK 的一部分),再次启用了 Guard Malloc,但问题仍然存在。
我不太明白问题出在哪里:是新的 Xcode 4.3 疏忽,我的系统有问题还是 Apple 计划决定用其他东西(也许是Instruments)替换它?

采纳答案by christophercotton

Well, I got stuck by this too. From an apple list:

嗯,我也被这个卡住了。来自苹果列表:

http://prod.lists.apple.com/archives/xcode-users/2012/Feb/msg00197.html

http://prod.lists.apple.com/archives/xcode-users/2012/Feb/msg00197.html

That's a known issue that's being investigated. I think that you may be able to work around it by installing the 10.7.3 combo installer

这是一个正在调查的已知问题。我认为您可以通过安装 10.7.3 组合安装程序来解决它

Which means you need to download the combo installer from: http://support.apple.com/kb/DL1484?

这意味着您需要从http://support.apple.com/kb/DL1484下载组合安装程序?

I'm trying it now to make sure it works, but the person on the mailing list said it worked.

我现在正在尝试以确保它有效,但邮件列表上的人说它有效。

回答by lagrangee

on device or simulator?

在设备或模拟器上?

According to http://developer.apple.com/library/ios/#DOCUMENTATION/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html

根据http://developer.apple.com/library/ios/#DOCUMENTATION/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html

You can use this option both Mac apps and also for iPhone applications running in the simulator.

您可以在 Mac 应用程序和模拟器中运行的 iPhone 应用程序中使用此选项。

回答by Alexander

Problem came up again recently, combo update didn't helped (libgmalloc.dylib was in place).

最近问题又出现了,组合更新没有帮助(libgmalloc.dylib 到位)。

New solution was to Repair Disk Permissions in Disk Utility: Disk Utility interface

新的解决方案是在磁盘工具中修复磁盘权限: 磁盘工具界面

回答by DJ van Wyk

It looks like you can't enable Guard Malloc when debugging directly on a device (at least iPad in my case), even when running the latest and greatest versions of everything. Running still works in the simulator though.

看起来您无法在设备上直接调试时启用 Guard Malloc(在我的情况下至少是 iPad),即使在运行最新和最好的所有版本时也是如此。尽管如此,在模拟器中运行仍然有效。