2017-01-25 8 views
0

kerberosを認証に使用するエンタープライズiOSアプリケーションを開発しました。私は各要求に対してtimeoutInterval = 30を持っています。 ユーザーがパスワードを入力して、要求のタイムアウト前にパスワードの確認を渡すと、認証とURLの要求は正常に機能します。 タイムアウト後(ユーザーにプロンプ​​トを表示してから30秒後)にパスワードを入力すると、次にアプリケーションがWebサービスを呼び出すときに、CFNetworkがアプリケーションをクラッシュします。URLRequestのタイムアウトが発生し、ユーザーがKerberos経由で認証すると、CFNetworkがクラッシュする

問題の原因は不明です。次のように

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 

要求のための私のコードは次のとおりです。ここで

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) 
      } 
     } 
    }) 

queueは、同時DispatchQueueあるとtimeIntervalhttpRequest 30として設定されています。 私はこの問題を解決する手掛かりはありません。前もって感謝します。

答えて

0

これはCFNetworkのバグで、iOS 10.3.3で修正されました。

関連する問題