简体   繁体   English

奇怪的内存管理问题

[英]Strange memory management issue

I can't identify the object being deallocated, I run my app with Command+Y but despite having MallocStackLogging set to YES and NSZombieEnabled set to YES, when I hit EXC_BAD_ACCESS in my app, gdb doesn't print the memory address of the deallocated object. 我无法确定要释放的对象,我使用Command + Y运行我的应用程序,但是尽管将MallocStackLogging设置为YES并将NSZombieEnabled设置为YES,当我在应用程序中点击EXC_BAD_ACCESS时,gdb不会打印已释放的对象的内存地址宾语。 Any ideas? 有任何想法吗?

Apologies if this seems vague, it looks like it's Core Data related, if anyone can provide insightful analysis of the output I'd very much appreciate it. 抱歉,如果看起来含糊不清,它似乎与Core Data有关,如果有人可以提供对输出的深刻分析,我将非常感谢。 Thanks 谢谢

Here's the stack trace at the crash: 这是崩溃时的堆栈跟踪:

#0  0x933b4edb in objc_msgSend
#1  0x08c46040 in ??
#2  0x01f3c6c9 in __CFSetDeallocate
#3  0x01f23a41 in _CFRelease
#4  0x01dd9977 in -[_NSFaultingMutableSet dealloc]
#5  0x01dcb892 in -[NSManagedObject(_NSInternalMethods) _clearRawPropertiesWithHint:]
#6  0x01dcb5ed in -[NSFaultHandler turnObject:intoFaultWithContext:]
#7  0x01dccd8c in -[NSManagedObject dealloc]
#8  0x01db0315 in -[_PFManagedObjectReferenceQueue _processReferenceQueue:]
#9  0x01ddd9ba in _performRunLoopAction
#10 0x01f65252 in __CFRunLoopDoObservers
#11 0x01f6465f in CFRunLoopRunSpecific
#12 0x01f63c48 in CFRunLoopRunInMode
#13 0x0268b615 in GSEventRunModal
#14 0x0268b6da in GSEventRun
#15 0x002a7faf in UIApplicationMain
#16 0x00002b60 in main at main.m:13

Run the Clang Static Analyzer (Xcode Build menu >> Build and Analyze) and check if it finds any issues. 运行Clang Static Analyzer(Xcode Build菜单>> Build and Analyze),并检查是否发现任何问题。

Yesterday I had an "EXC_BAD_ACCESS" problem in one of my apps, and I had NSZombieEnabled but it wasn't printing a message so I was stumped but the static analyzer found an issue where I was releasing an object that was never retained, and fixing that solved my problem. 昨天我的一个应用程序中出现“ EXC_BAD_ACCESS”问题,并且我有NSZombieEnabled,但没有打印消息,所以我很困惑,但是静态分析器发现一个问题,我释放了一个从未保留的对象,并进行了修复解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM