You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to initialize a `CharacterSet` using `(charactersIn: String)`, the application crashes with a seg fault if the string contains 64 or more characters. It doesn't seem to matter what characters are included.
The issue occurs on Ubuntu 16.04 (haven't tested other versions) but does NOT occur on macOS.
Tested on Swift 3.0.1 Release and swift-DEVELOPMENT-SNAPSHOT-2016-11-12-a-ubuntu16.04
The crash occurs in `CFCharacterSetAddCharactersInString` method which is called from `_CFCharacterSetInitWithCharactersInString` when string length is greater than or equal to 64.
The reason for a crash is this line (2295 atm): `CF_SWIFT_FUNCDISPATCHV(__kCFCharacterSetTypeID, void, (CFSwiftRef)theSet, NSMutableCharacterSet.addCharactersInString, theString);`.
The problem is that `__CFSwiftBridge` for `NSMutableCharacterSet` is not set.
But setting it would fail first due to cast error: Could not cast value of type 'SwiftFoundation.NSCharacterSet' to 'SwiftFoundation.NSMutableCharacterSet'.
Fix for this cast error leads to infinite loop like in https://bugs.swift.org/browse/SR-936.
Seems like the use of `_NSCFCharacterSet` in init method can fix that, but only for CharacterSet.
Additional Detail from JIRA
md5: baba1de3237b484d77abb461b9bc657a
Issue Description:
When trying to initialize a `CharacterSet` using `(charactersIn: String)`, the application crashes with a seg fault if the string contains 64 or more characters. It doesn't seem to matter what characters are included.
The issue occurs on Ubuntu 16.04 (haven't tested other versions) but does NOT occur on macOS.
Tested on Swift 3.0.1 Release and swift-DEVELOPMENT-SNAPSHOT-2016-11-12-a-ubuntu16.04
Steps to reproduce in REPL:
>> Execution interrupted.
The text was updated successfully, but these errors were encountered: