美文网首页
修复crash心得

修复crash心得

作者: tom__zhu | 来源:发表于2021-01-29 14:43 被阅读0次
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY
    Triggered by Thread:  56
    
    Thread 56 name:
    Thread 56 Crashed:
    0   libsystem_kernel.dylib          0x00000001bc37b414 __pthread_kill + 8
    1   libsystem_pthread.dylib         0x00000001d8893b40 pthread_kill + 272 (pthread.c:1388)
    2   libsystem_c.dylib               0x00000001987a0bf4 __abort + 116 (abort.c:147)
    3   libsystem_c.dylib               0x00000001987a0b80 abort + 116 (abort.c:118)
    4   libsystem_malloc.dylib          0x000000019e82649c malloc_vreport + 560 (malloc_printf.c:183)
    5   libsystem_malloc.dylib          0x000000019e82667c malloc_report + 64 (malloc_printf.c:192)
    6   libsystem_malloc.dylib          0x000000019e81af68 free + 532 (malloc.c:1862)
    7   CoreFoundation                  0x000000018f3598fc -[__NSArrayM insertObject:atIndex:] + 360 (NSArrayM_Common.h:260)
    8   XXXPhoneVideo                   0x0000000108cbdac0 -[XXImgsPrefetcherMgr prefetchImgsWithUrls:completedBlock:] + 160 (XXImgsPrefetcher.m:194)
    9   XXXPhoneVideo                   0x0000000108cbd9cc -[XXImgsPrefetcherMgr prefetchImgsUrlByLaunch:completedBlock:] + 184 (XXImgsPrefetcher.m:180)
    10  XXXPhoneVideo                   0x0000000106fa9a84 +[XXPlayerPreInitManager preLoadHighLevelCloudImages] + 220 (XXPlayerPreInitManager.m:209)
    11  libdispatch.dylib               0x000000018f06f24c _dispatch_call_block_and_release + 32 (init.c:1454)
    12  libdispatch.dylib               0x000000018f070db0 _dispatch_client_callout + 20 (object.m:559)
    13  libdispatch.dylib               0x000000018f073ddc _dispatch_queue_override_invoke + 692 (inline_internal.h:2548)
    14  libdispatch.dylib               0x000000018f08193c _dispatch_root_queue_drain + 356 (inline_internal.h:2589)
    15  libdispatch.dylib               0x000000018f082120 _dispatch_worker_thread2 + 116 (queue.c:6777)
    16  libsystem_pthread.dylib         0x00000001d88947c8 _pthread_wqthread + 216 (pthread.c:2219)
    17  libsystem_pthread.dylib         0x00000001d889b75c start_wqthread + 8
    

    这个崩溃从堆栈上看比较奇怪,是在系统进行malloc内存分配的时候出现了异常触发了abort()函数。同时这段业务代码调用并不存在可能触发这类异常的逻辑,所以可以大胆猜测这份Crash实际上堆栈已经被破坏了(Heap corruption),最重要的是堆错误的时候可能是在指针出现损坏(野指针)后很久才会被访问到导致崩溃。所以这份奇怪的Crash实际上并非真正导致崩溃的现场,这种情况就需要借助其他内存排查工具去解决。

    Crash及其分析技巧的一点心得

    相关文章

      网友评论

          本文标题:修复crash心得

          本文链接:https://www.haomeiwen.com/subject/uvuqtltx.html