iOS 7.1 deployment target and EXC_BAD_ACCESS

Originator:MarcelWlotzka
Number:rdar://21541766 Date Originated:25-Jun-2015 10:17 AM
Status:Closed Resolved:YES
Product:Developer Tools Product Version:Xcode 7.0 Beta 2
Classification:Bug Reproducible:Everytime
 
Summary:
When compiling an app for iOS 7 using XCode 7.0 Beta 2 I encountered two problems as soon as I extend the WKWebView: EXC_BAD_ACCESS on accessing static variables on an iOS 7.1.1 device and EXC_BAD_ACCESS on launch in debug mode on iOS 9 device.

Description:
When running on iOS 7.1.1 I get a crash in my sample program when I access a static variable.
Debugging revealed that this crash only happens when I write an extension for the WKWebView. It does not change a thing if there are methods in this extension or not. The declaration itself is enough.
As soon as I remove the protocol VCWebViewProvider from my WKWebView extension the program runs fine.

I guess there is a problem because I add an extension with a protocol to a class which is not available in iOS 7. I marked the extension as available in iOS 8 but this is not changing the behavior.

Additionally I get a crash in the AppDelegate when I want to run the app on iOS 9. The error does not happen when I change the deployment target to iOS 8 and does not produce a crash when I run the app without attaching the debugger but run the app directly from the springboard.

Steps to Reproduce:
1. Open XCode project
2. Run on iOS 7.1 device (not simulator)
3. App crashes in line 43 with EXC_BAD_ACCESS in ViewController.swift
4. Run on iOS 9 device
5. App crashes in AppDelegate.swift in line 13

Expected Results:
App does not crash at all.

Actual Results:
App crashes

Version:
Xcode 7.0 beta 2 (7A121l)

Notes:
Workaround: Deployment target 8.0. Remove protocol from WKWebView extension

Configuration:
iOS 7 device: iPad 3 (A1416) running iOS 7.1.1 (11D201)
iOS 9 device: iPad Air 2 (A1567) running iOS 9.0 Beta 2 (13A4280e)

Comments


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!