草庐IT

ios - 无法从此崩溃日志确定原因

coder 2023-07-16 原文

我在 App Store 中有一个应用程序经常崩溃,但我无法自己重现它。 我有很多崩溃日志,但它们不包含回溯,因此很难诊断问题。

崩溃日志显示 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER,这可能是根据 SO 上的其他问题向已解除分配的观察者发送的通知引起的。 然而,该应用程序只能在 iOS 10+ 上运行,并且根据 Apple 的说法,没有必要从 iOS 9 开始取消注册观察者,除非他们是 block 观察者。我的应用程序没有使用,所以就我自己的应用程序通知而言,这不是原因。

    Incident Identifier: 77AB1312-9C1F-4BC1-957E-B742856DC635
    CrashReporter Key:   6ad59ac64c53d2fc92208e8df23d4ddc8fed39fd
    Hardware Model:      iPhone10,3
    Process:             My App [378]
    Path:                /private/var/containers/Bundle/Application/99C2E2C8-9655-4D07-9608-870B5DD17C21/My app.app/My app
    Identifier:          com.myapp
    OS Version:          iPhone OS 10.3.2 (14F89)
    Code Type:           ARM-64 (Native)
    Role:                Foreground
    Parent Process:      launchd [1]
    Coalition:           com.myapp[498]


    Date/Time:           2018-06-06 00:18:34.2085 -0700
    Launch Time:         2018-06-06 00:17:39.1406 -0700
    Baseband Version:    2.03.00
    Report Version:      104
          Exception Type:  EXC_CRASH (SIGABRT)
            Exception Codes: 0x0000000000000000, 0x0000000000000000
            Exception Note:  EXC_CORPSE_NOTIFY
            Triggered by Thread:  0

            Thread 0 name:
            Thread 0 Crashed:
            0   libsystem_kernel.dylib          0x000000018ec4d014 __pthread_kill + 8
            1   libsystem_pthread.dylib         0x000000018ed17264 pthread_kill + 112 (pthread.c:1366)
            2   libsystem_c.dylib               0x000000018ebc19c4 abort + 140 (abort.c:91)
            3   libswiftCore.dylib              0x0000000100ad976c 0x1007ec000 + 3069804
            4   libswiftCore.dylib              0x0000000100b0614c 0x1007ec000 + 3252556
            5   CoreFoundation                  0x000000018fc56f54 ___forwarding___ + 916 (NSForwarding.m:3126)
            6   CoreFoundation                  0x000000018fb52d4c _CF_forwarding_prep_0 + 92
            7   CoreFoundation                  0x000000018fbed5f4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:650)
            8   CoreFoundation                  0x000000018fbecd08 _CFXRegistrationPost + 400 (CFNotificationCenter.c:164)
            9   CoreFoundation                  0x000000018fbeca84 ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1031)
            10  CoreFoundation                  0x000000018fc5b7a8 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1412 (CFXNotificationRegistrar.m:163)
            11  CoreFoundation                  0x000000018fb3095c _CFXNotificationPost + 376 (CFNotificationCenter.c:1028)
            12  Foundation                      0x0000000190642930 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:482)
            13  UIKit                           0x0000000195e07ea8 -[UIApplication _stopDeactivatingForReason:] + 1124 (UIApplication.m:1534)
            14  UIKit                           0x0000000196005b4c __62-[UIApplication _sceneSettingsPostLifecycleEventDiffInspector]_block_invoke.1259 + 124 (UIApplication.m:3247)
            15  FrontBoardServices              0x00000001917e4be8 __52-[FBSSettingsDiffInspector inspectDiff:withContext:]_block_invoke.27 + 204 (FBSSettingsDiffInspector.m:46)
            16  Foundation                      0x00000001906fc7fc __NSIndexSetEnumerate + 724 (NSIndexSet.m:1347)
            17  BaseBoard                       0x0000000191757510 -[BSSettingsDiff inspectChangesWithBlock:] + 104 (BSSettingsDiff.m:187)
            18  FrontBoardServices              0x00000001917dece4 -[FBSSettingsDiff inspectOtherChangesWithBlock:] + 88 (FBSSettingsDiff.m:65)
            19  FrontBoardServices              0x00000001917e49bc -[FBSSettingsDiffInspector inspectDiff:withContext:] + 280 (FBSSettingsDiffInspector.m:44)
            20  UIKit                           0x00000001960064d4 __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 196 (UIApplication.m:3346)
            21  UIKit                           0x0000000196006124 -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 892 (UIApplication.m:3357)
            22  UIKit                           0x00000001963407c8 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464 (UIApplicationSceneClientAgent.m:74)
            23  FrontBoardServices              0x00000001917ce22c __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.376 + 208 (FBSSceneImpl.m:598)
            24  FrontBoardServices              0x00000001917fb884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36 (FBSSerialQueue.m:158)
            25  FrontBoardServices              0x00000001917fb6f0 -[FBSSerialQueue _performNext] + 176 (FBSSerialQueue.m:177)
            26  FrontBoardServices              0x00000001917fbaa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:206)
            27  CoreFoundation                  0x000000018fc0142c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1943)
            28  CoreFoundation                  0x000000018fc00d9c __CFRunLoopDoSources0 + 540 (CFRunLoop.c:1989)
            29  CoreFoundation                  0x000000018fbfe9a8 __CFRunLoopRun + 744 (CFRunLoop.c:2821)
            30  CoreFoundation                  0x000000018fb2eda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
            31  GraphicsServices                0x0000000191598074 GSEventRunModal + 100 (GSEvent.c:2245)
            32  UIKit                           0x0000000195de9058 UIApplicationMain + 208 (UIApplication.m:4089)
            33  My App                          0x00000001000be2e4 main + 56 (MyFile.swift:17)
            34  libdyld.dylib                   0x000000018eb3d59c start + 4

