iOS apps without crash, the Internet statistical analysis tool AU has a project error analysis feature, dedicated to application crash log statistics, the recent study on the Friends of the crash log statistics, the crash log to do a simple summary.
iOS Crash log classification:
One, low memory crash: When the iOS device detects low memory, the virtual memory system sends notification requests that the app frees memory. These notifications are sent to all running apps and processes, trying to reclaim some memory. If memory usage remains high, the system terminates the background thread to relieve memory pressure. If enough memory is available, the app will be able to continue running without generating a crash report. Otherwise, the app will be terminated by iOS and generate a low memory crash report. There is no stack backtracking on the application thread on the low memory crash log. Instead, it shows the amount of memory used per process in memory pages. (The size of a memory page is 4KB) you will see the jettisoned word after the process name that the iOS terminated due to the release of the memory page. If you see that it appears behind your app's name, your app is terminated because it uses too much memory.
Second, common exception Codes:
0X8BADF00D: Read "ate bad food" This code indicates that the app was terminated by iOS because of a watchdog timeout. It is usually the application that takes too much time to start, stop, or ring the application system events. This kind of crash is likely to be in a very poor network situation and have to start the app when the synchronization network blocking the main thread caused by the crash, so we should try to take some time-consuming tasks such as synchronous network away from the main thread, so that the application can start normally.
0xbaaaaaad: The user hold down the home and volume keys to get the current memory status, does not represent a crash
0xbad22222:voip applications are terminated because they are restarted too frequently.
0XC00010FF: Because it is too hot to be killed, meaning "cool off"
0xdead10cc: Read "dead lock"! This code indicates that the app is terminated because it consumes system resources when it is running in the background, such as when the Contacts database is not released
0XDEADFA11: Read "Dead Fall"! This code indicates that the app was forcibly exited by the user. According to the Apple documentation, the force exit occurs when the user presses the switch button until the "swipe to shut down" appears, and then long press the home button. Forcing the exit will result in a crash log containing the 0XDEADFA11 exception encoding because most of the forced exits are due to the application blocking the interface.
Third, common exception types:
Viewing our Crash Analysis report message, you will find that the most common type of error encountered is SEGV (segmentation violation, Segment violation), which indicates improper memory operation, such as access to a memory address that does not have permissions.
When we receive the SIGSEGV signal, we can consider the following aspects:
1), Access invalid memory address, such as access to Zombie (zombie) object;
2), try to write data to the read-only area;
3), reference null pointer;
4), using an uninitialized pointer;
5), stack overflow;
In addition, there are other common signals:
SIGABRT: Receive abort signal, may call abort () or receive external signal sent over;
Sigbus: Bus error. Unlike SIGSEGV, SIGSEGV accesses an invalid address (such as a virtual memory mapping is not physical), and Sigbus accesses a valid address, but bus access exceptions (such as address alignment issues);
Sigill: Attempt to execute an illegal instruction that may not be recognized or has no authority;
Sigfpe:floating point Error, mathematical calculation related problems (may not be limited to floating points calculation), such as except 0 operations;
Sigpipe: No process at the other end of the pipeline takes over data;
Third, parsing the crash log:
To get a copy of the crash crash log, we need to map the original information, such as the hexadecimal address, to the source-level method name and the number of lines of code, making it readable to developers. This process is called symbolic parsing. To successfully symbolize (symbolication) parse a copy of the crash log, we need to have the corresponding application binaries as well as the symbol (. dSYM) file.
The following is mainly for the friends of the common crash log parsing
Look, there's a line of crash logs in crash log.
6 appname 0x350f3b appname + 3460923
There is also a line behind the stack information:
DSYM UUID: b52242b9-c4fd-3750-8d3b-ab313091f44d
based on crash log, get the app's UUID. The UUID is a string that consists of 32 characters. By getting the UUID, you will know which version of you is having problems with the user's iphone.
So, we go to our dSYM file to see if our UUID is consistent with the UUID on the crash log, only the UUID of the dSYM file and the UUID on the crash log will let us properly symbolize the crash log.
Dwarfdump is a free gadget on Mac that can use this gadget to detect the UUID of our app (the following process is done on the terminal)
1, the order is:dwarfdump--uuid golo.app.dsym/(first into our/users/username/documents/mydocment/appname.xcarchive/ dsyms/directory)
If you are prompted xcrun:error:active developer path ("/volumes/xcode/xcode.app/contents/developer") does not exist, use Xcode-select to change
2. At this time, we use the sudo xcode-select--switch/applications/xcode.app/contents/developer/ Command (The purpose of this command is also in the study)
3. We re-type the command:dwarfdump--uuid golo.app.dsym/
at this point, there will be No 1 error prompt, but the hint: UUID:b52242b9-c4fd-3750-8d3b-ab313091f44d (ARMV7) appname.app.dsym/contents/resources/dwarf/appname
Here we can see that the UUID of our dSYM file is consistent with the UUID of our crash log, and here we are ready to finish the work
Next, Parse crash log:
4. Type command in terminal:dwarfdump--arch=armv7--lookup 0x350f3b /users/username/documents/mydocment/ Appname.xcarchive/dsyms/gaappname.app.dsym/contents/resources/dwarf/appname
at this time, no unexpected words, should show
looking up address:0x0000000000350f3b in. Debug_info ... found!
0x006e52dd:compile unit:length = 0x0000806a Version = 0x0002 Abbr_offset = 0x00000000 addr_size = 0x04 (Next CU At 0x006ed34b)
0x006e52e8:tag_compile_unit [1] *
at_producer ("Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)")
at_language (DW_LANG_OBJC)
at_name ("/USERS/MYDOCMENT/MYCLASS.M")
AT_LOW_PC (0X0034D8FC)
At_stmt_list (0x00181846)
At_comp_dir ("/users/launch007/dev/golo")
At_apple_optimized (0x01)
At_apple_major_runtime_vers (0x02)
0x006e997f:tag_subprogram [60] *
At_name ("__66-[myClass Coustommethod]_block_invoke")
At_decl_file ("/USERS/MYDOCMENT/MYCLASS.M"
At_decl_line (454)
At_prototyped (0x01)
At_apple_isa (0x01)
At_accessibility (Dw_access_public)
AT_LOW_PC (0X00350BD8)
AT_HIGH_PC (0X0035110C)
At_frame_base (R7)
0x006e99c5:tag_lexical_block [43] *
AT_LOW_PC (0X00350C06)
AT_HIGH_PC (0X003510EC)
0x006e99ce:tag_lexical_block [] *
At_ranges (0X0001FC90
[0X00350C06-0X00350F6A]
[0X003510D8-0X003510EC]
END)
0x006e99d3:tag_lexical_block [42] *
At_ranges (0x0001fca8
[0X00350C0E-0X00350F6A]
[0X003510D8-0X003510EC]
END)
0x006e99e4:tag_lexical_block [42] *
At_ranges (0x0001fcc0
[0X00350C1A-0X00350F5C]
[0X003510D8-0X003510DE]
END)
0x006e99e9:tag_lexical_block [42] *
At_ranges (0X0001FCD8
[0X00350C62-0X00350F5C]
[0X003510D8-0X003510DE]
END)
Line table dir: '/users/mydocment '
Line table file: ' myclass.m ' line 486, column 0 with start address 0x0000000000350ef0
Looking up address:0x0000000000350f3b in. Debug_frame ... found!
0x00046620:fde
length:0x0000000c
cie_pointer:0x00000000
Start_addr:0x00350bd8 __66-[myClass Coustommethod]_block_invoke
range_size:0x00000534 (end_addr = 0x0035110c)
instructions:0x00350bd8:cfa=4294967295+4294967295
Here, we parse completely, has been positioned to be the MyClass class Coustommethod method in line 486 of the crash, go to code to modify code just fine ...
iOS crash log parsing (crash log)