Ios 这次事故的可能原因是什么?

Ios 这次事故的可能原因是什么?,ios,stack-trace,Ios,Stack Trace,我意识到这是一个模糊的问题,但我正在寻找一个起点。我正在进行试飞实况转播,并注意到以下坠机事件: 0 Powercents 0x000781de testflight_backtrace + 142 1 Powercents 0x00078d6c TFSignalHandler + 212 2 libsystem_c.dylib 0x319937ec _sigtramp + 48 3 libsystem_c.dylib 0x3198920e pthread_kill + 54 4 libsyst

我意识到这是一个模糊的问题,但我正在寻找一个起点。我正在进行试飞实况转播,并注意到以下坠机事件:

0 Powercents 0x000781de testflight_backtrace + 142
1 Powercents 0x00078d6c TFSignalHandler + 212
2 libsystem_c.dylib 0x319937ec _sigtramp + 48
3 libsystem_c.dylib 0x3198920e pthread_kill + 54
4 libsystem_c.dylib 0x3198229e abort + 94
5 AppSupport 0x35f70c2e abortAfterPassingIntegrityCheck + 38
6 AppSupport 0x35f70ee6 runIntegrityCheckAndAbort + 526
7 AppSupport 0x35f7102c checkResultWithStatement + 120
8 AppSupport 0x35f72a12 _connectAndCheckVersion + 1058
9 AppSupport 0x35f72ab6 CPSqliteDatabaseConnectionForWriting + 42
10 AppSupport 0x35f72b8c CPSqliteDatabaseRegisterFunction + 20
11 AddressBook 0x345523f6 ABCDBContextCreateWithPathAndAddressBook + 214
12 AddressBook 0x34546428 ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys + 232
13 AddressBook 0x34554cd6 ABAddressBookCreate + 14
14 TextInput 0x377981c4 _ZN2KB45fill_with_matchable_strings_from_address_bookERNS_7HashmapINS_6StringEbEE + 16
15 TextInput 0x3779edf4 _ZN2KB21DynamicDictionaryImpl28background_load_address_bookERKNS_16StaticDictionaryE + 200
16 TextInput 0x3779f72e _ZN2KBL14BackgroundLoadEPv + 278
17 libsystem_c.dylib 0x3194a734 _pthread_start + 320
18 libsystem_c.dylib 0x3194a5ef thread_start + 7
从我在testflight中看到的情况来看,崩溃发生在打开应用程序时

