Skip to content

[SR-8965] NSError.localizedDescription caused SIGABRT with StaticString #51470

@swift-ci

Description

@swift-ci
Previous ID SR-8965
Radar https://bugreport.apple.com/web/?problemID=45171933
Original Reporter leohemanth (JIRA User)
Type Bug

Attachment: Download

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

md5: c599fed8c34270c778132f5ec0f0703f

Issue Description:

Calling localizedDescription on NSError when userInfo has StringString causes SIGABRT

The following code causes SIGABRT every single time.

let reason: StaticString = "Static String"
let userInfo = [
 NSLocalizedDescriptionKey: "Localized Description",
 "Reason": reason
]
let error = NSError(domain: "Some Error", code: 0, userInfo: userInfo)
print(error.localizedDescription)

Attached sample playground to showcase the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.standard libraryArea: Standard library umbrella

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions