Skip to content

Commit 778f2fe

Browse files
committed
PR feedback
1 parent e3b3ad9 commit 778f2fe

File tree

6 files changed

+15
-54
lines changed

6 files changed

+15
-54
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- Properties on SentryOptions that had no effect on the WithoutUIKit variant are now removed from the API (#6644)
2424
- Removes the SentryOptions.inAppExclude property because it had no effect (#6646)
2525
- Removes segment property on SentryUser, SentryBaggage, and SentryTraceContext (#5638)
26+
- Removes local symbolication when `debug=True` which fixes various deadlocks (#6562)
2627
- Removes deprecated TraceContext initializers (#6348)
2728
- Removes deprecated user feedback API, this is replaced with the new feedback API (#5591)
2829
- Removes `enablePerformanceV2` option and makes this the default. The app start duration will now finish when the first frame is drawn instead of when the OS posts the UIWindowDidBecomeVisibleNotification. (#6008)

Sources/Sentry/SentryUseNSExceptionCallstackWrapper.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ - (instancetype)initWithName:(NSExceptionName)aName
4444
enumerateObjectsUsingBlock:^(NSNumber *_Nonnull obj, NSUInteger idx, BOOL *_Nonnull stop) {
4545
SentryCrashStackCursor stackCursor;
4646
stackCursor.stackEntry.address = [obj unsignedLongValue];
47+
stackCursor.stackEntry.imageName = nil;
48+
stackCursor.stackEntry.imageAddress = 0;
49+
stackCursor.stackEntry.symbolAddress = 0;
50+
stackCursor.stackEntry.symbolName = nil;
4751

4852
[frames addObject:[crashStackToEntryMapper
4953
sentryCrashStackEntryToSentryFrame:stackCursor.stackEntry]];

Sources/SentryCrash/Recording/SentryCrashDoctor.m

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -262,30 +262,6 @@ - (NSDictionary *)basicRegistersFromThreadReport:(NSDictionary *)threadReport
262262
return basic;
263263
}
264264

265-
- (NSDictionary *)lastInAppStackEntry:(NSDictionary *)report
266-
{
267-
NSString *executableName = [self mainExecutableNameForReport:report];
268-
NSDictionary *crashedThread = [self crashedThreadReport:report];
269-
NSArray *backtrace = [self backtraceFromThreadReport:crashedThread];
270-
for (NSDictionary *entry in backtrace) {
271-
NSString *objectName = [entry objectForKey:@SentryCrashField_ObjectName];
272-
if ([objectName isEqualToString:executableName]) {
273-
return entry;
274-
}
275-
}
276-
return nil;
277-
}
278-
279-
- (NSDictionary *)lastStackEntry:(NSDictionary *)report
280-
{
281-
NSDictionary *crashedThread = [self crashedThreadReport:report];
282-
NSArray *backtrace = [self backtraceFromThreadReport:crashedThread];
283-
if ([backtrace count] > 0) {
284-
return [backtrace objectAtIndex:0];
285-
}
286-
return nil;
287-
}
288-
289265
- (BOOL)isInvalidAddress:(NSDictionary *)errorReport
290266
{
291267
NSDictionary *machError = [errorReport objectForKey:@SentryCrashField_Mach];
@@ -329,25 +305,6 @@ - (BOOL)isMemoryCorruption:(NSDictionary *)report
329305
}
330306
}
331307

332-
NSArray *backtrace = [self backtraceFromThreadReport:crashedThread];
333-
for (NSDictionary *entry in backtrace) {
334-
NSString *objectName = [entry objectForKey:@SentryCrashField_ObjectName];
335-
NSString *symbolName = [entry objectForKey:@SentryCrashField_SymbolName];
336-
if ([symbolName isEqualToString:@"objc_autoreleasePoolPush"]) {
337-
return YES;
338-
}
339-
if ([symbolName isEqualToString:@"free_list_checksum_botch"]) {
340-
return YES;
341-
}
342-
if ([symbolName isEqualToString:@"szone_malloc_should_clear"]) {
343-
return YES;
344-
}
345-
if ([symbolName isEqualToString:@"lookUpMethod"] &&
346-
[objectName isEqualToString:@"libobjc.A.dylib"]) {
347-
return YES;
348-
}
349-
}
350-
351308
return NO;
352309
}
353310

@@ -359,8 +316,6 @@ - (BOOL)wasProgramTerminationRequested:(NSDictionary *)errorReport
359316
- (SentryCrashDoctorFunctionCall *)lastFunctionCall:(NSDictionary *)report
360317
{
361318
SentryCrashDoctorFunctionCall *function = [[SentryCrashDoctorFunctionCall alloc] init];
362-
NSDictionary *lastStackEntry = [self lastStackEntry:report];
363-
function.name = [lastStackEntry objectForKey:@SentryCrashField_SymbolName];
364319

365320
NSDictionary *crashedThread = [self crashedThreadReport:report];
366321
NSDictionary *notableAddresses =
@@ -425,13 +380,11 @@ - (BOOL)isStackOverflow:(NSDictionary *)crashedThreadReport
425380
- (NSString *)diagnoseCrash:(NSDictionary *)report
426381
{
427382
@try {
428-
NSString *lastFunctionName =
429-
[[self lastInAppStackEntry:report] objectForKey:@SentryCrashField_SymbolName];
430383
NSDictionary *crashedThreadReport = [self crashedThreadReport:report];
431384
NSDictionary *errorReport = [self errorReport:report];
432385

433386
if ([self isStackOverflow:crashedThreadReport]) {
434-
return [NSString stringWithFormat:@"Stack overflow in %@", lastFunctionName];
387+
return [NSString stringWithFormat:@"Stack overflow"];
435388
}
436389

437390
NSString *crashType = [errorReport objectForKey:@SentryCrashField_Type];

Sources/SentryCrash/Recording/SentryCrashReportFields.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@
7777
#pragma mark - Backtrace -
7878

7979
#define SentryCrashField_InstructionAddr "instruction_addr"
80-
#define SentryCrashField_LineOfCode "line_of_code"
81-
#define SentryCrashField_ObjectAddr "object_addr"
82-
#define SentryCrashField_ObjectName "object_name"
83-
#define SentryCrashField_SymbolAddr "symbol_addr"
84-
#define SentryCrashField_SymbolName "symbol_name"
8580

8681
#pragma mark - Stack Dump -
8782

Sources/SentryCrash/Recording/Tools/SentryCrashStackCursor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern "C" {
4646
typedef struct {
4747
/** Current address in the stack trace. */
4848
uintptr_t address;
49-
49+
5050
/** The name (if any) of the binary image the current address falls
5151
* inside. */
5252
const char *imageName;

develop-docs/DECISIONS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Decision Log
22

3+
## No local symbolication of crashes
4+
5+
Date: Nov 7th, 2025
6+
Contributors: @noahsmartin, @philipphofmann
7+
8+
We decided to remove local symbolication when capturing a crash. The existing local symbolication was not signal-safe and caused deadlocks (https://github.com/getsentry/sentry-cocoa/issues/6560).
9+
It is possible to implement local symbolication that does not cause deadlocks; however, it would be a debug-only feature, since in production apps should have their symbols stripped and only available in the dSYM. Therefore, to quickly fix the issue, we decided to remove all unsafe local symbolication in v9. The addition of signal-safe symbolication for binaries with symbols can always be added in a future minor version.
10+
311
## Not capturing screenshots for crashes
412

513
Date: April 21st 2022

0 commit comments

Comments
 (0)