2012-09-05 23 views
5

Sadece TestFlight ad hoc dağıtımlarında gerçekleşen garip bir çöküş var. Kazaya neden olan şeyin ne olduğunu biliyorum (basit bir döngü, aşağıya bakın), fakat neden simülatörümde veya iPhone veya iPad'de (bir geliştirme profili ile) kilitlenmediğini anlamıyorum.iOS TestFlight Aygıtında SIGSEGV Kilitlenme

Kazaları izlemek için sürekli yapılar dağıtırım ancak sonunda vazgeçtim. Bu hatayı daha verimli bir şekilde nasıl izleyebilirim?

İşte TestFlight kazasında raporu:

Exception reason 

SIGSEGV 

Stacktrace 

PRIMARY THREAD THREAD 0 

0 Meernotes 0x0019649a testflight_backtrace + 158 
1 Meernotes 0x001970c4 TFSignalHandler + 244 
2 libsystem_c.dylib 0x32d9d7ec _sigtramp + 48 
3 libobjc.A.dylib 0x37d34eac _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 224 
4 libobjc.A.dylib 0x37d34eac _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 224 
5 libobjc.A.dylib 0x37d34dc8 _objc_autoreleasePoolPop + 12 
6 CoreFoundation 0x358e1cfe _CFAutoreleasePoolPop + 18 
7 UIKit 0x333d5c92 _wrapRunLoopWithAutoreleasePoolHandler + 42 
8 CoreFoundation 0x35965b1a __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18 
9 CoreFoundation 0x35963d56 __CFRunLoopDoObservers + 258 
10 CoreFoundation 0x359640b0 __CFRunLoopRun + 760 
11 CoreFoundation 0x358e74a4 CFRunLoopRunSpecific + 300 
12 CoreFoundation 0x358e736c CFRunLoopRunInMode + 104 
13 GraphicsServices 0x37583438 GSEventRunModal + 136 
14 UIKit 0x333f3cd4 UIApplicationMain + 1080 
15 Meernotes 0x000850da main (main.m:16) 
16 Meernotes 0x0008508f start + 39 

Ve burada tetikliyor kodudur (ancak simülatör/iphone ince): Ben buna bir bakmak vardı

 while (textStillFits) { 

     textToBeKeptBeforeCutting = textToBeKept; 
     textToBeMovedBeforeCutting = textToBeMoved; 

     rangeCutOffPosition = [settings determineFirstCutOffRangeOfString:textToBeMoved]; 
     textToBeKeptTemp = [textToBeMoved substringToIndex:rangeCutOffPosition.location]; 
     textToBeMovedTemp = [textToBeMoved substringFromIndex:rangeCutOffPosition.location]; 
     textToBeMoved = textToBeMovedTemp; 
     textToBeKept = [NSString stringWithFormat:@"%@%@", textToBeKept, textToBeKeptTemp]; 
     NSUInteger l = [settings linesOfText:textToBeKept]; 
     if (l > maxLines) { 
      textStillFits = NO; 
      textToBeKept = textToBeKeptBeforeCutting; 
      textToBeMoved = textToBeMovedBeforeCutting; 
      // brakes here! 
     }else { 
      textStillFits = YES; 
     } 
    } 

ancak yardımcı olmadı: ad hoc iphone sigsegv crash

@ott NSNotFound'un buna neden olabileceğini belirttiği gibi, daha fazla bağlamda:

-(NSRange)determineFirstCutOffRangeOfString:(NSString *)s { 

    NSRange rangeSpace = [s rangeOfString:@" " options:NSCaseInsensitiveSearch]; 
    NSRange rangeReturn = [s rangeOfString:@"\n" options:NSCaseInsensitiveSearch]; 
    if (rangeSpace.location == NSNotFound && rangeReturn.location == NSNotFound) { 
     rangeSpace = NSMakeRange(1, 0); // don't take 0,0 as this will lead to endless loop 
     rangeReturn = NSMakeRange(1, 0); 
     NSLog(@"NEITHER SPACE NOR RETURN FOUND"); 
    } 

    NSRange rangeCutOffPosition = NSMakeRange(0, 0); 
    if (rangeSpace.location < rangeReturn.location) { 
     // i.e. if the space char is the lowest char where you can cut off 
     rangeCutOffPosition = NSMakeRange(rangeSpace.location+1,0); // +1, i.e. always cut off AFTER the space 
    } else { 
     // i.e. if the return char is the lowest char where you can cut off 
     rangeCutOffPosition = NSMakeRange(rangeReturn.location+1,0); // +1, i.e. always cut off AFTER the return 
    } 

    return rangeCutOffPosition; 
} 
+1

"rangeCutOffPosition" öğesi "NotFound" gibi bir şey olabilir mi? Cihaz, simülatörün onu görmezden geldiği yerlerde genellikle daha seçicidir. Neler olup bittiğini görmek için bazı NSLog() 'lar ekleyebilir ya da adım adım atabilirsiniz. –

+0

@ott Her zaman NSRange aralığını başlatıyorumCutOffPosition = NSMakeRange (0, 0); bu yüzden NSNotFound olamaz. Bununla birlikte, bazı diğer aralıkları kontrol etmek için bazı yöntemlerim var ve bu NSNotFound'u iade edebilir. Ama bu nasıl bir sorun olabilir? –

+0

@ott Yukarıda daha fazla kod içeriği sağladım. Yardım ettiğin için teşekkür ederim! –

cevap

0

En son sdk 1.2.4 düzeltmeleri bu sorunu giderir!

İlgili konular