amazon-archives/aws-sdk-ios-v1

SIGSEGV [S3Response connection:didReceiveResponse:]

imack opened this issue · 2 comments

I have an app in the store which uses an async uploads to S3, however, I'm seeing this error come through my crash handlers.

Binary Image Name Address Symbol

0 latergram 0x000fc8d4 testflight_backtrace
1 latergram 0x000fc114 TFSignalHandler
2 libsystem_platform.dylib 0x38247722 _sigtramp
3 latergram 0x001924be -[S3Response connection:didReceiveResponse:] in S3Response.m on Line 155
4 Foundation 0x2ddda246 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke
5 Foundation 0x2ddda188 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]
6 Foundation 0x2ddda0a4 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:]
7 Foundation 0x2ddda062 _NSURLConnectionDidReceiveResponse
8 CFNetwork 0x2d101964 ___ZN27URLConnectionClient_Classic28_delegate_didReceiveResponseEP14_CFURLResponse_block_invoke
9 CFNetwork 0x2d0feeba ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2
10 CoreFoundation 0x2d3ce1d8 CFArrayApplyFunction
11 CFNetwork 0x2d096ad2 _ZN19RunloopBlockContext7performEv
12 CFNetwork 0x2d096990 _ZN17MultiplexerSource7performEv
13 CFNetwork 0x2d096820 _ZN17MultiplexerSource8_performEPv
14 CoreFoundation 0x2d465fe6 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
15 CoreFoundation 0x2d4654ae __CFRunLoopDoSources0
16 CoreFoundation 0x2d463c9e __CFRunLoopRun
17 CoreFoundation 0x2d3ce7a8 CFRunLoopRunSpecific
18 CoreFoundation 0x2d3ce58a CFRunLoopRunInMode
19 GraphicsServices 0x3233b6d2 GSEventRunModal
20 UIKit 0x2fd2d890 UIApplicationMain
21 latergram 0x000c045a main in main.m on Line 17
22 libdyld.dylib 0x3812dab6 start

If you are using the latest version of the SDK, S3Response.m on Line 155 is this line of code:

if ([self.request.delegate respondsToSelector:@selector(request:didReceiveResponse:)]) {

Most likely your delegate object is deallocated before it receives all of the delegate methods. You should always keep a strong reference to the delegate object. This blog post may help.

@yosukematsuda, thank you for the help. May your test suite be forever green and your Pull Requests always accepted.