amazon-archives/aws-sdk-ios-v1

AWS S3Response object dealloc is crashing my app. Why?

rbevers opened this issue · 1 comments

I have an Xcode ObjC non-ARC app targetting iOS 5+. My PutObject and MultipartUpload requests are succeeding just fine. But sometime later, when the objects start to be released my app crashes. It's always the same stack dump. Here's the crash log for the thread:

Thread 1 name:  Dispatch queue: com.apple.root.default-priority
Thread 1 Crashed:
0   libobjc.A.dylib                 0x3a8295d0 objc_msgSend + 16
1   AppName                         0x000f3084 -[AmazonServiceResponse dealloc] (AmazonServiceResponse.m:250)
2   AppName                         0x00183c72 -[S3Response dealloc] (S3Response.m:320)
3   libobjc.A.dylib                 0x3a82b490 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 164
4   libdispatch.dylib               0x3882d6dc _dispatch_root_queue_drain + 412
5   libdispatch.dylib               0x3882d7d4 _dispatch_worker_thread2 + 88
6   libsystem_c.dylib               0x3a2eb7ee _pthread_wqthread + 358
7   libsystem_c.dylib               0x3a2eb680 start_wqthread + 4

It seems like you are using Grand Central Dispatch, and perhaps some objects are not properly retained. Blocks automatically retain some objects, but you are not completely free from manual memory management.

We have a discussion forum for the AWS SDK for iOS:
https://forums.aws.amazon.com/forum.jspa?forumID=88

Currently, it has more visibility for our users, especially for technical questions like this, and other users may benefit from the discussion. Could you post this question there? When you post your question on the forum, please add the code snippet so that we can reproduce the issue.

Also, from the log the object is released too many times. In these situations, using Instruments with the Zombies option enabled may help identify the source of the issue. Apple has great documentations on how to use Instruments.

Hope this helps,
Yosuke