nszombie

Tracking down EXC_BAD_ACCESS without NSZombie?

时间秒杀一切 提交于 2020-01-25 01:22:16
问题 I've spent two days on this and I still can't find the cause of the crash. I know it has something to do with trying to access an object that has been freed but I don't know which access or which object. Whenever I google trying to find the source of EXC_BAD_ACCESS people suggest using NSZombies. The problem is when I enable zombies (either in xcode via environment variable or in instruments via ObjectAlloc properties) the program doesn't crash where it usually does and the zombies don't

ios Zombie detection

别来无恙 提交于 2020-01-02 04:24:30
问题 I'm having (in my opinion) a very difficult problem in my code. It crashes randomly at different places in the code. The project is a ARC project. So my program crashes occaisonally with this messages: malloc: *** error for object 0xd2dd8b0: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug I already set a breakpoint for malloc_error_break but I don't get any information out of it. When the code crashes

How to turn off NSZombieEnabled in Xcode 4

落花浮王杯 提交于 2020-01-01 02:43:08
问题 I have just migrated to Xcode 4 and i had zombie activated in Xcode 3 for my app. I used the following method: Go to Project -> Edit Active Executable Click Arguments Click + in the "Variables to be set in the environment" section Enter NSZombieEnabled in the Name column and YES in the Value column. Make sure the checkmark for the NSZombieEnabled entry is checked. Now i want to make sure it is off for my application but do not understand how to check/do that in XCODE4, anyone that can share

How can I demonstrate a zombie object in Swift?

随声附和 提交于 2019-12-31 03:45:07
问题 I've read How to demonstrate memory leak and zombie objects in Xcode Instruments? but that's for objective-c. The steps don't apply. From reading here I've understood zombies are objects which are: deallocated but something pointer is still trying to point to them and send messages to them. not exactly sure how that's different from accessing a deallocated object. I mean in Swift you can do: var person : Person? = Person(name: "John") person = nil print(person!.name) Is person deallocated?

How to enable NSZombie in Xcode?

狂风中的少年 提交于 2019-12-25 03:32:17
问题 I have an app that is crashing with no error tracing. I can see part of what is going on if I debug, but can't figure out which object is "zombie-ing". Does anybody know how to enable NSZombie in Xcode 4? 回答1: Environment variables are now part of the "scheme". To edit the scheme and turn on zombies: In the "Product" menu, select "Edit Scheme". Go to the "Run Foo.app" stage in the left panel, and the "Arguments" tab on the right. Add NSZombieEnabled to the "Environment Variables" section and

NSZombies enabled, debug information

南笙酒味 提交于 2019-12-25 01:33:58
问题 My Mac app is crashing with exc_bad_access on the run loops. So I enabled NSZombies, and Now I don't see such error as expected ( As the objects are not de-allocated). But, I don't find any useful NSZombie Log in the console. Is there a way to identify the issue ? 回答1: It's challenging. The most common cause of this error in Cocoa is directly accessing your ivars rather than using accessors. Accessors make the vast majority of memory crashes go away. That said, they're not the only cause of

How to track down zombie object crash?

一曲冷凌霜 提交于 2019-12-24 04:23:10
问题 I am having some wired crash in my iOS app and its not 100% reproducible. From crash log I can see that unrecognized selector(property accessor) is sent to object that is not of correct type (most likely zombie). Is there anyway in XCode that I can used to see if I am trying to access zombie object ? Thanks. 回答1: There are two ways. 1. Go to breakpoints sections on the left of XCode, down you can see an option to add exception breakpoints. 2. Click Menubar > Product > Scheme > Edit Scheme

Zombie option missing from both diagnostics and instruments

坚强是说给别人听的谎言 提交于 2019-12-23 16:04:58
问题 Running Xcode 4.0.2, the Zombie option is missing, from both places where other SO posts have suggested to find it. Product > Run... looks like this: Product > Profile looks like this: What is strange is that I have used Zombies before in this version of Xcode. I did a profile using the Allocations instrument, clicked Allocations' info button ("i") at the upper left, and checked the "Enable Zombie..." that then appeared there. But when I try that now, I get this: No more Zombies. Is it

In App Purchase Crashes on [[SKPaymentQueue defaultQueue] addPayment:payment]

喜你入骨 提交于 2019-12-18 11:00:31
问题 My In-App-Purchases work. I present a ModalView with a "Buy" UIButton. You click the button and the In App Purchase goes through the process. You can even do it several times in a row. The problem occurs if you open the Modal View, then close the Modal View (using a UITabBarButtonItem), then reopen the Modal View and tap the "Buy" button. The app crashes and I get an NSZombie that reads *** -[InAppPurchaseManager respondsToSelector:]: message sent to deallocated instance 0x1c7ad0 The NSZombie

What is NSZombie?

十年热恋 提交于 2019-12-17 02:04:33
问题 I've seen suggestions saying to set NSZombieEnabled to true while debugging. What is NSZombie? Is it a framework? A setting? 回答1: It's a memory debugging aid. Specifically, when you set NSZombieEnabled then whenever an object reaches retain count 0, rather than being deallocated it morphs itself into an NSZombie instance. Whenever such a zombie receives a message, it logs a warning rather than crashing or behaving in an unpredictable way. As such, you can debug subtle over-release/autorelease