0

I'm a Project Manager trying to help out with my developers;

We had a build that was ready for submission; crash free and testing was done on an iPad. The following day when we began testing it on iPod and iPhone 3G, we noticed a boatload of crashes. We reinstalled the build on the iPad and low and behold a boatload of crashes showed there too.

We noticed that when you reboot the device and reinstalled the app, crashes didn’t seem to happen at all, everything would look ok for the first couple of minutes and then you get a crash. Oddly enough, the app crashes easily afterwards.

Crashes happen mostly on one specific screen of the application, the crashes doesn’t seem to be specific to an action that we can tell. We are connecting to a third party API to populate data in the screen and we are using Restkit. Crashes sometimes appear to originate from Restkit. Below is an example of an error log we got:

0   libobjc.A.dylib                0x34f70ca4 objc_msgSend + 28
1   CoreFoundation                 0x325ae0b8 __CFBasicHashStandardRetainValue + 8
2   CoreFoundation                 0x325abb30 __CFBasicHashReplaceValue + 44
3   CoreFoundation                 0x32505f98 CFDictionarySetValue + 68
4   CoreFoundation                 0x3250c94e -[__NSCFDictionary setObject:forKey:] + 54
5   Foundation                     0x34d8a31a -[NSMutableDictionary(NSKeyValueCoding) setValue:forKey:] + 10
6   nameofapp                      0x000ae958 -[RKClient setValue:forHTTPHeaderField:] (RKClient.m:173)
7   nameofapp                      0x000086ae -[WebServer addCustomHeaders:] (WebServer.m:140)
8   nameofapp                      0x000088ea -[WebServer getDoD:objectTarget:] (WebServer.m:197)

and

WebServer.m:140  [[objectManager client] setValue:@"text/json" 
                               forHTTPHeaderField:@"X-ZFWS-Accept"];
Kara
  • 6,115
  • 16
  • 50
  • 57
  • 1
    That's strange. -[RKClient setValue:forHTTPHeaderField:] just calls a -[NSMutableDictionary setValue:forHTTPHeaderField:] for the dictionary containing all the header fields. Does the problem still persist? Could you post more logs, like what exactly exception does occur when your program crashes? – Victor K. Jul 21 '11 at 11:21

1 Answers1

0

Two things - First, we need more information. What's the rest of that crash log say? Second, and equally important, if you're running RestKit (or anything else for that matter) on an iPhone 3G then you must make absolutely certain that "Compile for Thumb" is turned off for the ARMv6 architecture. I noticed that a lot of my various mysterious crashes went away simply by ensuring that "Compile for Thumb" is turned on for ARMv7, but off for ARMv6. The iPhone 3G (and possibly your iPod) uses the ARMv6 architecture which does not have Thumb support. When Thumb is turned on for the v6, there's no telling how it's going to work (or not) because the chip is getting bad instructions. However, don't simply turn off Thumb, because you get a big speed bump on newer devices like the iPhone 4 and the iPad.

In your Xcode projects, open up your build settings and click on the title for "Compile for Thumb" then select from the gear menu down the option to "Add Build Setting Condition". Change the "Any SDK" to "Any iOS" and change "Any Architecture" to "ARMv6", then make sure the "Value" is unchecked. Now do the same thing, creating another Build Condition for ARMv7, and select/check the Value to be on.

In the RestKit library, you may have to do this for each of the various targets that it has.

Greg Combs
  • 4,252
  • 3
  • 33
  • 47