{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/151","labels_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/151/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/151/events","html_url":"https://github.com/aws/aws-sdk-ios/issues/151","id":58745429,"number":151,"title":"AWSMobileAnalyticsBufferedReader crash","user":{"login":"stepanhruda","id":2835783,"avatar_url":"https://avatars.githubusercontent.com/u/2835783?v=3","gravatar_id":"","url":"https://api.github.com/users/stepanhruda","html_url":"https://github.com/stepanhruda","followers_url":"https://api.github.com/users/stepanhruda/followers","following_url":"https://api.github.com/users/stepanhruda/following{/other_user}","gists_url":"https://api.github.com/users/stepanhruda/gists{/gist_id}","starred_url":"https://api.github.com/users/stepanhruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepanhruda/subscriptions","organizations_url":"https://api.github.com/users/stepanhruda/orgs","repos_url":"https://api.github.com/users/stepanhruda/repos","events_url":"https://api.github.com/users/stepanhruda/events{/privacy}","received_events_url":"https://api.github.com/users/stepanhruda/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-ios/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-24T14:27:55Z","updated_at":"2015-03-10T23:47:37Z","closed_at":"2015-03-10T23:47:37Z","body":"Hi, we are getting crashes in production from the SDK and they don't touch any of our code.\r\n\r\nThe only feature we're using is AWS Mobile Analytics, I assume this crash happens when the SDK is submitting new events up to the server. I'm pretty positive the crashes are a race condition and cannot be reproduced deterministically.\r\n\r\n```\r\nApplication Specific Information:\r\n*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString appendString:]: nil argument'\r\n\r\nLast Exception Backtrace:\r\n0   CoreFoundation                       0x000000018487e59c __exceptionPreprocess + 132\r\n1   libobjc.A.dylib                      0x0000000194fc80e4 objc_exception_throw + 56\r\n2   CoreFoundation                       0x000000018487e4dc +[NSException raise:format:] + 124\r\n3   CoreFoundation                       0x0000000184828b94 mutateError + 184\r\n4   OurFramework                         0x000000010028e8dc -[AWSMobileAnalyticsBufferedReader readLine:withError:] (AWSMobileAnalyticsBufferedReader.m:95)\r\n5   OurFramework                         0x00000001002a7478 -[AWSFileEventIterator hasNext] (AWSMobileAnalyticsFileEventStore.m:324)\r\n6   OurFramework                         0x00000001002926bc __72-[AWSMobileAnalyticsDefaultDeliveryClient attemptDeliveryUsingPolicies:]_block_invoke (AWSMobileAnalyticsDefaultDeliveryClient.m:211)\r\n7   Foundation                           0x00000001857374a8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 12\r\n8   Foundation                           0x0000000185688c34 -[NSBlockOperation main] + 92\r\n9   Foundation                           0x00000001856785bc -[__NSOperationInternal _start:] + 632\r\n10  Foundation                           0x000000018573a20c __NSOQSchedule_f + 224\r\n11  libdispatch.dylib                    0x000000019560d36c _dispatch_client_callout + 12\r\n12  libdispatch.dylib                    0x00000001956174c0 _dispatch_queue_drain + 1212\r\n13  libdispatch.dylib                    0x0000000195610474 _dispatch_queue_invoke + 128\r\n14  libdispatch.dylib                    0x0000000195619224 _dispatch_root_queue_drain + 660\r\n15  libdispatch.dylib                    0x000000019561a75c _dispatch_worker_thread3 + 104\r\n16  libsystem_pthread.dylib              0x00000001957e92e4 _pthread_wqthread + 812\r\n17  libsystem_pthread.dylib              0x00000001957e8fa8 start_wqthread + 0\r\n```\r\n\r\nTo give you more context, another thread's trace at that time might be relevant as well (this thread did not crash, it was the above one that did):\r\n\r\n```\r\n0   libsystem_kernel.dylib               0x000000019574f078 __psynch_cvwait + 8\r\n1   Foundation                           0x0000000185735c04 -[__NSOperationInternal _waitUntilFinished:] + 136\r\n2   Foundation                           0x00000001856db008 -[NSOperationQueue waitUntilAllOperationsAreFinished] + 284\r\n3   OurFramework                         0x0000000100291aec -[AWSMobileAnalyticsDefaultDeliveryClient waitForDeliveryOperations] (AWSMobileAnalyticsDefaultDeliveryClient.m:122)\r\n4   OurFramework                         0x000000010029f5a8 __63-[AWSMobileAnalyticsDefaultSessionClient waitForSessionTimeout]_block_invoke (AWSMobileAnalyticsDefaultSessionClient.m:297)\r\n5   OurFramework                         0x000000010029fde4 -[AWSMobileAnalyticsDelayedBlock execute] (AWSMobileAnalyticsDelayedBlock.m:79)\r\n6   OurFramework                         0x000000010029f650 __63-[AWSMobileAnalyticsDefaultSessionClient waitForSessionTimeout]_block_invoke186 (AWSMobileAnalyticsDefaultSessionClient.m:304)\r\n7   OurFramework                         0x00000001002aaf8c __64-[AWSMobileAnalyticsIOSLifeCycleManager executeBackgroundTasks:]_block_invoke70 (AWSMobileAnalyticsIOSLifeCycleManager.m:148)\r\n8   libdispatch.dylib                    0x000000019560d3ac _dispatch_call_block_and_release + 20\r\n9   libdispatch.dylib                    0x000000019560d36c _dispatch_client_callout + 12\r\n10  libdispatch.dylib                    0x000000019561940c _dispatch_root_queue_drain + 1148\r\n11  libdispatch.dylib                    0x000000019561a75c _dispatch_worker_thread3 + 104\r\n12  libsystem_pthread.dylib              0x00000001957e92e4 _pthread_wqthread + 812\r\n13  libsystem_pthread.dylib              0x00000001957e8fa8 start_wqthread + 0\r\n```\r\n\r\nThey are both non-main threads."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/comments/78173460","html_url":"https://github.com/aws/aws-sdk-ios/issues/151#issuecomment-78173460","issue_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/151","id":78173460,"user":{"login":"yosuke-matsuda","id":1459206,"avatar_url":"https://avatars.githubusercontent.com/u/1459206?v=3","gravatar_id":"","url":"https://api.github.com/users/yosuke-matsuda","html_url":"https://github.com/yosuke-matsuda","followers_url":"https://api.github.com/users/yosuke-matsuda/followers","following_url":"https://api.github.com/users/yosuke-matsuda/following{/other_user}","gists_url":"https://api.github.com/users/yosuke-matsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/yosuke-matsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosuke-matsuda/subscriptions","organizations_url":"https://api.github.com/users/yosuke-matsuda/orgs","repos_url":"https://api.github.com/users/yosuke-matsuda/repos","events_url":"https://api.github.com/users/yosuke-matsuda/events{/privacy}","received_events_url":"https://api.github.com/users/yosuke-matsuda/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T23:47:37Z","updated_at":"2015-03-10T23:47:37Z","body":"We've released the AWS Mobile SDK for iOS 2.0.17, which addresses the issue. Thanks."}}