Xcode8-beta1 (8S128d): Crash when removing characters from CharacterSet

Originator:benchatelain
Number:rdar://26880260 Date Originated:2016-06-18
Status:Dup of 26608216 Resolved:
Product:Other (Swift) Product Version:Xcode8-beta1 (8S128d) / Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Classification:Crash/Hang/DataLoss Reproducible:Always
 
Summary:
Attempting to remove characters from a CharacterSet causes a crash. Using the same API on NSCharacterSet does not.

Steps to Reproduce:
1. Download the project in the following repo: https://github.com/phatblat/MutableCharacterSet
2. Run the command line app

Expected Results:
I expect the app to print the following to the console and to not crash:

Optional("1234")

Actual Results:
The app crashes with the following message:

2016-06-18 22:18:48.143 MutableCharacterSet[55285:1881882] Abstract class Foundation._SwiftNSCharacterSet does not implement method mutableCopyWithZone:; it must be implemented in subclasses.
2016-06-18 22:18:48.144 MutableCharacterSet[55285:1881882] -[Foundation._SwiftNSCharacterSet mutableCopyWithZone:]: unrecognized selector sent to instance 0x100a02380
-[Foundation._SwiftNSCharacterSet mutableCopyWithZone:]: unrecognized selector sent to instance 0x100a02380

4306502296

objc[55285]: pthread_rwlock_rdlock failed (11)

Regression:
Using `NSCharacterSet.urlQueryAllowed()` instead of `CharacterSet.urlQueryAllowed` changes this app to provide the expected results. See:
https://github.com/phatblat/MutableCharacterSet/commit/6047b4fdc82b964c2879dbfc8e4698840d2ff7f0

Notes:

https://github.com/phatblat/MutableCharacterSet

Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9

Comments

Apple's response

Engineering has determined that your bug report (26880260) is a duplicate of another issue (26608216) and will be closed.

By benchatelain at Aug. 1, 2016, 4:58 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!