How to read the accident log? How to find the cause of application failure in the system library? What does EXC_CRASH (SIGABRT) mean?

I have client crash logs to understand why my app crashed on her iPhone.

Here is some information from the crash log:

  Exception Type: EXC_CRASH (SIGABRT)
 Exception Codes: 0x00000000, 0x00000000
 Crashed thread: 0

Stack Trace for Thread 0

  Thread 0 Crashed:
 0 libSystem.B.dylib 0x3293f98c 0x328c1000 + 518540
 1 libSystem.B.dylib 0x3293f97c 0x328c1000 + 518524
 2 libSystem.B.dylib 0x3293f96e 0x328c1000 + 518510
 3 libSystem.B.dylib 0x3295461a 0x328c1000 + 603674
 4 libstdc ++. 6.dylib 0x30a143b0 0x309cf000 + 283568
 5 libobjc.A.dylib 0x3347a858 0x33475000 + 22616
 6 libstdc ++. 6.dylib 0x30a12776 0x309cf000 + 276342
 7 libstdc ++. 6.dylib 0x30a127ca 0x309cf000 + 276426
 8 libstdc ++. 6.dylib 0x30a12896 0x309cf000 + 276630
 9 libobjc.A.dylib 0x33479714 0x33475000 + 18196
 10 CoreFoundation 0x335c8210 0x33534000 + 606736
 11 CoreFoundation 0x3354ea8e 0x33534000 + 109198
 12 CoreFoundation 0x33545ab8 0x33534000 + 72376
 13 Journaler Lite 0x0001699e - [AccountManager unsignedIntegerValueForPath:] (AccountManager.m: 151)
 ...

Here is the code from AccountManager.m :

  NSNumber * number = ...;
  if (number) {
   return [number unsignedIntegerValue];  // line 151
  } else {
   return 0;
  }

The main question is how to read such a crash log? The application crashes somewhere in the system library, there is no more additional information. Is there any way to find the cause of the failure?

update: I came across a lot of posts in forums where the exception type is EXC_CRASH (SIGABRT) and the first lines from the broken stream are:

  Thread 0 Crashed:
 0 libSystem.B.dylib 0x3293f98c 0x328c1000 + 518540
 1 libSystem.B.dylib 0x3293f97c 0x328c1000 + 518524
 2 libSystem.B.dylib 0x3293f96e 0x328c1000 + 518510
 3 libSystem.B.dylib 0x3295461a 0x328c1000 + 603674
 4 libstdc ++. 6.dylib 0x30a143b0 0x309cf000 + 283568
 5 libobjc.A.dylib 0x3347a858 0x33475000 + 22616
 6 libstdc ++. 6.dylib 0x30a12776 0x309cf000 + 276342
 7 libstdc ++. 6.dylib 0x30a127ca 0x309cf000 + 276426
 8 libstdc ++. 6.dylib 0x30a12896 0x309cf000 + 276630
 9 libobjc.A.dylib 0x33479714 0x33475000 + 18196
 10 CoreFoundation 0x335c8210 0x33534000 + 606736
 11 CoreFoundation 0x3354ea8e 0x33534000 + 109198

What does this type of exception EXC_CRASH (SIGABRT) )?

+6
iphone nsnumber sigabrt
source share
1 answer

First, you need to symbolize the crash log using DSYM to understand what is happening. You need to have a DSYM file since the application was created. The DSYM file allows you to cancel a card from these memory addresses back to readable lines of code.

SIGABRT is the signal you receive when you have an unhandled exception, for example, calling [someArray objectAtIndex:2] if the array has only 1 element. Or, most often, an unrecognized selector: [NSArray unsignedIntValue] .

Take a look at this crash log for this question . Note that Foundation call stack libraries are the same as your code, and this is an unrecognized selector.

Your code:

 NSNumber *num = foo; if (num) { bar = [num unsignedIntValue]; } 

What you did not tell us, but very important, is what is in "foo". How to assign this NSNumber? If this is any object other than NSNumber, then your fault log will look like yours.

If you want to be REALLY defensive in your programming, you can say:

 if (num && [num isKindOfClass:[NSNumber class]]) 

But in fact, regardless of your "foo", you always need to return NSNumber.

+5
source share

All Articles