how to understand Crash Log of iPhone

前端 未结 5 2003
[愿得一人]
[愿得一人] 2020-12-16 17:28

i only know it Crash not run out of memory.

how did i know which it cause of error?

Incident Identifier: 242C320A-763C-407E-BD40-443E3E9B611C
CrashRe         


        
相关标签:
5条回答
  • 2020-12-16 18:06

    I came across the same issue and found a repro case: When I flick through the images in the FlowCoverView and immediately hit the done button, it crashes with the exact same crash log.

    Looks like the done action causes the FlowCoverViewController to be released, which causes the FlowCoverView’s delegate to zombie out.

    If the FlowCoverView’s touchesEnded is in progress during this time, it leads to a crasher.

    There may be a better way to fix this, but here’s what I attempted that seemed to have solved this problem:

    In the FlowCoverViewController’s dealloc method, I tried to access the FlowCoverView to set it’s delegate to nil:

    -(void)dealloc
    {
    NSArray *viewsArray = [self.view subviews];
    for (UIView*v in viewsArray)
    {
    if ([v isKindOfClass:[FlowCoverView class]])
    {
    FlowCoverView *fcv = (FlowCoverView*)v;
    fcv.delegate = nil;
    }
    }
    ...
    }
    

    Let me know if this solved your crash.

    0 讨论(0)
  • 2020-12-16 18:16

    The problem arises in the method numTiles of FlowCoverView. You can look in there. Apparently it's an unknown selector sent to an object, as it fails in a objc_msgSend_....

    0 讨论(0)
  • 2020-12-16 18:17
    1. If you are running Snow Leopard, turn on the Static Analyzer in your project.
    2. Turn on NSZombieEnabled http://www.frogameleon.com/blog/last-night-an-iphone-zombie-nszombieenabled-saved-my-life
    3. Review the other Debugging docs and use the tools Apple provides. http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/130-Debugging_Applications/debugging_applications.html
    0 讨论(0)
  • 2020-12-16 18:23

    First, you should understand that there are four types of crashes and the log report depends on the type of crash:

    1. Watchdog timeout
    2. User force/quit
    3. Low memory termination
    4. Bugs

    The log report is divided into the following sections:

    Process information where

    CrashReporter Key: Unique anonymous device id   
    Process: Name[id]
    Version: CFBundleVersion(CFBundleShortVersionString)
    


    Incident Identifier: 242C320A-763C-407E-BD40-443E3E9B611C
    CrashReporter Key:   307097bc0924dac79e5352eb10692943c0ef05ad
    Process:         AsianDelight [4894]
    Path:            /var/mobile/Applications/7A8FF881-A033-45B9-8F728478217821E9/AsianDelight.app/AsianDelight
    Identifier:      AsianDelight
    Version:         ??? (???)
    Code Type:       ARM (Native)
    Parent Process:  launchd [1]
    


    Basic information

    Date/Time:       2010-01-20 16:32:49.285 +0700
    OS Version:      iPhone OS 3.1.2 (7D11)
    Report Version:  104
    


    Exception In this case there is no insightful information about the crash but, in other cases you can find the cause of the exception here.

    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
    Crashed Thread:  0
    


    Backtrace (list of active frames) of the thread where the crash happened, Thread 0 in this case.

    In the line
    7 AsianDelight 0x00004b3a -[FlowCoverView numTiles] (FlowCoverView.m:250)
    7 is the frame number
    AsianDelight is the name of the binary
    0x00004b3a is the address of the function
    [FlowCoverView numTiles] (FlowCoverView.m:250) file and number line. Sometimes it might be something like 0x10009c000 + 137220 this the address base and offset. Through symbolication this can be mapped to source code. To do the symbolication, just drag and drop the crash log into the Xcode Organizer window in the device log section. Note that Xcode should have access to the binary and the .dsYM. Often Xcode fails to symbolicate the crash report, if this is the case check this link that explains how to do it manually.

    Thread 0 Crashed:
    0   libobjc.A.dylib                 0x00007532 realizeClass + 18
    1   libobjc.A.dylib                 0x00007578 realizeClass + 88
    2   libobjc.A.dylib                 0x00007578 realizeClass + 88
    3   libobjc.A.dylib                 0x00007e76 prepareForMethodLookup + 26
    4   libobjc.A.dylib                 0x0000523e lookUpMethod + 34
    5   libobjc.A.dylib                 0x00002a0a _class_lookupMethodAndLoadCache + 6
    6   libobjc.A.dylib                 0x00002740 objc_msgSend_uncached + 20
    7   AsianDelight                    0x00004b3a -[FlowCoverView numTiles] (FlowCoverView.m:250)
    8   AsianDelight                    0x000048ea -[FlowCoverViewupdateAnimationAtTime:] (FlowCoverView.m:487)
    

    Thread state shows the values and registers when the crash happened

    Thread 0 crashed with ARM Thread State:
    r0: 0x0012cd00    r1: 0xffffffff      r2: 0x80000000      r3: 0x00000002
    r4: 0x00000000    r5: 0x0012cd00      r6: 0x38680878      r7: 0x2ffff3e4
    r8: 0x00145798    r9: 0x001fc098     r10: 0x00000000     r11: 0x2ffff628
    ip: 0x00000004    sp: 0x2ffff3cc      lr: 0x3240357f      pc: 0x32403532
    


    Binaries loaded when the crash happened

    Binary Images:
    0x1000 -     0x7fff +AsianDelight armv6  <df65e87046878ce496d0b1ac952247a1> /var/mobile/Applications/7A8FF881-A033-45B9-8F72-8478217821E9/AsianDelight.app/AsianDelight
    0x6a000 -    0x6bfff  dns.so armv7  <35ac487c38e38ed5810d5ed0d5c67546>/usr/lib/info/dns.so
    0x3541000 - 
    


    This answer is based on the WWDC 2010 session 317 Understanding Crash Reports on iPhone OS by Madhuwanti Vaidya and Bill Dirks, which I found thanks to Pierre's answer.

    Here is the pdf from the session: http://adcdownload.apple.com//wwdc_2010/wwdc_2010_video_assets__pdfs/317__understanding_crash_reports_on_iphone_os.pdf

    0 讨论(0)
  • 2020-12-16 18:27

    Have a look at Session 317 from the WWDC 10 videos. http://developer.apple.com/videos/wwdc/2010/

    0 讨论(0)
提交回复
热议问题