Skip to content

Commit 29ff851

Browse files
committed
PR feedback
1 parent 8a49ea0 commit 29ff851

File tree

9 files changed

+16
-62
lines changed

9 files changed

+16
-62
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/SentryCrashReportConverter.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,6 @@ - (SentryFrame *)stackFrameAtIndex:(NSInteger)frameIndex inThreadIndex:(NSIntege
307307
= (uintptr_t)[frameDictionary[@"instruction_addr"] unsignedLongLongValue];
308308
NSDictionary *binaryImage = [self binaryImageForAddress:instructionAddress];
309309
SentryFrame *frame = [[SentryFrame alloc] init];
310-
// The symbol address is not known, so it defaults to 0
311-
frame.symbolAddress = @"0x0000000000000000";
312310
frame.instructionAddress = sentry_formatHexAddress(frameDictionary[@"instruction_addr"]);
313311
frame.imageAddress = sentry_formatHexAddress(binaryImage[@"image_addr"]);
314312
frame.package = binaryImage[@"name"];

Sources/Sentry/SentryStacktrace.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ - (void)fixDuplicateFrames
2929
return;
3030
}
3131

32-
SentryFrame *lastFrame = self.frames.lastObject;
3332
SentryFrame *beforeLastFrame = [self.frames objectAtIndex:self.frames.count - 2];
3433

35-
if ([lastFrame.symbolAddress
36-
isEqualToString:SENTRY_UNWRAP_NULLABLE(NSString, beforeLastFrame.symbolAddress)]
37-
&& [self.registers[@"lr"]
34+
if ([self.registers[@"lr"]
3835
isEqualToString:SENTRY_UNWRAP_NULLABLE(NSString, beforeLastFrame.instructionAddress)]) {
3936
NSMutableArray *copyFrames = self.frames.mutableCopy;
4037
[copyFrames removeObjectAtIndex:self.frames.count - 2];

Sources/Sentry/SentryUseNSExceptionCallstackWrapper.m

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

4751
[frames addObject:[crashStackToEntryMapper
4852
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;

Tests/SentryTests/SentryCrashReportConverterTests.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ - (void)testConvertReport
5555
XCTAssertEqualObjects(firstDebugImage.imageSize, @(65536));
5656

5757
SentryException *exception = event.exceptions.firstObject;
58-
XCTAssertEqualObjects(
59-
exception.stacktrace.frames.lastObject.symbolAddress, @"0x0000000000000000");
6058
XCTAssertEqualObjects(
6159
exception.stacktrace.frames.lastObject.instructionAddress, @"0x000000010014caa4");
6260
XCTAssertEqualObjects(

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. 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)