{"action":"created","issue":{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/3599","repository_url":"https://api.github.com/repos/AFNetworking/AFNetworking","labels_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/3599/labels{/name}","comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/3599/comments","events_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/3599/events","html_url":"https://github.com/AFNetworking/AFNetworking/issues/3599","id":163553874,"number":3599,"title":"Deadlock in 3.1.0","user":{"login":"aduchate","id":2221917,"avatar_url":"https://avatars.githubusercontent.com/u/2221917?v=3","gravatar_id":"","url":"https://api.github.com/users/aduchate","html_url":"https://github.com/aduchate","followers_url":"https://api.github.com/users/aduchate/followers","following_url":"https://api.github.com/users/aduchate/following{/other_user}","gists_url":"https://api.github.com/users/aduchate/gists{/gist_id}","starred_url":"https://api.github.com/users/aduchate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduchate/subscriptions","organizations_url":"https://api.github.com/users/aduchate/orgs","repos_url":"https://api.github.com/users/aduchate/repos","events_url":"https://api.github.com/users/aduchate/events{/privacy}","received_events_url":"https://api.github.com/users/aduchate/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/labels/needs%20more%20information","name":"needs more information","color":"9559F0"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-03T09:06:31Z","updated_at":"2016-08-09T07:01:04Z","closed_at":null,"body":"I have got a race condition in AFNetworking that causes a deadlock, it happens about 1 out of 20 runs.\r\n\r\nWhile locked, \r\n\r\n`#3\t0x0000000100275dd0 in -[AFURLSessionManager setDelegate:forTask:] at AFNetworking/AFURLSessionManager.m:609\r\n`\r\nwaits for the lock while\r\n\r\n`#5\t0x000000010027684a in -[AFURLSessionManager removeDelegateForTask:] at AFNetworking/AFURLSessionManager.m:674\r\n`\r\nhas already acquired it and never releases it.\r\n\r\nThe problem seems to show up when the callback of a first call to AFNetworking provokes a second call to AFNetworking through a key value observing mechanism. \r\nIt seems that     \r\n\r\n[delegate cleanUpProgressForTask:task]; \r\n\r\nnever completes because (at  least in this occurence I am currently analyzing)\r\n\r\n    [self.downloadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))];\r\n\r\nlocks on a mutex.\r\n\r\nHere are the stack traces of the threads that are locked\r\n\r\n```\r\n#0\t0x00007fff9077dde6 in __psynch_mutexwait ()\r\n#1\t0x0000000100db0cc2 in _pthread_mutex_lock_wait ()\r\n#2\t0x00007fff82861fb7 in -[NSLock lock] ()\r\n#3\t0x0000000100275dd0 in -[AFURLSessionManager setDelegate:forTask:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:609\r\n#4\t0x000000010027607f in -[AFURLSessionManager addDelegateForDataTask:uploadProgress:downloadProgress:completionHandler:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:626\r\n#5\t0x0000000100277a06 in -[AFURLSessionManager dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:769\r\n#6\t0x000000010027783c in -[AFURLSessionManager dataTaskWithRequest:completionHandler:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:756\r\n#7\t0x00000001005fbae2 in -[SWGApiClient operationWithCompletionBlock:requestId:completionBlock:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/Core/SWGApiClient.m:209\r\n#8\t0x00000001005fe6f4 in -[SWGApiClient requestWithPath:method:pathParams:queryParams:formParams:files:body:headerParams:authSettings:requestContentType:responseContentType:responseType:completionBlock:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/Core/SWGApiClient.m:389\r\n#9\t0x00000001006e5d78 in -[SWGInsuranceApi getInsuranceWithInsuranceId:completionHandler:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/Api/SWGInsuranceApi.m:254\r\n#10\t0x000000010075c3c1 in __43-[SWGInsurabilityDto(Utils) withInsurance:]_block_invoke at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/SWGInsurabilityDto+Utils.m:31\r\n#11\t0x000000010074d97d in -[SWGObject(Utils) proxyForKey:withLoader:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/SWGObject+Utils.m:50\r\n#12\t0x000000010075c19c in -[SWGInsurabilityDto(Utils) withInsurance:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/SWGInsurabilityDto+Utils.m:30\r\n#13\t0x000000010075c0cf in -[SWGInsurabilityDto(Utils) insurance] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/SWGInsurabilityDto+Utils.m:25\r\n#14\t0x00007fff828a4407 in -[NSObject(NSKeyValueCoding) valueForKey:] ()\r\n#15\t0x00007fff828cc28c in -[NSKeyValueNestedProperty object:didAddObservance:recurse:] ()\r\n#16\t0x00007fff82877caf in -[NSObject(NSKeyValueObserverRegistration) _addObserver:forProperty:options:context:] ()\r\n#17\t0x00007fff82876a99 in -[NSObject(NSKeyValueObserverRegistration) addObserver:forKeyPath:options:context:] ()\r\n#18\t0x00007fff828cc2cc in -[NSKeyValueNestedProperty object:didAddObservance:recurse:] ()\r\n#19\t0x00007fff82877caf in -[NSObject(NSKeyValueObserverRegistration) _addObserver:forProperty:options:context:] ()\r\n#20\t0x00007fff82876a99 in -[NSObject(NSKeyValueObserverRegistration) addObserver:forKeyPath:options:context:] ()\r\n#21\t0x00007fff828cc2cc in -[NSKeyValueNestedProperty object:didAddObservance:recurse:] ()\r\n#22\t0x00007fff82877caf in -[NSObject(NSKeyValueObserverRegistration) _addObserver:forProperty:options:context:] ()\r\n#23\t0x00007fff82876a99 in -[NSObject(NSKeyValueObserverRegistration) addObserver:forKeyPath:options:context:] ()\r\n#24\t0x00007fff828cc2cc in -[NSKeyValueNestedProperty object:didAddObservance:recurse:] ()\r\n#25\t0x00007fff82877caf in -[NSObject(NSKeyValueObserverRegistration) _addObserver:forProperty:options:context:] ()\r\n#26\t0x00007fff82876a99 in -[NSObject(NSKeyValueObserverRegistration) addObserver:forKeyPath:options:context:] ()\r\n#27\t0x00007fff849989b4 in -[_NSModelObservingTracker _registerOrUnregister:observerNotificationsForModelObject:] ()\r\n#28\t0x00007fff84b806bb in -[NSObjectController setContent:] ()\r\n#29\t0x00007fff84b80518 in -[NSObjectDetailBinder refreshDetailContent] ()\r\n#30\t0x00007fff8289fcab in NSKeyValueNotifyObserver ()\r\n#31\t0x00007fff82919eba in -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:] ()\r\n#32\t0x00007fff84998af8 in -[NSController _notifyObserversForKeyPath:change:] ()\r\n#33\t0x00007fff849a18cc in -[NSController observeValueForKeyPath:ofObject:change:context:] ()\r\n#34\t0x00007fff8289fcab in NSKeyValueNotifyObserver ()\r\n#35\t0x00007fff8289f51b in NSKeyValueDidChange ()\r\n#36\t0x00007fff82860918 in -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] ()\r\n#37\t0x00007fff828cda69 in _NSSetObjectValueAndNotify ()\r\n#38\t0x000000010de99f05 in -[HRTreeController _addAdministrativeComponentForPatientHolder:withTreeController:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/Entities/HealthRecord/HRTreeController.m:383\r\n#39\t0x000000010de9bf7e in -[HRTreeController populateTreeControllerWithPatientHolder:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/Entities/HealthRecord/HRTreeController.m:574\r\n#40\t0x000000010dde90ce in -[HRPatientTreeController populateTreeControllerWithPatientHolder:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/Entities/HealthRecord/HRPatientTreeController.m:1035\r\n#41\t0x000000010dea4b1a in -[HRTreeController setPatientHolder:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/Entities/HealthRecord/HRTreeController.m:815\r\n#42\t0x000000010de1d940 in __26-[HRController setRecord:]_block_invoke_4 at /Users/aduchate/Sources/git.taktik.be/icure/iCure/Entities/HealthRecord/HRController.m:1997\r\n#43\t0x000000010de1031a in __75-[HRController addMissinPreferredFormsIfNeededInContact:completionHandler:]_block_invoke_2 at /Users/aduchate/Sources/git.taktik.be/icure/iCure/Entities/HealthRecord/HRController.m:1746\r\n#44\t0x0000000100586ea6 in __77-[SWGFormApi(Helper) findByPatientWithBody:formTemplateId:completionHandler:]_block_invoke_3 at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/SWGFormApi+Helper.m:45\r\n#45\t0x0000000100667442 in __135-[SWGFormApi findByHCPartyPatientSecretFKeysWithHcPartyId:secretFKeys:healthElementId:planOfActionId:formTemplateId:completionHandler:]_block_invoke at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/Api/SWGFormApi.m:403\r\n#46\t0x00000001005ff3be in __178-[SWGApiClient requestWithPath:method:pathParams:queryParams:formParams:files:body:headerParams:authSettings:requestContentType:responseContentType:responseType:completionBlock:]_block_invoke.291 at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/Core/SWGApiClient.m:395\r\n#47\t0x00000001005fbd70 in __71-[SWGApiClient operationWithCompletionBlock:requestId:completionBlock:]_block_invoke at /Users/aduchate/Sources/git.taktik.be/icure/iCure/ICDatabase/JsonApi/Core/SWGApiClient.m:217\r\n#48\t0x0000000100272fd9 in __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2.150 at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:308\r\n#49\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#50\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#51\t0x0000000100d656ae in _dispatch_main_queue_callback_4CF ()\r\n#52\t0x00007fff967939e9 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()\r\n#53\t0x00007fff967528dd in __CFRunLoopRun ()\r\n#54\t0x00007fff96751ed8 in CFRunLoopRunSpecific ()\r\n#55\t0x00007fff94f96935 in RunCurrentEventLoopInMode ()\r\n#56\t0x00007fff94f9676f in ReceiveNextEventCommon ()\r\n#57\t0x00007fff94f965af in _BlockUntilNextEventMatchingListInModeWithFilter ()\r\n#58\t0x00007fff847afdf6 in _DPSNextEvent ()\r\n#59\t0x00007fff847af226 in -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()\r\n#60\t0x00007fff847a3d80 in -[NSApplication run] ()\r\n#61\t0x00007fff8476d368 in NSApplicationMain ()\r\n#62\t0x0000000100002730 in main at /Users/aduchate/Sources/git.taktik.be/icure/iCure/iCure/main.m:18\r\n#63\t0x00007fff853ad5ad in start ()\r\n#64\t0x00007fff853ad5ad in start ()\r\nEnqueued from com.alamofire.networking.session.manager.processing (Thread 0)Queue : com.alamofire.networking.session.manager.processing (serial)\r\n#0\t0x0000000100d5cfc4 in dispatch_group_async ()\r\n#1\t0x0000000100272e61 in __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke.147 at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:306\r\n#2\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#3\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#4\t0x0000000100d63f8a in _dispatch_async_redirect_invoke ()\r\n#5\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#6\t0x0000000100d52457 in _dispatch_root_queue_drain ()\r\n#7\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#8\t0x0000000100db0336 in _pthread_wqthread ()\r\n#9\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from NSOperationQueue 0x6180000398a0 :: NSOperation 0x60800344b670 (QOS: LEGACY) (Thread 37)Queue : NSOperationQueue 0x6180000398a0 :: NSOperation 0x60800344b670 (QOS: LEGACY) (serial)\r\n#0\t0x0000000100d66334 in _dispatch_async_f_redirect ()\r\n#1\t0x000000010027243e in -[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:290\r\n#2\t0x000000010027b342 in -[AFURLSessionManager URLSession:task:didCompleteWithError:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:1090\r\n#3\t0x00007fff8c116466 in __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke167 ()\r\n#4\t0x00007fff828a08d7 in __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ ()\r\n#5\t0x00007fff828a0595 in -[NSBlockOperation main] ()\r\n#6\t0x00007fff8289ec7a in -[__NSOperationInternal _start:] ()\r\n#7\t0x00007fff8289ac64 in __NSOQSchedule_f ()\r\n#8\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#9\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#10\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#11\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#12\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#13\t0x0000000100db0336 in _pthread_wqthread ()\r\n#14\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from com.apple.NSURLSession-work (Thread 21)Queue : com.apple.NSURLSession-work (serial)\r\n#0\t0x0000000100d5ab49 in _dispatch_barrier_async_f ()\r\n#1\t0x00007fff828611b4 in __NSOQSchedule ()\r\n#2\t0x00007fff8289a1d5 in __addOperations ()\r\n#3\t0x00007fff8c116361 in -[NSURLSession delegate_task:didCompleteWithError:] ()\r\n#4\t0x00007fff8c03e25f in -[__NSCFLocalSessionTask _task_onqueue_didFinish] ()\r\n#5\t0x00007fff8c03df81 in __51-[__NSCFURLLocalSessionConnection _task_sendFinish]_block_invoke ()\r\n#6\t0x00007fff8c03a8fb in -[__NSCFURLLocalSessionConnection withDelegateAndPendingCompletion:] ()\r\n#7\t0x00007fff8c03defa in -[__NSCFURLLocalSessionConnection _task_sendFinish] ()\r\n#8\t0x00007fff8c03b8a2 in __57-[__NSCFURLLocalSessionConnection afterDelegateWithTick:]_block_invoke ()\r\n#9\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#10\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#11\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#12\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#13\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#14\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#15\t0x0000000100db0336 in _pthread_wqthread ()\r\n#16\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from com.apple.NSURLSession-work (Thread 21)Queue : com.apple.NSURLSession-work (serial)\r\n#0\t0x0000000100d5ab49 in _dispatch_barrier_async_f ()\r\n#1\t0x00007fff8c03aedf in -[__NSCFURLLocalSessionConnection afterDelegateWithTick:] ()\r\n#2\t0x00007fff8c03c9f8 in __50-[__NSCFURLLocalSessionConnection _tick_finishing]_block_invoke_2 ()\r\n#3\t0x00007fff8c03c859 in __50-[__NSCFURLLocalSessionConnection _tick_finishing]_block_invoke ()\r\n#4\t0x00007fff8c03a8fb in -[__NSCFURLLocalSessionConnection withDelegateAndPendingCompletion:] ()\r\n#5\t0x00007fff8c03c3ef in -[__NSCFURLLocalSessionConnection _tick_finishing] ()\r\n#6\t0x00007fff8c03b8a2 in __57-[__NSCFURLLocalSessionConnection afterDelegateWithTick:]_block_invoke ()\r\n#7\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#8\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#9\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#10\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#11\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#12\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#13\t0x0000000100db0336 in _pthread_wqthread ()\r\n#14\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from NSOperationQueue 0x6180000398a0 :: NSOperation 0x618002a55870 (QOS: LEGACY) (Thread 0)Queue : NSOperationQueue 0x6180000398a0 :: NSOperation 0x618002a55870 (QOS: LEGACY) (serial)\r\n#0\t0x0000000100d5ab49 in _dispatch_barrier_async_f ()\r\n#1\t0x00007fff8c03aedf in -[__NSCFURLLocalSessionConnection afterDelegateWithTick:] ()\r\n#2\t0x00007fff8c03c0be in __48-[__NSCFURLLocalSessionConnection _tick_running]_block_invoke_2 ()\r\n#3\t0x00007fff828a08d7 in __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ ()\r\n#4\t0x00007fff828a0595 in -[NSBlockOperation main] ()\r\n#5\t0x00007fff8289ec7a in -[__NSOperationInternal _start:] ()\r\n#6\t0x00007fff8289ac64 in __NSOQSchedule_f ()\r\n#7\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#8\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#9\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#10\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#11\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#12\t0x0000000100db0336 in _pthread_wqthread ()\r\n#13\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from com.apple.NSURLSession-work (Thread 21)Queue : com.apple.NSURLSession-work (serial)\r\n#0\t0x0000000100d5ab49 in _dispatch_barrier_async_f ()\r\n#1\t0x00007fff828611b4 in __NSOQSchedule ()\r\n#2\t0x00007fff8289a1d5 in __addOperations ()\r\n#3\t0x00007fff8c11616f in -[NSURLSession delegate_dataTask:didReceiveData:completionHandler:] ()\r\n#4\t0x00007fff8c03c005 in -[__NSCFLocalSessionTask _task_onqueue_didReceiveDispatchData:completionHandler:] ()\r\n#5\t0x00007fff8c03bd22 in __48-[__NSCFURLLocalSessionConnection _tick_running]_block_invoke ()\r\n#6\t0x00007fff8c03a8fb in -[__NSCFURLLocalSessionConnection withDelegateAndPendingCompletion:] ()\r\n#7\t0x00007fff8c03bc02 in -[__NSCFURLLocalSessionConnection _tick_running] ()\r\n#8\t0x00007fff8c03b8a2 in __57-[__NSCFURLLocalSessionConnection afterDelegateWithTick:]_block_invoke ()\r\n#9\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#10\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#11\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#12\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#13\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#14\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#15\t0x0000000100db0336 in _pthread_wqthread ()\r\n#16\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from com.apple.NSURLSession-work (Thread 21)Queue : com.apple.NSURLSession-work (serial)\r\n#0\t0x0000000100d5ab49 in _dispatch_barrier_async_f ()\r\n#1\t0x00007fff8c03aedf in -[__NSCFURLLocalSessionConnection afterDelegateWithTick:] ()\r\n#2\t0x00007fff8c03ae6c in __61-[__NSCFURLLocalSessionConnection _didReceiveResponse:sniff:]_block_invoke_2 ()\r\n#3\t0x00007fff8c03ac40 in -[__NSCFLocalDataTask _onqueue_didReceiveResponse:completion:] ()\r\n#4\t0x00007fff8c03a9c7 in __61-[__NSCFURLLocalSessionConnection _didReceiveResponse:sniff:]_block_invoke ()\r\n#5\t0x00007fff8c03a8fb in -[__NSCFURLLocalSessionConnection withDelegateAndPendingCompletion:] ()\r\n#6\t0x00007fff8c03a11a in -[__NSCFURLLocalSessionConnection _didReceiveResponse:sniff:] ()\r\n#7\t0x00007fff8c039d72 in SessionConnectionLoadable::_loaderClientEvent_DidReceiveResponse(_CFURLResponse*) ()\r\n#8\t0x00007fff8c049adc in ___ZN19URLConnectionLoader26protocolDidReceiveResponseEP14_CFURLResponse_block_invoke ()\r\n#9\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#10\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#11\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#12\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#13\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#14\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#15\t0x0000000100db0336 in _pthread_wqthread ()\r\n#16\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from com.apple.NSURLSession-work (Thread 21)Queue : com.apple.NSURLSession-work (serial)\r\n#0\t0x0000000100d5ab49 in _dispatch_barrier_async_f ()\r\n#1\t0x00007fff8c039b18 in SessionConnectionLoadable::withLoaderClientAsync(void (LoaderClientInterface*) block_pointer) ()\r\n#2\t0x00007fff8c049157 in URLConnectionLoader::protocolDidReceiveResponse(_CFURLResponse*) ()\r\n#3\t0x00007fff8c04908a in ___ZN27URLConnectionLoader_Classic26protocolDidReceiveResponseEP14_CFURLResponse_block_invoke ()\r\n#4\t0x00007fff8c033ce5 in ___ZNK25URLConnectionInstanceData18withWorkQueueAsyncEU13block_pointerFvvE_block_invoke ()\r\n#5\t0x0000000100d5b070 in _dispatch_call_block_and_release ()\r\n#6\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#7\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#8\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#9\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#10\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#11\t0x0000000100db0336 in _pthread_wqthread ()\r\n#12\t0x0000000100dadf91 in start_wqthread ()\r\nEnqueued from com.apple.root.default-qos.overcommit (Thread 9)Queue : com.apple.root.default-qos.overcommit (serial)\r\n#0\t0x0000000100d50cb7 in _dispatch_barrier_async_f_slow ()\r\n#1\t0x00007fff8c033cb2 in URLConnectionInstanceData::withWorkQueueAsync(void () block_pointer) const ()\r\n#2\t0x00007fff8c04902b in URLConnectionLoader_Classic::protocolDidReceiveResponse(_CFURLResponse*) ()\r\n#3\t0x00007fff8c1030d5 in HTTPProtocol::checkAndSendDidReceiveResponse() ()\r\n#4\t0x00007fff8c102472 in HTTPProtocol::performHeaderReadPostProcessing(__CFHTTPMessage*, unsigned char) ()\r\n#5\t0x00007fff8c101fdf in HTTPProtocol::performHeaderRead(__CFHTTPMessage*) ()\r\n#6\t0x00007fff8c101bc2 in HTTPProtocol::handleStreamEvent(__CFHTTPMessage*, dispatch_data_s*, CFStreamError const*) ()\r\n#7\t0x00007fff8c1117bd in HTTPNetStreamInfo::_readStreamClientCallBack(__CFReadStream*, unsigned long) ()\r\n#8\t0x00007fff8c111694 in CFNetworkReadStream::_readStreamClientCallBackCallBack(__CFReadStream*, unsigned long, void*) ()\r\n#9\t0x00007fff96795094 in _signalEventSync ()\r\n#10\t0x00007fff967b229e in _cfstream_shared_signalEventSync ()\r\n#11\t0x00007fff96773881 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()\r\n#12\t0x00007fff96752fbc in __CFRunLoopDoSources0 ()\r\n#13\t0x00007fff967524df in __CFRunLoopRun ()\r\n#14\t0x00007fff96751ed8 in CFRunLoopRunSpecific ()\r\n#15\t0x00007fff8c022095 in +[NSURLConnection(Loader) _resourceLoadLoop:] ()\r\n#16\t0x00007fff8288ee64 in __NSThread__start__ ()\r\n#17\t0x0000000100db0805 in _pthread_body ()\r\n#18\t0x0000000100db0782 in _pthread_start ()\r\n#19\t0x0000000100dadfa1 in thread_start ()\r\n```\r\n\r\nand\r\n\r\n```\r\n#0\t0x00007fff9077dde6 in __psynch_mutexwait ()\r\n#1\t0x0000000100db0cc2 in _pthread_mutex_lock_wait ()\r\n#2\t0x0000000100dae294 in _pthread_mutex_lock_slow ()\r\n#3\t0x00007fff828b84fe in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] ()\r\n#4\t0x00000001002713d4 in -[AFURLSessionManagerTaskDelegate cleanUpProgressForTask:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:220\r\n#5\t0x000000010027684a in -[AFURLSessionManager removeDelegateForTask:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:674\r\n#6\t0x000000010027b359 in -[AFURLSessionManager URLSession:task:didCompleteWithError:] at /Users/aduchate/Sources/git.taktik.be/icure/iCure/3rdParties/AFNetworking/AFNetworking/AFURLSessionManager.m:1092\r\n#7\t0x00007fff8c116466 in __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke167 ()\r\n#8\t0x00007fff828a08d7 in __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ ()\r\n#9\t0x00007fff828a0595 in -[NSBlockOperation main] ()\r\n#10\t0x00007fff8289ec7a in -[__NSOperationInternal _start:] ()\r\n#11\t0x00007fff8289ac64 in __NSOQSchedule_f ()\r\n#12\t0x0000000100d4dcc5 in _dispatch_client_callout ()\r\n#13\t0x0000000100d53112 in _dispatch_queue_drain ()\r\n#14\t0x0000000100d5ae24 in _dispatch_queue_invoke ()\r\n#15\t0x0000000100d51dab in _dispatch_root_queue_drain ()\r\n#16\t0x0000000100d518a5 in _dispatch_worker_thread3 ()\r\n#17\t0x0000000100db0336 in _pthread_wqthread ()\r\n#18\t0x0000000100dadf91 in start_wqthread ()\r\n```\r\n\r\nAFNetworking version:\r\n```\r\n\r\n➜  AFNetworking git:(88f1305) git status\r\nHEAD detached at 3.1.0\r\nnothing to commit, working directory clean\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/comments/238470295","html_url":"https://github.com/AFNetworking/AFNetworking/issues/3599#issuecomment-238470295","issue_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/3599","id":238470295,"user":{"login":"aduchate","id":2221917,"avatar_url":"https://avatars.githubusercontent.com/u/2221917?v=3","gravatar_id":"","url":"https://api.github.com/users/aduchate","html_url":"https://github.com/aduchate","followers_url":"https://api.github.com/users/aduchate/followers","following_url":"https://api.github.com/users/aduchate/following{/other_user}","gists_url":"https://api.github.com/users/aduchate/gists{/gist_id}","starred_url":"https://api.github.com/users/aduchate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduchate/subscriptions","organizations_url":"https://api.github.com/users/aduchate/orgs","repos_url":"https://api.github.com/users/aduchate/repos","events_url":"https://api.github.com/users/aduchate/events{/privacy}","received_events_url":"https://api.github.com/users/aduchate/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T07:01:04Z","updated_at":"2016-08-09T07:01:04Z","body":"Will check now.\r\n\r\nThanks,"}}
{"actor":{"display_login":"aduchate"}}