Action on iOS 8 notifications on lockscreen causes cfprefsd crash, which wipes all NSUserDefaults data

Originator:Xianjing321
Number:rdar://21992038 Date Originated:07/24/2015
Status:Open Resolved:NO
Product:iPhone/iPad Product Version:iOS 8 and above
Classification:Crash/Data loss Reproducible:YES
 
Description:
Occasionally, when an iOS 8 device receives a push notification, and a user presses one of the action buttons on the locked device, the cfprefsd process immediately crashes (crash log attached). What's more, the crash results in all data in NSUserDefaults related to this app to be temporarily "lost" -- upon re-opening the app, if we try to print out the stuff in our NSUserDefaults, nothing gets printed out. The app is in an unusable state. However, if we force quit the app now and restart, the NSUserDefaults data comes back.

Steps to Reproduce: 
We developers had been reproducing this issue in an upgrade-and-force-quit flow.
1. Have the app already installed on the device, then upgrade to a newer version. 
2. Open the app, then force quit the app.
3. Lock the phone.
4. Send a push notification to the device.
5. Upon receiving the push notification, swipe left to reveal the action buttons, and press on one of the action buttons. 
6. Unlock the device and open the app.

It happens more often in this flow. However, our customers report this issue in a more normal flow, so it does not happen only on app upgrade.

Expected Results: 
After step 5 from above, acting on one of the action buttons should cause changes on our website indicating that the actions were successfully sent out.

After step 6 from above, we should see the app running as before when in foreground.

Actual Results:
After step 5, the actions don't do anything when they should be causing changes on our websites. A cfprefsd process crash immediately appears in console log.

After step 6, the app is in an unusable state because all NSUserDefaults data is lost. Only if we force quit and restart the app will the data come back.

Comments

Apple replied with: " We believe this issue has been addressed in the latest iOS 9 beta (build 13A4305g). This is a pre-release iOS 9 update.

Please refer to the release notes for complete installation instructions.

Please test with this release. If you still have issues, please provide any relevant logs or information that could help us investigate.

iOS 9 https://developer.apple.com/ios/download/ " We will test this against iOS 9 and then update here.

By Xianjing321 at Aug. 4, 2015, 11:50 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!