2017-01-25 2 views
0

인증을 위해 kerberos를 사용하는 엔터프라이즈 iOS 응용 프로그램을 개발합니다. 각 요청마다 timeoutInterval = 30이 있습니다. 사용자가 암호를 입력하고 요청 제한 시간 전에 암호 확인을 통과하면 인증 및 URL 요청이 올바르게 작동합니다. 사용자가 제한 시간 후 (iOS에서 사용자에게 묻는 30 초 후)에 암호를 입력하면 CFNetwork는 다음에 응용 프로그램이 웹 서비스를 호출 할 때 응용 프로그램을 충돌시킵니다 (아래 그림 참조).URLRequest 시간 초과 후 사용자가 Kerberos를 통해 사용자 인증

무엇이 문제의 원인인지 잘 모르겠습니다. 다음과 같이 요청

Date/Time:  2017-01-24T03:16:42Z 
Launch Time:  2017-01-24T03:16:03Z 
OS Version:  iPhone OS 10.0.2 (14A456) 
Report Version: 104 

Exception Type: SIGSEGV 
Exception Codes: SEGV_ACCERR at 0x68 
Crashed Thread: 4 

Thread 0: 
0 libsystem_kernel.dylib    0x0000000189d8816c mach_msg_trap + 8 
1 CoreFoundation      0x000000018ad85cec __CFRunLoopServiceMachPort + 188 
2 CoreFoundation      0x000000018ad83908 __CFRunLoopRun + 1128 
3 CoreFoundation      0x000000018acb2048 CFRunLoopRunSpecific + 440 
4 GraphicsServices      0x000000018c735198 GSEventRunModal + 176 
5 UIKit        0x0000000190c85628 -[UIApplication _run] + 680 
6 UIKit        0x0000000190c80360 UIApplicationMain + 204 
7 SampleiOSApp     0x00000001000301bc main (AppDelegate.swift:15) 
8 libdyld.dylib      0x0000000189c945b8 start + 0 

Thread 1: 
0 libsystem_kernel.dylib    0x0000000189da6a88 __workq_kernreturn + 8 
1 libsystem_pthread.dylib    0x0000000189e68db4 start_wqthread + 0 

Thread 2: 
0 libsystem_kernel.dylib    0x0000000189da6a88 __workq_kernreturn + 8 
1 libsystem_pthread.dylib    0x0000000189e68db4 start_wqthread + 0 

Thread 3: 
0 libsystem_kernel.dylib    0x0000000189d8816c mach_msg_trap + 8 
1 CoreFoundation      0x000000018ad85cec __CFRunLoopServiceMachPort + 188 
2 CoreFoundation      0x000000018ad83908 __CFRunLoopRun + 1128 
3 CoreFoundation      0x000000018acb2048 CFRunLoopRunSpecific + 440 
4 Foundation       0x000000018b7c0b1c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300 
5 Foundation       0x000000018b7e160c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 
6 UIKit        0x00000001915fac7c -[UIEventFetcher threadMain] + 132 
7 Foundation       0x000000018b8be50c __NSThread__start__ + 1020 
8 libsystem_pthread.dylib    0x0000000189e6b860 _pthread_body + 236 
9 libsystem_pthread.dylib    0x0000000189e6b770 _pthread_start + 280 
10 libsystem_pthread.dylib    0x0000000189e68dbc thread_start + 0 

