Function specialization <Arg[3] = Dead>

With some crash we see Arg[3] = Dead. What does it mean? Is there a document which has the details about such crash report?

function specialization <Arg[3] = Dead>

The method has 3 parameters as shown below with two completion handlers at the end.

When the crash happens it mainly happens during the fatalError, however log does not show the fatal error message it shows the lines at which crash happened.

How to understand the argument dead crash?

static func someMethod(param1: String, 
                                       param2: @escaping () -> Void, 
                                       param3: @escaping () -> Void) {
guard let someConditionhere else {
     // When crash happens it basically lands here
    fatalError("Something went wrong")
}
param2()
param3()
}

That's from the pretty-printing of the function symbol and has nothing directly to do with the crash. In this case, it means that the optimizer decided that it was useful to create and call a specialized version of your function that doesn't need the parameter at index 3 (the parameter is "dead", i.e. unused), which I'm guessing is the Self argument. That specialized function then crashed, presumably because you asked it to with fatalError.

2 Likes