Ad Hoc Builds Crashing on Device Only - ASIHTTPRequest



This problem is related to ASIHTTPRequest. When I remove the ASIHTTPRequest async block, the app does not crash on my device any more. I can run the ASIHTTPRequest code on my device, loaded from Xcode fine. It's just when I upload the archive from TestFlight and try to run it that it crashes. The device crash log shows:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000058 Crashed Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed:

All of a sudden, today, after 20 successful ad hoc builds and runs uploaded via TestFlight, my last 3 AD Hoc successfully upload to TestFlight but crash on my test device.

These builds run perfectly when coming off of Xcode onto the device. In fact, i can quit the app, disconnect my device from Xcode and the app runs fine and like I said, I am able to successfully upload those builds to TestFlight with my AD Hoc distribution profile. But when I go to install and run, the app executes up to the launch image and then crashes.

All of the settings in Xcode have remained untouched so I am wondering if you know what could be causing this?

It sure sounds like my AD Hoc distribution profile, since that is the only difference between when I build and run from Xcode VS from TestFlight but it's weird that it just stopped working...

Anyone else have that issue?

What should I try next?


I had this exact same problem, it worked flawlessly when built directly from XCode but, when deployed through AD Hoc, it'd crash every time. I'm not sure why but as it turns out the problem is with the blocks of ASIHTTPRequest completion and failure. Here is how I worked around it.

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDidFinishSelector:@selector(completedImg:)]; [request setDidFailSelector:@selector(failedImg:)]; [request setDelegate:self]; [request startAsynchronous];

Note* I only had this crash when downloading videos (it works fine with documents and images for some reason).


  • UITableView crashes when the same row is selected twice
  • iOS app crashing in release mode, works in debug mode
  • Android - Actionbar not showing in the development preview
  • XCODE keeps crashing. Deals with auto layout
  • How can I automatically restart chromium if it crashes?
  • ios 10 app crashes when accessing camera
  • typeahead.js prefetch doesn't work
  • Prevent app from crash when network unavailable
  • Hibernate/NHibernate : how to persist subclass as instance of superclass
  • Automatic redirection of FormsAuthentication to other URL than specified in the Web.Config?
  • how to change “eheap_alloc” size on windows system to run erlang server?
  • Leap in time in PHP's function time()
  • Create app service call executing multiple times
  • How to debug AccessViolationException coming from native code
  • AddressSanitizer Crash on GCC 4.8
  • Sinatra app not deploying to Heroku, rackup crashed
  • Deadlock using AFIncrementalStore and NSFetchedResultsController
  • In Rails, why there is a new Gemfile.lock when no bundle or bundle install was run? (and a new Gemfi
  • Meteor: Error during WebSocket handshake: Unexpected response code: 400
  • Handling UI code from a Thread
  • running out of memory from for loop
  • Border Layout not working
  • Jquery javascript: have a filtering list(works), need help keeping all LI's visible when there&
  • Run app deployed with XCode 7 gives a crash
  • Capitalize a substring within a string
  • How to mock current date?
  • Get count of created entries for each day
  • Why does Apple use assign rather than weak to store a delegate?
  • Open an application in a space using applescripts
  • Send emails through VB6 if no email client
  • how to populate a SQLite database and use that database in phonegap?
  • UIAlertController button function not working
  • Check for zero lines output from command over SSH
  • Possible to stop flickering java tooltip in heavyweight mode?
  • output of program is not same as passed argument
  • Akka Routing: Reply's send to router ends up as dead letters
  • unknown Exception android
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Checking variable from a different class in C#