문제

나는 "plcrashreport"를 사용하여 충돌 정보를 수집 한 다음 앱을 더 안정적으로 만들려고했지만 보고서는 다음과 같습니다 (통화 스택도없고 어떻게 사용한다고 가정합니까?) : :

"예외 :"부분, 예외 : (null) : (null), "ExceptionName"및 "ExceptionReason"이어야합니다. 대부분의 경우 "NULL"이기도합니다. 유용하지 않다고 생각합니다 ...

2009-11-13 23:43:04 +0800- 신호 SIGSEGV (코드 SEGV_ACCERR, 주소 = 0XFFFFFFFFFFC0F4186B)

  • 예외 : (null) : (null) - 스레드 0 :

    • 추락 : 1
    • 스택 (54 프레임) :, n 806128664, n 807756495, n 816280840, n 816247 068, n 817901396, n 807756495, n 816280840, n 8191110108, <816280280840 816406620,n 807756495,n 806130012,n 119241,n 812165747,n 812164839 ,n 812379009,n 818127880,n 807885435,n 807923065,n 818122176,n 818130772,n 816625560, n 816626608, n 816627024, n 816641892, n 816651496, n 816654628, n 81665424, n 146455, n 80792363, n 81611156, n 80792363, n 81611156, n 80792363, 816119156,n 816119004,n 816524332,n 816525956,n 816521588,n 816212028,n 816151252,n 816147980,n 827758796,n 827769116,n 837343488,n 821391952,n 807840887, n 807836793, n 807834407, n 827752032, n 816118388, n816157144, n 20421
도움이 되었습니까?

해결책

나는 그것을 사용하지 않았지만 모든 것을 레지스터로 내려 놓은 분할 결함이 있었기 때문에 세부 사항을 얻지 못할 것이라고 확신합니다. plcrashreport 인스턴스는 다른 모든 것과 함께 죽었 기 때문에보고 할 수 없습니다.

plcrashreport 인스턴스는 응용 프로그램 자체 내에서 실행되므로 앱이 단단 해지면 세부 사항이 없습니다.

다른 팁

스택 추적이란 무엇입니까?

메소드 중 하나가 호출 될 때마다 스택에이를 넣습니다. 스택 추적은 앱이 충돌 한 클래스와 메소드를 찾는 방법으로 버그를 한 줄로 좁히는 방법입니다.

물론이를 위해서는 스택 추적을 전체 16 진수 로하보다는 읽을 수 있어야합니다.

ATOS를 확인하십시오.

이런 일이 다시 발생하지 않도록 ATOS를 사용 하여이 통화 스택을 해석 할 수 있습니다. 참조 스택 추적 Cocoa Dev Wiki의 페이지는이 숫자를 의미있는 방법으로 변환하는 방법에 대한 토론 및 코드를위한 페이지입니다.

이를 충돌 리포터와 통합하는 방법을 찾아야합니다. UKCrashRashRoporter를 사용하고 ULI 코드의 코드를 수정하여 예외가 있으면 읽기 가능한 스택 추적을 충돌 보고서에 추가합니다.

코드 샘플

EsstackTrace 클래스에서 영감을 얻었고 여기에 내가하는 일이 있습니다.

-(void)logAndSaveStackTrace {
    NSString *stackTrace = [[self userInfo] objectForKey:NSStackTraceKey];
    NSString *atosCommand;
    if (stackTrace) {
        // If the stack trace key is present, pull out the addresses and convert to method names using atos.
        atosCommand = [NSString stringWithFormat:@"/usr/bin/atos -p %d %@ | tail -n +3 | head -n +%d | c++filt | cat -n",
                         [[NSProcessInfo processInfo] processIdentifier],
                         stackTrace,
                         ([[stackTrace componentsSeparatedByString:@"  "] count] - 4)];

    } else {
        // If there isn't a stack trace key or it's nil, try and work out the stack using the internal callStackReturn addresses method.
        NSArray *stackTraceArray = [self callStackReturnAddresses];
        atosCommand = [NSString stringWithFormat:@"/usr/bin/atos -p %d %@",
                       [[NSProcessInfo processInfo] processIdentifier],
                       [stackTraceArray componentsJoinedByString:@" "]];
    }

    NSString *readableStackTrace = [ShellTask executeShellCommandSynchronously:atosCommand];

    NSString *exceptionMessageForCrashReport = [NSString stringWithFormat:@"An exception of type %s occured.\n%s\nStack trace:\n%@", 
                                                [[self name] cStringUsingEncoding:NSUTF8StringEncoding], 
                                                [[self reason] cStringUsingEncoding:NSUTF8StringEncoding],
                                                readableStackTrace];

    [[NSUserDefaults standardUserDefaults] setObject:exceptionMessageForCrashReport forKey:@"uncaughtExceptionReport"];
    [[NSUserDefaults standardUserDefaults] synchronize];

    // Log the exception to the console too.
    NSLog(@"%@", exceptionMessageForCrashReport);
}

의존성 Ahoy!

물론,이 접근법의 문제 중 하나는 ATO에 대한 의존성을 소개한다는 것입니다. 나는 그것이 10.5 이상에 표준으로 설치되어 있다고 들었지만 이것은 잘못되었을 수 있습니다. 결국 나는 내 앱이 찾을 수 없다면 ATO를 추가하는 작은 설치 프로그램을 만들 것입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top