Thread 4 Crashed: 
0 CFNetwork       0x000000018b51ae60 std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::__hash_value_type<AuthenticationState::AuthInfoType, std::__1::unique_ptr<AuthenticationInfo, std::__1::default_delete<AuthenticationInfo> > >, void*>*> std::__1::__hash_table<std::__1::__hash_value_type<AuthenticationState::AuthInfoType, std::__1::unique_ptr<AuthenticationInfo, std::__1::default_delete<AuthenticationInfo> > >, std::__1::__unordered_map_hasher<AuthenticationState::AuthInfoType, std::__1::__hash_value_type<AuthenticationState::AuthInfoType, std::__1::unique_ptr<AuthenticationInfo, std::__1::default_delete<AuthenticationInfo> > >, AuthenticationState::AuthInfoTypeHasher, true>, std::__1::__unordered_map_equal<AuthenticationState::AuthInfoType, std::__1::__hash_value_type<AuthenticationState::AuthInfoType, std::__1::unique_ptr<AuthenticationInfo, std::__1::default_delete<AuthenticationInfo> > >, std::__1::equal_to<AuthenticationState::AuthInfoType>, true>, std::__1::allocator<std::__1::__hash_value_type<AuthenticationState::AuthInfoType, std::__1::unique_ptr<AuthenticationInfo, std::__1::default_delete<AuthenticationInfo> > > > >::find<AuthenticationState::AuthInfoType>(AuthenticationState::AuthInfoType const&) const + 0 
1 CFNetwork       0x000000018b516b90 AuthenticationState::updateState(HTTPResponseMessage*, _CFURLAuthChallenge*, _CFURLCredential const*, __SecTrust*) + 148 
2 CFNetwork       0x000000018b4f8724 HTTPProtocol::_protocolInterface_useCredential(_CFURLCredential const*, _CFURLAuthChallenge*) + 880 
3 CFNetwork       0x000000018b4f7008 ___ZN12HTTPProtocol19askAccountsForCredsEh_block_invoke_2 + 240 
4 libdispatch.dylib     0x0000000189c611c0 _dispatch_client_callout + 12 
5 libdispatch.dylib     0x0000000189c6cb24 _dispatch_block_invoke_direct + 372 
6 CFNetwork       0x000000018b5f2e98 RunloopBlockContext::_invoke_block(void const*, void*) + 32 
7 CoreFoundation      0x000000018acb19a8 CFArrayApplyFunction + 64 
8 CFNetwork       0x000000018b5f2d7c RunloopBlockContext::perform() + 132 
9 CFNetwork       0x000000018b5f40a4 MultiplexerSource::perform() + 308 
10 CFNetwork       0x000000018b5f3e10 MultiplexerSource::_perform(void*) + 60 
11 CoreFoundation      0x000000018ad86278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20 
12 CoreFoundation      0x000000018ad85bc0 __CFRunLoopDoSources0 + 520 
13 CoreFoundation      0x000000018ad837c0 __CFRunLoopRun + 800 
14 CoreFoundation      0x000000018acb2048 CFRunLoopRunSpecific + 440 
15 CFNetwork       0x000000018b49fcec +[NSURLConnection(Loader) _resourceLoadLoop:] + 332 
16 Foundation       0x000000018b8be50c __NSThread__start__ + 1020 
17 libsystem_pthread.dylib    0x0000000189e6b860 _pthread_body + 236 
18 libsystem_pthread.dylib    0x0000000189e6b770 _pthread_start + 280 
19 libsystem_pthread.dylib    0x0000000189e68dbc thread_start + 0 

내 코드 :

여기 queue
let manager = Alamofire.SessionManager.default 
manager.retrier = RetryingManager() 
let request: Alamofire.Request = manager.request(httpRequest as! URLRequestConvertible) 
    .validate(statusCode: 200..<300) 
    .validate(contentType: ["application/json"]) 
    .responseObject(queue: queue, completionHandler: { 
     (response: DataResponse<T>) in 

     if let JSON = response.result.value { 
      DispatchQueue.main.async { 
       debugPrint("JSON: \(JSON)") 
       // callback with the data 
       completion(JSON, nil) 
      } 
     } else if let resultError = response.result.error { 
      let errorMessage = WebServerErrorHelper.createErrorMessage(resultError: resultError, statusCode: response.response?.statusCode, serverData: response.data) 
      DispatchQueue.main.async { 
       completion(nil, errorMessage) 
      } 
     } 
    }) 

는 동시 DispatchQueue이고 httpRequesttimeInterval는 30로 설정된다. 문제를 해결하는 방법에 대한 단서가 없습니다. 미리 감사드립니다.

답변

0

이것은 CFNetwork의 버그이며, iOS 10.3.3

에서 수정되었습니다.