Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-5971] [CharacterSet] init(charactersIn string: String) crashes when string contains non-BMP scalars on Linux. #3804

Closed
YOCKOW opened this issue Sep 23, 2017 · 2 comments

Comments

@YOCKOW
Copy link
Collaborator

YOCKOW commented Sep 23, 2017

Previous ID SR-5971
Radar None
Original Reporter @YOCKOW
Type Bug
Status Resolved
Resolution Done
Environment
  • OS: Ubuntu 16.04

  • Swift 4.0 / 3.1.1

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 992598caa270f5762f13aaf2ccbae572

Issue Description:

Very simple code below will crash on Linux.

[Code]

import Foundation
let cset = CharacterSet(charactersIn:"\u{10000}" ..< "\u{10001}") // no problem 
let cset2 = CharacterSet(charactersIn:"\u{10000}") // crashes

[Result]

* thread #&#8203;1, name = 'repl_swift', stop reason = signal SIGSEGV: invalid address (fault address: 0xdc00)
    frame #&#8203;0: 0x00007ffff3a85180 libFoundation.so`chcompar
libFoundation.so`chcompar:
->  0x7ffff3a85180 <+0>: movzwl (%rsi), %ecx
    0x7ffff3a85183 <+3>: movzwl (%rdi), %eax
    0x7ffff3a85186 <+6>: subl   %ecx, %eax
    0x7ffff3a85188 <+8>: retq   
Target 0: (repl_swift) stopped.
@swift-ci
Copy link
Contributor

Comment by Cyril Lashkevich (JIRA)

Pull request with fix #1470

@YOCKOW
Copy link
Collaborator Author

YOCKOW commented Jul 19, 2018

Thank you for fixing it (and sorry for late reply).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants