Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Piece of code in Playground that reliably crashes lldb server

Dare anyone try the following code in any Playground:

// Define a model that conforms to Codable
struct User: Codable {
    var name: String
    var age: Int
    var email: String?
}

// JSON data (as a string for demonstration)
let jsonString = """
{
    "name": "John Doe",
    "age": 30,
    "email": "john@example.com"
}
"""

// Convert the JSON string to Data
if let jsonData = jsonString.data(using: .utf8) {
    do {
        // Parse the JSON data into the User model
        let user = try JSONDecoder().decode(User.self, from: jsonData)
        print("Name: \(user.name), Age: \(user.age), Email: \(user.email ?? "N/A")")
    } catch {
        print("Error decoding JSON: \(error)")
    }
}

I tested with Xcode 16.2 and latest 16.3, it reliably crashes the lldb server!

BTW, it works perfectly in the old Xcode 14.2 version.

Two things:

  1. Raise a bug, like the error tells you to.
  2. Don't post screenshots of errors as they cannot be searched for when someone else encounters the same issue.

Thanks.

Oh, and if you do file a bug, please post your bug number, just for the record.

ps For hints and tips about how to file bugs effectively, see Bug Reporting: How and Why?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Here is the bug ticket.

I have the same problem.

FB17182730 filed with sample playground and diagnostics file.

I can reliably reproduce the crash with just this code: try JSONDecoder().decode([String].self, from: Data("[]".utf8))

I've filed FB17195505 with a sample playground to reproduce it.

Piece of code in Playground that reliably crashes lldb server
 
 
Q