hread 1:
0   libsystem_pthread.dylib         0x0000000220f92064 start_wqthread + 0

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib          0x0000000220ef6ac8 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000220ef6940 mach_msg + 72 (mach_msg.c:103)
2   CoreFoundation                  0x000000022131d2f0 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3   CoreFoundation                  0x000000022131af80 __CFRunLoopRun + 1404 (CFRunLoop.c:2971)
4   CoreFoundation                  0x0000000221254abc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5   Foundation                      0x0000000221cd0544 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300 (NSRunLoop.m:367)
6   Foundation                      0x0000000221cd03f0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 148 (NSRunLoop.m:411)
7   UIKitCore                       0x000000024c433a7c -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:524)
8   Foundation                      0x0000000221de0a94 __NSThread__start__ + 1040 (NSThread.m:1175)
9   libsystem_pthread.dylib         0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
10  libsystem_pthread.dylib         0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
11  libsystem_pthread.dylib         0x0000000220f92070 thread_start + 4

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib          0x0000000220ef6ac8 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000220ef6940 mach_msg + 72 (mach_msg.c:103)
2   CoreFoundation                  0x000000022131d2f0 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3   CoreFoundation                  0x000000022131af80 __CFRunLoopRun + 1404 (CFRunLoop.c:2971)
4   CoreFoundation                  0x0000000221254abc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5   CFNetwork                       0x0000000221b5fc8c -[__CoreSchedulingSetRunnable runForever] + 212 (CoreSchedulingSet.mm:1365)
6   Foundation                      0x0000000221de0a94 __NSThread__start__ + 1040 (NSThread.m:1175)
7   libsystem_pthread.dylib         0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
8   libsystem_pthread.dylib         0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
9   libsystem_pthread.dylib         0x0000000220f92070 thread_start + 4

Thread 4 name:
Thread 4:
0   libsystem_kernel.dylib          0x0000000220f184ac __psynch_cvwait + 8
1   libsystem_pthread.dylib         0x0000000220f9a638 _pthread_cond_wait$VARIANT$armv81 + 620 (pthread_cond.c:578)
2   libc++.1.dylib                  0x00000002205b2e28 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24 (__threading_support:278)
3   JavaScriptCore                  0x0000000228f44524 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 104 (condition_variable:204)
4   JavaScriptCore                  0x0000000228f48300 bmalloc::Scavenger::threadRunLoop() + 172 (condition_variable:213)
5   JavaScriptCore                  0x0000000228f47ac4 bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*) + 12 (Scavenger.cpp:352)
6   JavaScriptCore                  0x0000000228f494b8 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::Scavenger*), bmalloc::Scavenger*> >(void*) + 44 (type_traits:4428)
7   libsystem_pthread.dylib         0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
8   libsystem_pthread.dylib         0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
9   libsystem_pthread.dylib         0x0000000220f92070 thread_start + 4

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib          0x0000000220efb088 kevent + 8
1   Realm                           0x00000001025f112c realm::_impl::ExternalCommitHelper::listen() + 212 (external_commit_helper.cpp:202)
2   Realm                           0x00000001025f1d20 std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0>::operator()() + 28 (external_commit_helper.cpp:159)
3   Realm                           0x00000001025f1ca8 std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::__execute() + 28 (future:1039)
4   Realm                           0x00000001025f1e58 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::*)(), std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >*> >(void*, void*) + 64 (type_traits:4232)
5   libsystem_pthread.dylib         0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
6   libsystem_pthread.dylib         0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
7   libsystem_pthread.dylib         0x0000000220f92070 thread_start + 4

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib          0x0000000220ef6ac8 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000220ef6940 mach_msg + 72 (mach_msg.c:103)
2   CoreFoundation                  0x000000022131d2f0 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3   CoreFoundation                  0x000000022131af80 __CFRunLoopRun + 1404 (CFRunLoop.c:2971)
4   CoreFoundation                  0x0000000221254abc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5   AVFAudio                        0x0000000227a31cd0 GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:92)
6   AVFAudio                        0x0000000227a5ce94 CAPThread::Entry(CAPThread*) + 88
7   libsystem_pthread.dylib         0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
8   libsystem_pthread.dylib         0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
9   libsystem_pthread.dylib         0x0000000220f92070 thread_start + 4

