2

用户一直在报告我很难重现的 SIGSEGV 崩溃——这对他们来说相对经常发生,但我从未能够重现它。通过阅读其他 StackOverflow 帖子,我知道我应该打开 NSZombies 来查找僵尸对象,但无论我在 Instruments 中做什么,我都无法让任何僵尸出现。

请注意,我使用的是 ARC。

任何人都可以从这两个崩溃报告中获得任何意义,所以我至少知道从哪里开始寻找僵尸?有没有人有关于如何让僵尸出现在 Instruments 中的任何提示?谢谢!

崩溃报告 #1:

0 MyApp 0x000e4972 testflight_backtrace + 238
1 MyApp 0x000e565c TFSignalHandler + 264
2 libsystem_c.dylib 0x31cd37ec _sigtramp + 48
3 UIKit 0x33e47bde -[UIViewController unloadViewForced:] + 250
4 UIKit 0x33f8f498 -[UIViewController purgeMemoryForReason:] + 64
5 Foundation 0x37f264fe __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 18
6 CoreFoundation 0x376c8546 ___CFXNotificationPost_block_invoke_0 + 70
7 CoreFoundation 0x37654096 _CFXNotificationPost + 1406
8 Foundation 0x37e9a3ea -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
9 Foundation 0x37e9bc1a -[NSNotificationCenter postNotificationName:object:] + 30
10 UIKit 0x33f5a270 -[UIApplication _performMemoryWarning] + 80
11 UIKit 0x33f5a36a -[UIApplication _receivedMemoryNotification] + 174
12 libdispatch.dylib 0x349572e0 _dispatch_source_invoke + 516
13 libdispatch.dylib 0x34954b80 _dispatch_queue_invoke$VARIANT$mp + 52
14 libdispatch.dylib 0x34954ec0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 156
15 CoreFoundation 0x376cf2ac __CFRunLoopRun + 1268
16 CoreFoundation 0x376524a4 CFRunLoopRunSpecific + 300
17 CoreFoundation 0x3765236c CFRunLoopRunInMode + 104
18 GraphicsServices 0x3255f438 GSEventRunModal + 136
19 UIKit 0x33dd6e7c UIApplicationMain + 1080
20 MyApp 0x0001b65e main (main.m:16)
21 MyApp 0x000115af start + 39

崩溃报告 #2:

0 MyApp 0x0018e972 testflight_backtrace + 238
1 MyApp 0x0018f65c TFSignalHandler + 264
2 libsystem_c.dylib 0x31d067ec _sigtramp + 48
3 UIKit 0x33e7abde -[UIViewController unloadViewForced:] + 250
4 UIKit 0x33fc2498 -[UIViewController purgeMemoryForReason:] + 64
5 MyApp 0x000ec988 -[MyTableController didReceiveMemoryWarning] (MyTableController.m:129)
6 MyApp 0x0010a8a8 -[FeaturedViewController didReceiveMemoryWarning] (FeaturedViewController.m:65)
7 Foundation 0x37f594fe __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 18
8 CoreFoundation 0x376fb546 ___CFXNotificationPost_block_invoke_0 + 70
9 CoreFoundation 0x37687096 _CFXNotificationPost + 1406
10 Foundation 0x37ecd3ea -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
11 Foundation 0x37ecec1a -[NSNotificationCenter postNotificationName:object:] + 30
12 UIKit 0x33f8d270 -[UIApplication _performMemoryWarning] + 80
13 UIKit 0x33f8d36a -[UIApplication _receivedMemoryNotification] + 174
14 libdispatch.dylib 0x3498a2e0 _dispatch_source_invoke + 516
15 libdispatch.dylib 0x34987b80 _dispatch_queue_invoke$VARIANT$mp + 52
16 libdispatch.dylib 0x34987ec0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 156
17 CoreFoundation 0x377022ac __CFRunLoopRun + 1268
18 CoreFoundation 0x376854a4 CFRunLoopRunSpecific + 300
19 CoreFoundation 0x3768536c CFRunLoopRunInMode + 104
20 GraphicsServices 0x32592438 GSEventRunModal + 136
21 UIKit 0x33e09e7c UIApplicationMain + 1080
22 MyApp 0x000c565e main (main.m:16)
23 MyApp 0x000bb5af start + 39
4

1 回答 1

2

当您的应用收到内存警告时,似乎有什么地方出错了。您可以使用调试菜单在模拟器上强制执行此操作,或者通过发送(在生产代码中非法)_performMemoryWarning方法在设备上强制执行此操作:

[[UIApplication sharedApplication] _performMemoryWarning];

您可以将其放在重复计时器上以定期发送警告。我建议将其包装在 an#IFDEF DEBUG中以防止其投入生产。

这不会解决您的问题,但它可以帮助您重现崩溃,这是至关重要的第一步。

于 2012-10-20T06:26:57.533 回答