简体   繁体   English

setValue:forKey与_sigtramp一起崩溃

[英]setValue:forKey crash with _sigtramp

The trace is like this 痕迹是这样的

Application received signal SIGSEGV

Stack trace:
#0  CoreFoundation                      002BCE149F <redacted>()
#1  libobjc.A.dylib                     00394F8C8B objc_exception_throw()
#2  CoreFoundation                      002BCE13E5 -[NSException initWithCoder:]
#3  funadhoc                            000025B129 UmengSignalHandler()
#4  libsystem_platform.dylib            0039BB8873 _sigtramp()
#5  libobjc.A.dylib                     0039505571 objc_setProperty_nonatomic_copy()
#6  Foundation                          002C947F59 -[NSObject setValue:forKey:]
#7  Foundation                          002C9C58F3 -[NSObject setValuesForKeysWithDictionary:]
..........................

I understand the situation of setValue:forUndefinedKey: or setNilValueForKey: , but what is this? 我了解setValue:forUndefinedKey:setNilValueForKey: ,但这是什么?

Besides, some system symbols are <redacted> , how can I get it symbolicated? 此外,某些系统符号是<redacted> ,我如何使其符号化?

In this case, _sigtramp() means that your application received a Unix signal, in this case SIGSEGV. 在这种情况下,_sigtramp()意味着您的应用程序收到了Unix信号,在这种情况下为SIGSEGV。 SIGSEGV means that your app was sent this signal because of a memory access violation. SIGSEGV意味着您的应用由于内存访问冲突而发送了此信号。 In this case, I'm guessing it was caused by your call to setValue: forKey:. 在这种情况下,我猜这是由您对setValue:forKey:的调用引起的。 Perhaps the object you called setValue:forKey: on (the receiver of that method) has already been deallocated? 您调用setValue:forKey:on的对象(该方法的接收者)可能已经被释放了? Or perhaps either the key or the value has been deallocated? 还是键或值已被释放? That's probably what you should check. 那可能就是您应该检查的内容。

Try turning on NSZombieEnabled (environment variable). 尝试打开NSZombieEnabled(环境变量)。 It will keep the object around and marked as a "Zombie" and then report to you that you tried to access a Zombie. 它将保留该对象并标记为“僵尸”,然后向您报告您尝试访问僵尸。 If you are using ARC, you may have some unsafe-unretained reference to the object. 如果使用的是ARC,则可能对对象有一些不安全且未保留的引用。 You need to have a strong reference to it. 您需要对此有强烈的参考。 If its non-ARC, then you probably failed to retain it properly. 如果它不是ARC,则可能无法正确保留它。

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

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