NSApplicationMain()中strlen上的奇怪可可崩溃

时间:2013-03-11 07:14:21

标签: cocoa strlen

我几天前关闭了我的xcode项目,当我回来时,它一直在崩溃!我没有改变任何代码,所以我不知道发生了什么。我在EXC_BAD_ACCESS (code=1, address=0x0)方法中的strlen上获得NSApplicationMain()并查看错误堆栈,看起来我的应用程序甚至没有启动!

继承错误堆栈

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib               0x000000010847a650 strlen + 16
1   libsystem_c.dylib               0x00000001084c8067 strdup + 21
2   com.apple.Foundation            0x0000000104d018fb _compatDecodeValueOfObjCType + 763
3   com.apple.Foundation            0x0000000104c04da6 newDecodedValue + 1162
4   com.apple.Foundation            0x0000000104c22a09 _decodeObjectBinary + 2741
5   com.apple.Foundation            0x0000000104c21db4 _decodeObject + 226
6   com.apple.AppKit                0x000000010575991b __copyCarbonDictionariesFromRecords_block_invoke_0 + 372
7   com.apple.AppKit                0x00000001057caa35 _NSMapAndFilter + 233
8   com.apple.AppKit                0x0000000105807be2 copyCarbonDictionariesFromRecords + 30
9   com.apple.AppKit                0x000000010580799d +[NSPersistentUIManager(NSCarbonMethods) copyPersistentCarbonWindowDictionariesForBundleID:] + 144
10  com.apple.HIToolbox             0x000000010b009821 _HIPersistentUICopyPersistentCarbonWindowDictionariesForBundleID + 73
11  com.apple.HIToolbox             0x000000010b0097c7 GetPersistenceDictionariesAtLaunch() + 52
12  com.apple.HIToolbox             0x000000010b00978c WindowStateInitFirstEventTime() + 9
13  com.apple.HIToolbox             0x000000010b00915c _FirstEventTime + 50
14  com.apple.HIToolbox             0x000000010b008ffc RunCurrentEventLoopInMode + 41
15  com.apple.HIToolbox             0x000000010b008d84 ReceiveNextEventCommon + 166
16  com.apple.HIToolbox             0x000000010b008cd3 BlockUntilNextEventMatchingListInMode + 62
17  com.apple.AppKit                0x0000000105806613 _DPSNextEvent + 685
18  com.apple.AppKit                0x0000000105805ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
19  com.apple.AppKit                0x00000001057fd283 -[NSApplication run] + 517
20  com.apple.AppKit                0x00000001057a1cb6 NSApplicationMain + 869
21  com.littleendiangamestudios.Alone   0x0000000104b54592 main + 34 (main.m:13)
22  com.littleendiangamestudios.Alone   0x0000000104b54564 start + 52

Thread 1:
0   libsystem_kernel.dylib          0x00000001085fa6d6 __workq_kernreturn + 10
1   libsystem_c.dylib               0x000000010848eeec _pthread_workq_return + 25
2   libsystem_c.dylib               0x000000010848ecb3 _pthread_wqthread + 412
3   libsystem_c.dylib               0x0000000108479171 start_wqthread + 13

Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00000001085fad16 kevent + 10
1   libdispatch.dylib               0x00000001083f2dea _dispatch_mgr_invoke + 883
2   libdispatch.dylib               0x00000001083f29ee _dispatch_mgr_thread + 54

Thread 3:
0   libsystem_kernel.dylib          0x00000001085fa6d6 __workq_kernreturn + 10
1   libsystem_c.dylib               0x000000010848eeec _pthread_workq_return + 25
2   libsystem_c.dylib               0x000000010848ecb3 _pthread_wqthread + 412
3   libsystem_c.dylib               0x0000000108479171 start_wqthread + 13

Thread 4:
0   libsystem_kernel.dylib          0x00000001085fa6d6 __workq_kernreturn + 10
1   libsystem_c.dylib               0x000000010848eeec _pthread_workq_return + 25
2   libsystem_c.dylib               0x000000010848ecb3 _pthread_wqthread + 412
3   libsystem_c.dylib               0x0000000108479171 start_wqthread + 13

Thread 5:
0   libsystem_kernel.dylib          0x00000001085fa6d6 __workq_kernreturn + 10
1   libsystem_c.dylib               0x000000010848eeec _pthread_workq_return + 25
2   libsystem_c.dylib               0x000000010848ecb3 _pthread_wqthread + 412
3   libsystem_c.dylib               0x0000000108479171 start_wqthread + 13

1 个答案:

答案 0 :(得分:1)

您似乎已经以某种方式损坏了应用的持久状态。如果你进入你的~/Library/Saved Application State/目录并删除你的应用程序,它应该修复它。