Thread 7:
0   libsystem_pthread.dylib         0x0000000220f92064 start_wqthread + 0

Thread 8:
0   libsystem_pthread.dylib         0x0000000220f92064 start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib         0x0000000220f92064 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000282a1a766
    x4: 0x0000000103938280   x5: 0x0000000000000020   x6: 0x0046000004210103   x7: 0x00000000ffba0038
    x8: 0x0000000000000800   x9: 0x0000000220f98b44  x10: 0x0000000220f9408c  x11: 0x000000025b529562
   x12: 0x000000025b529562  x13: 0x0000000000000018  x14: 0x0000000000000001  x15: 0x0000000000000881
   x16: 0x0000000000000148  x17: 0x0000000000000000  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000259099100  x21: 0x000000000000002d  x22: 0x0000000000000303  x23: 0x00000002590991e0
   x24: 0x0000000000000000  x25: 0x000000024d2a3912  x26: 0x0000000102eec200  x27: 0x000000025909cf10
   x28: 0x0000000000000001   fp: 0x000000016ddd9960   lr: 0x0000000220f98c70
    sp: 0x000000016ddd9930   pc: 0x0000000220f186a4 cpsr: 0x00000000

仅供引用,MyFile.swift 的第 17 行是这样的:

@objc class RealmDatabase : NSObject
{
    var configuration:Realm.Configuration?  = nil // Line 17

这只是一个可选的声明,所以我看不出这会导致什么问题。

关于问题可能是什么,还有其他线索吗?

最佳答案

只是在黑暗中的野蛮刺杀:

发生此错误的一个原因是 ARC弱引用

iOS 中的一个常见模式是委托(delegate) 模式,其中构造一个单独的对象来处理另一个对象的消息。这些引用通常,因此您不会获得内存循环,其​​中两个对象拥有彼此的强引用。

现在,您可能在代码的某处生成一个 RealmDatabase 实例,并将其作为一个 引用传递给另一个对象。如果是这种情况,那么一旦对它的所有强引用都消失了,它就会被 ARC 销毁:例如,如果它被某种 Realm 连接实例引用,并且连接断开。

这只是一个大胆的猜测,但如果您在某些事件发生时动态创建 RealmDatabase 实例,store 对这些对象的引用将在存储的属性 在某些对象上,作为可选的,以防止它们被 ARC 破坏。

祝你好运,我希望你能为你的用户解决这个问题。

关于ios - 无法从此崩溃日志确定原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50767626/

有关ios - 无法从此崩溃日志确定原因的更多相关文章

  1. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  2. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  3. ruby-on-rails - 无法使用 Rails 3.2 创建插件? - 2

    我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby​​1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在

  4. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  5. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  6. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

  7. Ruby Readline 在向上箭头上使控制台崩溃 - 2

    当我在Rails控制台中按向上或向左箭头时,出现此错误:irb(main):001:0>/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in`blockin_rl_dispatch_subseq':invalidbytesequenceinUTF-8(ArgumentError)我使用rvm来管理我的ruby​​安装。我正在使用=>ruby-2.0.0-p247[x86_64]我使用bundle来管理我的gem,并且我有rb-readline(0.4.2)(人们推荐的最少

  8. ruby - 无法覆盖 irb 中的 to_s - 2

    我在pry中定义了一个函数:to_s,但我无法调用它。这个方法去哪里了,怎么调用?pry(main)>defto_spry(main)*'hello'pry(main)*endpry(main)>to_s=>"main"我的ruby版本是2.1.2看了一些答案和搜索后,我认为我得到了正确的答案:这个方法用在什么地方?在irb或pry中定义方法时,会转到Object.instance_methods[1]pry(main)>defto_s[1]pry(main)*'hello'[1]pry(main)*end=>:to_s[2]pry(main)>defhello[2]pry(main)

  9. ruby - 即时确定方法的可见性 - 2

    我正在编写一个方法,它将在一个类中定义一个实例方法;类似于attr_accessor:classFoocustom_method(:foo)end我通过将custom_method函数添加到Module模块并使用define_method定义方法来实现它,效果很好。但我无法弄清楚如何考虑类(class)的可见性属性。例如,在下面的类中classFoocustom_method(:foo)privatecustom_method(:bar)end第一个生成的方法(foo)必须是公共(public)的,第二个(bar)必须是私有(private)的。我怎么做?或者,如何找到调用我的cust

  10. ruby - 无法在 60 秒内获得稳定的 Firefox 连接 (127.0.0.1 :7055) - 2

    我使用的是Firefox版本36.0.1和Selenium-Webdrivergem版本2.45.0。我能够创建Firefox实例,但无法使用脚本继续进行进一步的操作无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055)错误。有人能帮帮我吗? 最佳答案 我遇到了同样的问题。降级到firefoxv33后一切正常。您可以找到旧版本here 关于ruby-无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055),我们在StackOverflow上找到一个类

随机推荐