以下是ApplicationIDFinishLaunching代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{   
    NSDictionary *plistData = [[NSBundle mainBundle] infoDictionary];
    MB_LOG_LEVEL = [[plistData valueForKey:@"MBLogLevel"] intValue];

    NSArray *versionParts = [[plistData objectForKey:@"CFBundleVersion"] componentsSeparatedByString:@" "];

    self.versionString = [NSString stringWithFormat:NSLocalizedString(@"version.string", nil),
                          [plistData objectForKey:@"CFBundleShortVersionString"], 
                          // accounts for $Rev: 407 $
                          [versionParts objectAtIndex: ([versionParts count] > 1 ? 1 : 0)],
                          [plistData objectForKey:@"MBBuildDate"]
                          ];

    [self bootstrap];

    // TestFlight and Google Analytics
    [Tracking startup];

    // Add the tab bar controller's current view as a subview of the window
    // Note: Do it this way, since the UIWindow class has no rootViewController
    // property in iOS 3.x.
    [window_ addSubview:self.tabBarController.view];
    [window_ makeKeyWindow];

    // set up APNS with Urban Airship
    [self initAirship:launchOptions];

    // If it is the first time running the app, delete all local notifications
    [self cleanLocalNotifications];

    // Handle launching from a notification
    UILocalNotification *localNotif =
    [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
    if (localNotif) {
        NSLog(@"Recieved Notification %@",localNotif);
    }    

    return YES;
}
下面是引导方法:

- (void)bootstrap
{    
    // simple check for a bootstrapped db
    Settings *settings = (Settings*)[DataManager objectForEntity:NSStringFromClass([Settings class]) 
                                            sortDescriptorsOrNil:nil
                                                  predicateOrNil:nil];
    if (!settings) {
        settings = (Settings*)[DataManager createManagedInstance:NSStringFromClass([Settings class])];
        [settings setEnergyMobileFirstRun:[NSNumber numberWithBool:YES]];
        [settings setFirstRun:[NSNumber numberWithBool:YES]];
        [settings setShowWelcomeAlertView:[NSNumber numberWithBool:YES]];
        [settings setOnPeakAlertNotificationTime:[NSNumber numberWithInt:0]];
        [settings setMidPeakAlertNotificationTime:[NSNumber numberWithInt:0]];
        [settings setOffPeakAlertNotificationTime:[NSNumber numberWithInt:0]];
        [settings setOnPeakAlertNotificationsActive:[NSNumber numberWithBool:NO]];
        [settings setMidPeakAlertNotificationsActive:[NSNumber numberWithBool:NO]];
        [settings setOffPeakAlertNotificationsActive:[NSNumber numberWithBool:NO]];
        [DataManager saveManagedInstances];
    }
    if ([settings.firstRun boolValue])
    {
        // Clear the Database
        [DataManager deleteAllObjectsForEntity:@"Appliance"];
        [DataManager deleteAllObjectsForEntity:@"Answer"];
        [DataManager deleteAllObjectsForEntity:@"AnsweredQuestion"];
        [DataManager deleteAllObjectsForEntity:@"Question"];
        [self loadSavingsTipData];
        [self createChecklistTips];
        [self initializeTimeOfUseBehaviour];
        [settings setFirstRun:[NSNumber numberWithBool:NO]];
        [DataManager saveManagedInstances];
    }
}
编辑以添加更多信息:

此stacktrace来自TestFlight live。崩溃来自于从应用商店购买的应用

以下是整个stacktrace:

    PRIMARY THREAD THREAD 10

0 Powercents 0x000781de testflight_backtrace + 142
1 Powercents 0x00078d6c TFSignalHandler + 212
2 libsystem_c.dylib 0x319937ec _sigtramp + 48
3 libsystem_c.dylib 0x3198920e pthread_kill + 54
4 libsystem_c.dylib 0x3198229e abort + 94
5 AppSupport 0x35f70c2e abortAfterPassingIntegrityCheck + 38
6 AppSupport 0x35f70ee6 runIntegrityCheckAndAbort + 526
7 AppSupport 0x35f7102c checkResultWithStatement + 120
8 AppSupport 0x35f72a12 _connectAndCheckVersion + 1058
9 AppSupport 0x35f72ab6 CPSqliteDatabaseConnectionForWriting + 42
10 AppSupport 0x35f72b8c CPSqliteDatabaseRegisterFunction + 20
11 AddressBook 0x345523f6 ABCDBContextCreateWithPathAndAddressBook + 214
12 AddressBook 0x34546428 ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys + 232
13 AddressBook 0x34554cd6 ABAddressBookCreate + 14
14 TextInput 0x377981c4 _ZN2KB45fill_with_matchable_strings_from_address_bookERNS_7HashmapINS_6StringEbEE + 16
15 TextInput 0x3779edf4 _ZN2KB21DynamicDictionaryImpl28background_load_address_bookERKNS_16StaticDictionaryE + 200
16 TextInput 0x3779f72e _ZN2KBL14BackgroundLoadEPv + 278
17 libsystem_c.dylib 0x3194a734 _pthread_start + 320
18 libsystem_c.dylib 0x3194a5ef thread_start + 7
Hide Other Threads

THREAD 1 COM.APPLE.NSURLCONNECTIONLOADER

0 CoreFoundation 0x3738f12a __CFRunLoopRun + 882
1 CoreFoundation 0x373124a4 CFRunLoopRunSpecific + 300
2 CoreFoundation 0x3731236c CFRunLoopRunInMode + 104
3 Foundation 0x37b67bb8 +[NSURLConnection(Loader) _resourceLoadLoop:] + 308
4 Foundation 0x37b67a80 -[NSThread main] + 72
5 Foundation 0x37bfb590 __NSThread__main__ + 1048
6 libsystem_c.dylib 0x3194a734 _pthread_start + 320
7 libsystem_c.dylib 0x3194a5ef thread_start + 7
THREAD 2 COM.APPLE.CFSOCKET.PRIVATE

0 libsystem_c.dylib 0x3194a5ef thread_start + 7
THREAD 3 THREAD 11

Empty Stacktrace

THREAD 4 WEBTHREAD

0 CoreFoundation 0x3738f12a __CFRunLoopRun + 882
1 CoreFoundation 0x373124a4 CFRunLoopRunSpecific + 300
2 CoreFoundation 0x3731236c CFRunLoopRunInMode + 104
3 WebCore 0x32fd20f6 _ZL12RunWebThreadPv + 402
4 libsystem_c.dylib 0x3194a734 _pthread_start + 320
5 libsystem_c.dylib 0x3194a5ef thread_start + 7
THREAD 5 THREAD 8

0 CoreFoundation 0x3738f12a __CFRunLoopRun + 882
1 CoreFoundation 0x373124a4 CFRunLoopRunSpecific + 300
2 CoreFoundation 0x3738f44a CFRunLoopRun + 98
3 Powercents 0x000a9f0a +[UA_ASIHTTPRequest runRequests] + 134
4 Foundation 0x37b67a80 -[NSThread main] + 72
5 Foundation 0x37bfb590 __NSThread__main__ + 1048
6 libsystem_c.dylib 0x3194a734 _pthread_start + 320
7 libsystem_c.dylib 0x3194a5ef thread_start + 7
THREAD 6 THREAD 12

Empty Stacktrace

THREAD 7 THREAD 0

0 CoreFoundation 0x3738f0f0 __CFRunLoopRun + 824
1 CoreFoundation 0x373124a4 CFRunLoopRunSpecific + 300
2 CoreFoundation 0x3731236c CFRunLoopRunInMode + 104
3 GraphicsServices 0x3221f438 GSEventRunModal + 136
4 UIKit 0x33a96e7c UIApplicationMain + 1080
5 Powercents 0x0004cfb2 main + 66
6 Powercents 0x0004cf6b start + 39
THREAD 8 THREAD 1

0 0xffffffff + 0
THREAD 9 THREAD 2

Empty Stacktrace

THREAD 10 THREAD 3

Empty Stacktrace

THREAD 11 THREAD 6

Empty Stacktrace

THREAD 12 THREAD 7

0 CoreFoundation 0x3738f12a __CFRunLoopRun + 882
1 CoreFoundation 0x373124a4 CFRunLoopRunSpecific + 300
2 CoreFoundation 0x3731236c CFRunLoopRunInMode + 104
3 Foundation 0x37b5bb74 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 256
4 Foundation 0x37b75522 -[NSRunLoop(NSRunLoop) run] + 78
5 Powercents 0x0008d25c -[TFNetworkManager networkRunLoopThreadEntry] + 72
6 Foundation 0x37b67a80 -[NSThread main] + 72
7 Foundation 0x37bfb590 __NSThread__main__ + 1048
8 libsystem_c.dylib 0x3194a734 _pthread_start + 320
9 libsystem_c.dylib 0x3194a5ef thread_start + 7

在我看来,您的应用程序与iOS通讯簿配合使用。如果可以调试应用程序,请尝试通过更改通讯簿API调用来符号化此连接错误。

它看起来与通讯簿相关-请发布整个崩溃报告

看起来好像AddressBook API正在初始化,并且在打开支持的sqlLite数据库时出错。也许connectAndCheckVersion会以某种方式失败


TestFlight之所以存在,是因为它安装了一个全面捕获信号处理程序,用于向TestFlight Live报告应用程序崩溃。

我不完全确定,但在我看来,这个答案与我遇到的问题是一样的:


我目前仅在iOS 5.1设备上看到了相同的生产崩溃。虽然我不确定是什么触发了这次崩溃,但我认为可以肯定的是,这是一个苹果的bug,已经在iOS 6中修复。

这是在野外,还是在你的模拟器上,还是在设备上?这个应用程序是为appstore签名的吗?我更新了我的问题,谢谢。从概念上讲,找出发生了什么样的错误的最好方法是尝试复制这个错误并调试它。嗯,我看不到地址簿涉及的地方,但我猜第三方SDK之一正在尝试访问它。尝试在项目或工作区中搜索“AddressBook”关键字(使用不同类型的查询)。不幸的是,SDK已打包。a-libraries不允许您这样做,因此您可以尝试逐个禁用第三方SDK,看看是否会发生崩溃。谢谢。我以前使用过地址簿,因此我认识到该框架正在被调用。奇怪的是,我没有在这个应用程序中使用它,而且这个框架甚至没有包括在内!Darren,你能发布你的应用程序吗:didFinishLaunchingWithOptions:MethodfromAppDelegate?我发布了方法,以及其中调用的引导方法。在bootstrap方法中调用了更多的方法,但是它开始有太多的代码无法发布。我怀疑在有人升级应用程序后,迁移核心数据库可能会出现问题。但真正让我困惑的是通讯录上的电话。我不明白他们为什么会在那里。我不完全确定你所说的发布整个坠机报告是什么意思,但我发布了我从TestFlight现场获得的所有信息。正如我在另一篇评论中提到的,我没有在这个应用程序中使用AddressBook(至少据我所知!)。我还没有包括框架。我正在使用其他一些库(城市飞艇、TestFlight、Google Analytics、Facebook),所以我不知道这些库中是否有一个可能试图调用地址簿方法?TestFlight和Facebook不一定使用地址簿。也许是城市飞艇或谷歌分析?:)我用的是城市飞艇,试飞中没有看到任何像那次坠机的东西。好的,我以为你在xCode中崩溃了-TestFlight Live中列出了一个“原因”吗?不,它只是说SIGBART,然后是我发布的崩溃日志。我为我的应用程序募集了一个,是IOS 5.1-我们不使用通讯录-一天崩溃3次-一定是个非常严重的错误