square / PonyDebugger

Remote network and data debugging for your native iOS app using Chrome Developer Tools
Other
5.87k stars 595 forks source link

ARM64 Crash #84

Closed tyrone-sudeium closed 8 years ago

tyrone-sudeium commented 10 years ago

So I decided to be super cutting-edge and compile my application for arm64, and I'm consistently getting a crash on startup, seemingly originating from PonyDebugger, of which I'm compiling the latest HEAD (67757b47118c1cd6a1cd8a0ec9c4af59138d982f).

lldb bt:

* thread #11: tid = 0xedd4b, 0x00000001986ef9d0 libobjc.A.dylib`objc_msgSend + 16, stop reason = EXC_BAD_ACCESS (code=1, address=0x1a0018010)
    frame #0: 0x00000001986ef9d0 libobjc.A.dylib`objc_msgSend + 16
    frame #1: 0x000000018d287020 Foundation`-[NSConcreteMutableData appendData:] + 88
    frame #2: 0x00000001002d8e60 Cloudsdale-iOS copy`__67+[PDNetworkDomainController injectDidReceiveDataIntoDelegateClass:]_block_invoke_2(.block_descriptor=0x0000000178256a70, slf=0x00000001700ab400, connection=0x000000017800dfa0, data=0x00000001702e2800) + 176 at PDNetworkDomainController.m:340
    frame #3: 0x000000018d286dd4 Foundation`__65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 80
    frame #4: 0x000000018d286cc0 Foundation`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 232
    frame #5: 0x000000018d286bb8 Foundation`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 80
    frame #6: 0x000000018d286fbc Foundation`_NSURLConnectionDidReceiveData + 80
    frame #7: 0x000000018c3c0e68 CFNetwork`___ZN27URLConnectionClient_Classic29_delegate_didReceiveDataArrayEv_block_invoke + 232
    frame #8: 0x000000018c3c0454 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 96
    frame #9: 0x000000018c402160 CFNetwork`___ZNK17CoreSchedulingSet13_performAsyncEPKcU13block_pointerFvvE_block_invoke + 36
    frame #10: 0x000000018c6d9538 CoreFoundation`CFArrayApplyFunction + 68
    frame #11: 0x000000018c33605c CFNetwork`RunloopBlockContext::perform() + 120
    frame #12: 0x000000018c335ef0 CFNetwork`MultiplexerSource::perform() + 288
    frame #13: 0x000000018c335d2c CFNetwork`MultiplexerSource::_perform(void*) + 60
    frame #14: 0x000000018c79b77c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #15: 0x000000018c79aad8 CoreFoundation`__CFRunLoopDoSources0 + 256
    frame #16: 0x000000018c798d70 CoreFoundation`__CFRunLoopRun + 632
    frame #17: 0x000000018c6d9b78 CoreFoundation`CFRunLoopRunSpecific + 452
    frame #18: 0x000000018d2697b4 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 296
    frame #19: 0x000000018d2c736c Foundation`-[NSRunLoop(NSRunLoop) run] + 96
    frame #20: 0x00000001001fa304 Cloudsdale-iOS copy`+[TFURLConnectionOperation _runNetworkThread:] + 172
    frame #21: 0x000000018d350990 Foundation`__NSThread__main__ + 1000
    frame #22: 0x0000000198e5c1b0 libsystem_pthread.dylib`_pthread_body + 168
    frame #23: 0x0000000198e5c108 libsystem_pthread.dylib`_pthread_start + 140

The crash does not occur when running the application in 32-bit mode. The delegate class in this case is the TestFlight SDK's TFURLConnectionOperation. If I disable TestFlight in my app, I get a crash as soon as I do any network operation, except in the injectWillSendRequestIntoDelegateClass: method instead.

Greensource commented 10 years ago

Same issue here. An EXEC_BAD_ACCESS seem to appear into a swizzle method from AFNetworking.

fogisland commented 10 years ago

Due to Apple`s documentation about arm 64 bit ," function pointers must use the correct prototype". If not , all parameters will be nil, which results in a crash of AFNetworking.

(https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW22)

I have made a pull request for this issue: https://github.com/square/PonyDebugger/pull/108

joshavant commented 10 years ago

Just had this issue. Thanks for the PR @fogisland!

erinnovations commented 9 years ago

Same here.