From 8743e932087d0055c74bf397e3c9bbbefcd16f3f Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Wed, 17 Sep 2025 15:13:08 +0200 Subject: [PATCH 1/2] fix: Potential app launch hang caused by the SDK Remove unused crash report fields binary_cpu_type and binary_cpu_subtype so we can also remove the call to _dyld_get_image_header, which lead to app launch hangs for a customer. Still, these fields might be useful and we can readd them with GH-6180. --- CHANGELOG.md | 6 ++++++ .../Recording/Monitors/SentryCrashMonitor_System.m | 3 --- Sources/SentryCrash/Recording/SentryCrash.m | 2 -- Sources/SentryCrash/Recording/SentryCrashReport.c | 4 ---- Sources/SentryCrash/Recording/SentryCrashReportFields.h | 2 -- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f407be9a16..504f1b061e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Fix potential app launch hang caused by the SentrySDK (#6181) Fixed by removing the call to `_dyld_get_image_header` on the main thread. + ## 8.56.0 ### Features diff --git a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m index 3a176c0fce0..b13fe73e611 100644 --- a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m +++ b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m @@ -499,7 +499,6 @@ NSBundle *mainBundle = [NSBundle mainBundle]; NSDictionary *infoDict = [mainBundle infoDictionary]; - const struct mach_header *header = _dyld_get_image_header(0); #if SENTRY_HOST_IOS g_systemData.systemName = "iOS"; @@ -559,8 +558,6 @@ g_systemData.cpuArchitecture = getCurrentCPUArch(); g_systemData.cpuType = sentrycrashsysctl_int32ForName("hw.cputype"); g_systemData.cpuSubType = sentrycrashsysctl_int32ForName("hw.cpusubtype"); - g_systemData.binaryCPUType = header->cputype; - g_systemData.binaryCPUSubType = header->cpusubtype; g_systemData.processName = cString([NSProcessInfo processInfo].processName); g_systemData.processID = [NSProcessInfo processInfo].processIdentifier; g_systemData.parentProcessID = getppid(); diff --git a/Sources/SentryCrash/Recording/SentryCrash.m b/Sources/SentryCrash/Recording/SentryCrash.m index 07a7aedd476..b5035cda37a 100644 --- a/Sources/SentryCrash/Recording/SentryCrash.m +++ b/Sources/SentryCrash/Recording/SentryCrash.m @@ -199,8 +199,6 @@ - (NSDictionary *)systemInfo COPY_STRING(cpuArchitecture); COPY_PRIMITIVE(cpuType); COPY_PRIMITIVE(cpuSubType); - COPY_PRIMITIVE(binaryCPUType); - COPY_PRIMITIVE(binaryCPUSubType); COPY_STRING(processName); COPY_PRIMITIVE(processID); COPY_PRIMITIVE(parentProcessID); diff --git a/Sources/SentryCrash/Recording/SentryCrashReport.c b/Sources/SentryCrash/Recording/SentryCrashReport.c index 6ba486db8f4..6debdd9db21 100644 --- a/Sources/SentryCrash/Recording/SentryCrashReport.c +++ b/Sources/SentryCrash/Recording/SentryCrashReport.c @@ -1565,10 +1565,6 @@ writeSystemInfo(const SentryCrashReportWriter *const writer, const char *const k writer->addIntegerElement(writer, SentryCrashField_CPUType, monitorContext->System.cpuType); writer->addIntegerElement( writer, SentryCrashField_CPUSubType, monitorContext->System.cpuSubType); - writer->addIntegerElement( - writer, SentryCrashField_BinaryCPUType, monitorContext->System.binaryCPUType); - writer->addIntegerElement( - writer, SentryCrashField_BinaryCPUSubType, monitorContext->System.binaryCPUSubType); writer->addStringElement( writer, SentryCrashField_ProcessName, monitorContext->System.processName); writer->addIntegerElement( diff --git a/Sources/SentryCrash/Recording/SentryCrashReportFields.h b/Sources/SentryCrash/Recording/SentryCrashReportFields.h index dea483265f6..96b8ce5df45 100644 --- a/Sources/SentryCrash/Recording/SentryCrashReportFields.h +++ b/Sources/SentryCrash/Recording/SentryCrashReportFields.h @@ -187,8 +187,6 @@ #define SentryCrashField_CPUArch "cpu_arch" #define SentryCrashField_CPUType "cpu_type" #define SentryCrashField_CPUSubType "cpu_subtype" -#define SentryCrashField_BinaryCPUType "binary_cpu_type" -#define SentryCrashField_BinaryCPUSubType "binary_cpu_subtype" #define SentryCrashField_DeviceAppHash "device_app_hash" #define SentryCrashField_Executable "CFBundleExecutable" #define SentryCrashField_ExecutablePath "CFBundleExecutablePath" From 501c39c5673f8012f74dc0c8869f425b2a54e98d Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Wed, 17 Sep 2025 15:48:21 +0200 Subject: [PATCH 2/2] remove more occurrences --- .../Recording/Monitors/SentryCrashMonitorContext.h | 2 -- .../Recording/Monitors/SentryCrashMonitor_System.m | 4 ---- 2 files changed, 6 deletions(-) diff --git a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h index 2bd3eac7fbd..a6f7022c46b 100644 --- a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h +++ b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitorContext.h @@ -197,8 +197,6 @@ typedef struct SentryCrash_MonitorContext { const char *cpuArchitecture; int cpuType; int cpuSubType; - int binaryCPUType; - int binaryCPUSubType; const char *processName; int processID; int parentProcessID; diff --git a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m index b13fe73e611..d16a815479c 100644 --- a/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m +++ b/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m @@ -67,8 +67,6 @@ const char *cpuArchitecture; int cpuType; int cpuSubType; - int binaryCPUType; - int binaryCPUSubType; const char *processName; int processID; int parentProcessID; @@ -607,8 +605,6 @@ COPY_REFERENCE(cpuArchitecture); COPY_REFERENCE(cpuType); COPY_REFERENCE(cpuSubType); - COPY_REFERENCE(binaryCPUType); - COPY_REFERENCE(binaryCPUSubType); COPY_REFERENCE(processName); COPY_REFERENCE(processID); COPY_REFERENCE(parentProcessID);