I am testing crash reporting in a SwiftUI app utilizing PLCrashReporter.
After a crash, I export the .crash report and symbolicate it manually with:
export DEVELOPER_DIR=/Functions/Xcode.app/Contents/Developer
/Functions/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Variations/A/Assets/symbolicatecrash intelcr.crash ExampleCrashReport.app.dSYM
- I am 100% positive the UUID of the dSYM matches the crash report;
intelcr.crash File; (BEFORE SYMBOLICATE)
Incident Identifier: 2B9B2CBB-1CFF-400F-9E6E-56A1176CA3D0
{Hardware} Mannequin: iPhone11,8
Course of: ExampleCrashRepo [11608]
Path: /non-public/var/containers/Bundle/Utility/64D58F25-721B-45F9-8628-69861D9C6AFA/ExampleCrashReport.app/ExampleCrashReport
Identifier: com.initialcode.ExampleCrashReportIntel
Model: 1.0 (1)
Code Sort: ARM-64
Mother or father Course of: [1]
Date/Time: 2025-03-26 09:11:52 +0000
OS Model: iPhone OS 15.3.1 (19D52)
Report Model: 104
Exception Sort: SIGSEGV
Exception Codes: SEGV_MAPERR at 0xbffb33333333332d
Crashed Thread: 0
Thread 0 Crashed:
0 libswiftCore.dylib 0x00000001862abe94 + 8
1 libswiftCore.dylib 0x0000000186286a48 swift_arrayDestroy + 132
2 libswiftCore.dylib 0x0000000185fa3548 $ss23_ContiguousArrayStorageCfD + 96
...
...
Binary Photographs:
0x104d2c000 - 0x104d63fff +ExampleCrashReport arm64 /non-public/var/containers/Bundle/Utility/64D58F25-721B-45F9-8628-69861D9C6AFA/ExampleCrashReport.app/ExampleCrashReport
0x1074f0000 - 0x1074fbfff libobjc-trampolines.dylib arm64e <58c8b0fa678c3facb062bf94644e78c7> /usr/lib/libobjc-trampolines.dylib
...
...
DSYM UUID:
UUID: C740ADC8-3B47-3671-ADA6-46CC6264249E (arm64) ExampleCrashReport.app.dSYM/Contents/Assets/DWARF/ExampleCrashReport
Regardless of all that, the output nonetheless exhibits one thing like this: (AFTER SYMBOLICATE)
Incident Identifier: 2B9B2CBB-1CFF-400F-9E6E-56A1176CA3D0
{Hardware} Mannequin: iPhone11,8
Course of: ExampleCrashRepo [11608]
Path: /non-public/var/containers/Bundle/Utility/64D58F25-721B-45F9-8628-69861D9C6AFA/ExampleCrashReport.app/ExampleCrashReport
Identifier: com.initialcode.ExampleCrashReportIntel
Model: 1.0 (1)
Code Sort: ARM-64
Mother or father Course of: [1]
Date/Time: 2025-03-26 09:11:52 +0000
OS Model: iPhone OS 15.3.1 (19D52)
Report Model: 104
Exception Sort: SIGSEGV
Exception Codes: SEGV_MAPERR at 0xbffb33333333332d
Crashed Thread: 0
Thread 0 Crashed:
0 libswiftCore.dylib 0x00000001862abe94 swift::metadataimpl::ValueWitnesses<:metadataimpl::opaqueexistentialbox>>::destroy+ 8 (swift::OpaqueValue*, swift::TargetMetadata<:inprocess> const*) + 8
1 libswiftCore.dylib 0x0000000186286a48 swift_arrayDestroy + 132
2 libswiftCore.dylib 0x0000000185fa3548 $ss23_ContiguousArrayStorageCfD + 96
3 libswiftCore.dylib 0x0000000186293cb4 _swift_release_dealloc + 56
4 ExampleCrashReport 0x0000000104d36b48 _mh_execute_header + 43848
...
...
The output it ought to present ought to really be the road when the Crash – 2 button is clicked within the ContentView class;
import SwiftUI
struct ContentView: View {
@State non-public var exportedCrashURL: URL?
@State non-public var isSharePresented = false
var physique: some View {
VStack(spacing: 20) {
Picture(systemName: "globe")
.imageScale(.massive)
.foregroundColor(.accentColor)
Textual content("ExampleCrashApp")
Button("Crash") {
take a look at().getStartedButtonClicked()
}
.padding()
.background(Colour.purple)
.foregroundColor(.white)
.cornerRadius(8)
Button("Crash - 2") {
let non-obligatory: String? = nil
print(non-obligatory!)
}
.padding()
.background(Colour.purple)
.foregroundColor(.white)
.cornerRadius(8)
Button("Share CrashReport With PLCrashReporter") {
CrashTracker.shared.exportCrashReportToDisk { url in
if let url = url {
CrashShareManager.shareCrashFile(at: url)
} else {
print("Crash report not discovered.")
}
}
}
.padding()
.background(Colour.blue)
.foregroundColor(.white)
.cornerRadius(8)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
class take a look at {
@inline(by no means)
@objc func getStartedButtonClicked() {
let numbers = [0]
let _ = numbers[1]
}
}
I’ve an older and larger venture in Xcode. Once more, I create crash experiences utilizing the PLCrashReporter library and there’s no downside with the symbolicate operations in that app.
Nevertheless, once I create a brand new demo app with virtually the identical settings, I can’t observe the tactic names and line numbers within the symbolicate output.
Deployment Settings;
(This is identical app settings that offers correct crash output, if there was an issue with these settings, I believe there could be an issue with my different app.)
After I attempt the next command after asking the query, I get the right output, however I nonetheless want it to mechanically symbolize instantly with the symbolicate command as a substitute of specifying the deal with manually like this;
atos -o ExampleCrashReport.app.dSYM/Contents/Assets/DWARF/ExampleCrashReport -l 0x104d2c000 0x0000000104d36b48
Output;
closure #2 in closure #1 in ContentView.physique.getter (in ExampleCrashReport) (ContentView.swift:45)
Any ideas or lacking steps?