-
-
Notifications
You must be signed in to change notification settings - Fork 372
Open
Description
Description
mach/arm/exception.h defines codes for EXC_ARITHMETIC
#define EXC_ARM_FP_UNDEFINED 0 /* Undefined Floating Point Exception */
#define EXC_ARM_FP_IO 1 /* Invalid Floating Point Operation */
#define EXC_ARM_FP_DZ 2 /* Floating Point Divide by Zero */
#define EXC_ARM_FP_OF 3 /* Floating Point Overflow */
#define EXC_ARM_FP_UF 4 /* Floating Point Underflow */
#define EXC_ARM_FP_IX 5 /* Inexact Floating Point Result */
#define EXC_ARM_FP_ID 6 /* Floating Point Denormal Input */We use these codes to improve the generic exception message
sentry-cocoa/Sources/SentryCrash/Recording/SentryCrashDoctor.m
Lines 445 to 447 in ecd9ecd
| if ([self isMathError:errorReport]) { | |
| return @"Math error (usually caused from division by 0)."; | |
| } |
We could achieve this by getting a better machCodeName here
sentry-cocoa/Sources/SentryCrash/Recording/SentryCrashReport.c
Lines 1278 to 1281 in ecd9ecd
| const char *machExceptionName = sentrycrashmach_exceptionName(crash->mach.type); | |
| const char *machCodeName = crash->mach.code == 0 | |
| ? NULL | |
| : sentrycrashmach_kernelReturnCodeName(crash->mach.code); |
or here
sentry-cocoa/Sources/SentryCrash/Recording/SentryCrashDoctor.m
Lines 300 to 310 in ecd9ecd
| - (BOOL)isMathError:(NSDictionary *)errorReport | |
| { | |
| NSDictionary *machError = [errorReport objectForKey:@SentryCrashField_Mach]; | |
| if (machError != nil) { | |
| NSString *exceptionName = [machError objectForKey:@SentryCrashField_ExceptionName]; | |
| return [exceptionName isEqualToString:@"EXC_ARITHMETIC"]; | |
| } | |
| NSDictionary *signal = [errorReport objectForKey:@SentryCrashField_Signal]; | |
| NSString *sigName = [signal objectForKey:@SentryCrashField_Name]; | |
| return [sigName isEqualToString:@"SIGFPE"]; | |
| } |
Came up in #2662.
Metadata
Metadata
Assignees
Projects
Status
Backlog