Crash file analysis method for iOS system

Source: Internet
Author: User
Tags versions uikit

The location of the Xcode 4.3 Symbolicatecrash is inconsistent with the old version.

/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/library/privateframeworks/ dtdevicekit.framework/versions/a/resources/

Xcode 4.3 ago

/developer/platforms/iphoneos.platform/developer/library/privateframeworks/dtdevicekit.framework/versions/a/ Resources/symbolicatecrash

I. The question arises

A record of the program crash on the iphone (ipad) device is visible in Xcode's Window->orgnizer->device logs, but a crash record on the device can only be synchronized once.

Once the device Logs is viewed on a Mac, the crash file on the device will be placed on the Mac.

From the device logs inside look crash file, will find that sometimes the breakdown of the information inside the code function name, sometimes only function address (as follows), this is how to do?

Thread 0 Crashed:

0 LIBOBJC. A.dylib 0x300c87ec 0x300bb000 + 55276

1 mobilelines 0x00006434 0x1000 + 21556

2 mobilelines 0x000064c2 0x1000 + 21698

3 Uikit 0x30a740ac 0x30a54000 + 131244

4 Uikit 0x30a66110 0x30a54000 + 74000

5 Uikit 0x30a6565c 0x30a54000 + 71260

6 graphicsservices 0x3169b0b4 0x31696000 + 20660

7 graphicsservices 0x3169d818 0x31696000 + 30744

8 Iomobileframebuffer 0x31f3e8f8 0x31f3d000 + 6392

9 com.apple.framework.IOKit 0x30f342b8 0x30f30000 + 17080

Ten corefoundation 0x3025ced4 0x30229000 + 212692

One corefoundation 0x3025bed6 0x30229000 + 208598

Corefoundation 0x3025b584 0x30229000 + 206212

Graphicsservices 0x316998e4 0x31696000 + 14564

Uikit 0x30a5e308 0x30a54000 + 41736

Uikit 0X30A671DC 0x30a54000 + 78300

Mobilelines 0x00002090 0x1000 + 4240

Mobilelines 0x0000202c 0x1000 + 4140

Two. The cause of the problem

In fact, this is related to the compilation of two files: Myapp.app and MyApp.app.dSYM, if the crash program is exactly what the Mac compiled, and the corresponding

The compiled app and dsym files are still in the build directory (that is, no other newer versions have been compiled), Orgnizer will parse the crash file's function name, if not,

Bare address, this time even if the same code to compile again, can not parse out the code information, so the release version must be retained. App and. dsym files.

Three. Method of Solution

If there is only an address, the Symbolicatecrash tool can parse the corresponding function name as long as the app and the. dsym files are still there. Specific use of Symbolicatecrash tools

and. App and. dsym files, the method for parsing function names is as follows:

1. Create a new special directory for resolution processing, such as:/crash

2. Copy the Symbolicatecrash tool from the original position to the/crash. Because the Finder cannot go directly in the framework, the command line tool can be used to copy the commands as follows:

$ cp/developer/platforms/iphoneos.platform/developer/library/privateframeworks/dtdevicekit.framework/versions/a /resources/symbolicatecrash/crash

3. Copy the corresponding. App and. dsym files to/crash, and then copy the crash files that need to be resolved to/crash

4. Suppose the crash file is Myapp_2011-xxx-ipad.crash, the. dsym file is MyApp.app.dSYM, then the Myapp.app and MyApp.app.dSYM files are placed together, and then resolved using the following command:

$./symbolicatecrash Myapp_2011-xxx-ipad.crash MyApp.app.dSYM > Myapp_symbol.crash

If the parse succeeds, then there will be a function name (as follows), provided if the parse is unsuccessful. App and. dsym files are inconsistent with the Crashreport version.

Thread 0 Crashed:

0 LIBOBJC. A.dylib 0x300c87ec Objc_msgsend + 20

1 mobilelines 0x00006434-[boardview setselectedpiece:] (boardview.m:321)

2 mobilelines 0x000064c2-[boardview touchesbegan:withevent:] (boardview.m:349)

3 Uikit 0x30a740ac-[uiwindow sendevent:] + 264

4 Uikit 0x30a66110-[uiapplication sendevent:] + 248

5 Uikit 0x30a6565c _uiapplicationhandleevent + 4088

6 graphicsservices 0x3169b0b4 Purpleeventcallback + 428

7 graphicsservices 0x3169d818 Heartbeatvblcallback + 152

8 Iomobileframebuffer 0x31f3e8f8 Iomobileframebuffernotifyfunc + 124

9 Com.apple.framework.IOKit 0x30f342b8 Iodispatchcalloutfromcfmessage + 304

Ten corefoundation 0x3025ced4 __cfmachportperform + 72

One corefoundation 0x3025bed6 cfrunlooprunspecific + 2364

Corefoundation 0x3025b584 Cfrunloopruninmode + 44

Graphicsservices 0x316998e4 Gseventrunmodal + 268

Uikit 0x30a5e308-[uiapplication _run] + 404

Uikit 0X30A671DC Uiapplicationmain + 1064

Mobilelines 0x00002090 Main (main.m:16)

Mobilelines 0x0000202c start + 44

First look at the crash thread in the crash log, if so:

Thread 0 Crashed:

0 LIBOBJC. A.dylib 0x00003ec0 Objc_msgsend + 24

1 MyApp 0x000036d2 0x1000 + 9938

We got the memory address of the user crash: 0x000036d2

Then go back to our application's build directory, and be sure to include the Myapp.app and MyApp.app.dSYM two files in the directory.

In the console using the Dwarfdump command, resolve the memory address, such as:

Dwarfdump–lookup 0x000036d2–arch armv6 MyApp.app.dSYM

The output information is as follows:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.