2013-02-07 2 views
0

내 앱에 크래시가 발생합니다.CA :: Layer :: set_position을 통한 임의 크래시

같은 장소에서 발생하지만 항상 발생하는 것은 아닙니다. 나는 문제를 발견하지 못했다.

Incident Identifier: EB73AE61-00FB-4282-8F1D-B8ECEC19E02D 
CrashReporter Key: 6f005b28e796b18f3ab2687bb364b2be1eb137cd 
Hardware Model:  iPhone5,2 
Path:   /var/mobile/Applications/BF2F1016-8C00-40A3-BB75-0933F53741F0/*******.app/****** 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Crashed Thread: 0 

Last Exception Backtrace: 
0 CoreFoundation     0x312d13e2 __exceptionPreprocess + 158 
1 libobjc.A.dylib     0x38fc295e objc_exception_throw + 26 
2 CoreFoundation     0x312d1302 +[NSException raise:format:] + 102 
3 QuartzCore      0x32e8e106 CA::Layer::set_position(CA::Vec2<double> const&, bool) + 206 
4 QuartzCore      0x32e8e02e -[CALayer setPosition:] + 46 
5 QuartzCore      0x32e8dfc2 -[CALayer setFrame:] + 554 
6 UIKit        0x330e1bd2 -[UIView(Geometry) setFrame:] + 230 
7 UIKit        0x330e18fc -[UIImageView _setViewGeometry:forMetric:] + 180 
8 UIKit        0x330e183a -[UIImageView setFrame:] + 42 
9 etapes       0x0006de1c 0x5c000 + 73244 
10 UIKit        0x33203136 -[UIScrollView _endPanWithEvent:] + 3694 
11 UIKit        0x3321c520 -[UIScrollView handlePan:] + 120 
12 UIKit        0x331fdc5c _UIGestureRecognizerSendActions + 124 
13 UIKit        0x331c539c -[UIGestureRecognizer _updateGestureWithEvent:] + 388 
14 UIKit        0x333b215e ___UIGestureRecognizerUpdate_block_invoke_0543 + 42 
15 UIKit        0x330e987e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 214 
16 UIKit        0x330e82c8 _UIGestureRecognizerUpdate + 1160 
17 UIKit        0x330f31e2 -[UIWindow _sendGesturesForEvent:] + 762 
18 UIKit        0x330f2dae -[UIWindow sendEvent:] + 86 
19 UIKit        0x330e08dc -[UIApplication sendEvent:] + 376 
20 UIKit        0x330e01ea _UIApplicationHandleEvent + 6194 
21 GraphicsServices     0x34df75f2 _PurpleEventCallback + 586 
22 GraphicsServices     0x34df7222 PurpleEventCallback + 30 
23 CoreFoundation     0x312a63e2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30 
24 CoreFoundation     0x312a6386 __CFRunLoopDoSource1 + 134 
25 CoreFoundation     0x312a520a __CFRunLoopRun + 1378 
26 CoreFoundation     0x31218238 CFRunLoopRunSpecific + 352 
27 CoreFoundation     0x312180c4 CFRunLoopRunInMode + 100 
28 GraphicsServices     0x34df6336 GSEventRunModal + 70 
29 UIKit        0x331342b4 UIApplicationMain + 1116 
30 etapes       0x0005e15e 0x5c000 + 8542 
31 etapes       0x0005e114 0x5c000 + 8468 

//////////////////////////// SECOND : 여기

두 개의 충돌 로그입니다 충돌 로그 ///////////////////////////////////

Incident Identifier: 4FE03135-D442-4CEA-B230-8322647262EE 
CrashReporter Key: 6f005b28e796b18f3ab2687bb364b2be1eb137cd 
Hardware Model:  iPhone5,2 
Process:   etapes [2916] 
Path:   /var/mobile/Applications/BF2F1016-8C00-40A3-BB75-0933F53741F0/******.app/**** 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x00000064 
Crashed Thread: 0 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 UIKit        0x33df7b06 -[UIView(CALayerDelegate) actionForLayer:forKey:] + 138 
1 QuartzCore      0x33ba7786 -[CALayer actionForKey:] + 70 
2 QuartzCore      0x33ba7732 _ZL12actionForKeyP7CALayerPN2CA11TransactionEP8NSString + 54 
3 QuartzCore      0x33ba7626 CA::Layer::begin_change(CA::Transaction*, unsigned int, objc_object*&) + 126 
4 QuartzCore      0x33ba2322 CA::Layer::setter(unsigned int, _CAValueType, void const*) + 178 
5 QuartzCore      0x33bce782 -[CALayer setBackgroundColor:] + 30 
6 UIKit        0x33e0ef50 -[UIView(Internal) _setBackgroundCGColor:withSystemColorName:] + 1016 
7 etapes       0x000fc8d2 0xdd000 + 129234 
8 etapes       0x000f8c6a 0xdd000 + 113770 
9 CoreFoundation     0x31fe9ad0 __invoking___ + 64 
10 CoreFoundation     0x31f4128a -[NSInvocation invoke] + 286 
11 Foundation      0x328eaf60 -[NSInvocationOperation main] + 108 
12 Foundation      0x32874a84 -[__NSOperationInternal start] + 836 
13 Foundation      0x328ecfe2 __block_global_6 + 98 
14 libdispatch.dylib     0x3a0f1790 _dispatch_call_block_and_release + 8 
15 libdispatch.dylib     0x3a0f15d8 _dispatch_client_callout + 20 
16 libdispatch.dylib     0x3a0f4e40 _dispatch_main_queue_callback_4CF + 224 
17 CoreFoundation     0x31fba1ac __CFRunLoopRun + 1284 
18 CoreFoundation     0x31f2d238 CFRunLoopRunSpecific + 352 
19 CoreFoundation     0x31f2d0c4 CFRunLoopRunInMode + 100 
20 GraphicsServices     0x35b0b336 GSEventRunModal + 70 
21 UIKit        0x33e492b4 UIApplicationMain + 1116 
22 etapes       0x000df15e 0xdd000 + 8542 
23 etapes       0x000df114 0xdd000 + 8468 

당신이 만약 자세한 내용을 원하면 사용할 수 있습니다! ,의 CALayer의 "프레임"Apple's docs에 따라 "계산 된 재산"입니다

self.imageviewFondArticle.frame = CGRectMake((-((_imageviewFondArticle.frame.size.height*imageRatio)-320)/2),0, _imageviewFondArticle.frame.size.height*imageRatio, _imageviewFondArticle.frame.size.height); 
+1

이들은 두 가지 다른 스택 추적이므로 동일한 근본 원인이있는 경우 힙 손상 문제 일 가능성이 큽니다. 좀비 도구 아래에서 실행하고 어떤 것이 있는지 찾아보십시오. –

+0

좀비 악기를 테스트했지만 시뮬레이터와 충돌하지 않습니다. 테스트 10 분 후 좀비 오브젝트가 없습니다. – VivienCormier

+0

문제는 관련 AFNetworking ... 진행 중 – VivienCormier

답변

1

첫째 :

연구 한 후, 여기에 문제가 코드입니다. 범위, 앵커 포인트 또는 위치 속성을 설정하고자 할 수 있습니다. 반면 UIView의 프레임은 설정되고 애니메이션 될 수 있습니다.

두 번째로, 나는이 사고에 직면했기 때문에 두 번째로 올랐습니다. CALayer의 position 속성을 설정할 때 발생했습니다. 던져진 예외가 유효하지 않은 위치에 대한 것으로 밝혀졌습니다. 좌표 중 하나가 NaN이었습니다. @ try- @ catch 블록에 "layer.position = pos"를 래핑하여 이것을 발견했습니다. 잘못된 위치의 근본 원인을 수정하면 문제가 해결되었습니다. 이것을 바탕으로, 나는 당신이 잘못된 "imageRatio"값을 가지고 있다고 생각할 것입니다.

+0

이유는 모르겠지만 정수 "imageRation"은 순간 이후의 NAN 값을 반환합니다. 이 문제는 iOS 6.1에서만 발생합니다. – VivienCormier