How to locate the issue of execution file crashes released in linux

Source: Internet
Author: User

When the C ++ Release version is released to the customer for execution, if the program crashes, is there any way to quickly confirm the program's problems?

  • If you can debug gdb, it is relatively simple. You can use the gdb command, similar to the following:

Gdb ##
Set args ****
B main
R
# Eip
X/10i 0xb7362040

 

  • If the development is not on site, you can use the method of recording the crash log for analysis.

In this case, the project must use a tool library similar to google breakpad to record the crash.

By default, the dmp file is generated by breakpad. You can use the breakpad tool to convert it into text for viewing, as shown below:

./Minidump-2-core-m 7ee5c76f-afe2-f9bd-564dedb7-57d73e0c.dmp> core

./Minidump_stackwalk 7ee5c76f-afe2-f9bd-564dedb7-57d73e0c.dmp> dbg.txt

Based on the above information, you can determine which module's address has an error.

 

In general, the source code of the released library is extracted from the corresponding version, which is difficult to compile. You can analyze the source code of the released library or execution file directly and generate an assembly file using objdump, through the corresponding address, you can find out which function has a problem. As for the guessed code, you need to build a unit test based on the analysis situation or re-launch the code for testing.

Specific process examples are as follows:
Objectdump-d ##. so >##. o
Vim ##. o
6 libTaps2.so + 0xa452d

./Minidump_stackwalk 7ee5c76f-afe2-f9bd-564dedb7-57d73e0c.dmp

Thread 7 (crashed)
0 linux-gate.so + 0x430
Eip = 0xb78b4430 esp = 0xb2952e18 ebp = 0xb2952e30 ebx = 0x00000fff
Esi = 0xb5b98864 edi = 0xb5b97ff4 eax = 0x00000000 ecx = 0x00001008
Edx = 0x00000006 efl = 0x00000206
Found by: given as instruction pointer in context
1 libc-2.11.1.so + 0x2da81
Eip = 0xb5a6fa82 esp = 0xb2952e38 ebp = 0xb2952f58
Found by: previous frame's frame pointer
2 libstdc ++. so.6.0.13 + 0xbf52e
Eip = 0xb5cba52f esp = 0xb2952f60 ebp = 0xb2952fa8
Found by: previous frame's frame pointer
3 libstdc ++. so.6.0.13 + 0xbd464
Eip = 0xb5cb8465 esp = 0xb2952fb0 ebp = 0xb2952fc8
Found by: previous frame's frame pointer
4 libstdc ++. so.6.0.13 + 0xbd4a1
Eip = 0xb5cb84a2 esp = 0xb2952fd0 ebp = 0xb2952fe8
Found by: previous frame's frame pointer
5 libstdc ++. so.6.0.13 + 0xbd5e0
Eip = 0xb5cb85e1 esp = 0xb2952ff0 ebp = 0xb2953008
Found by: previous frame's frame pointer
6 libTaps2.so + 0xa452d
Eip = 0xb738c52e esp = 0xb2953010 ebp = 0xb2953048
Found by: previous frame's frame pointer
7 libTaps2.so + 0x7a03f
Eip = 0xb7362040 esp = 0xb2953050 ebp = 0xb2953068
Found by: previous frame's frame pointer
8 libTaps2.so + 0x6aa9d
Eip = 0xb7352a9e esp = 0xb2953070 ebp = 0xb29530b8
Found by: previous frame's frame pointer
9 libTaps2.so + 0x68e69
Eip = 0xb7350e6a esp = 0xb29530c0 ebp = 0xb2953108
Found by: previous frame's frame pointer
10 libTaps2.so + 0x691a2
Eip = 0xb73511a3 esp = 0xb2953110 ebp = 0xb2953158
Found by: previous frame's frame pointer
11 libTaps2.so + 0x71b9c
Eip = 0xb7359b9d esp = 0xb2953160 ebp = 0xb29531a8
Found by: previous frame's frame pointer
12 libTaps2.so + 0x71db1
Eip = 0xb7359db2 esp = 0xb29531b0 ebp = 0xb29531b8
Found by: previous frame's frame pointer
13 libTaps2.so + 0xa8ac9
Eip = 0xb7390aca esp = 0xb29531c0 ebp = 0xb2953208
Found by: previous frame's frame pointer
14 libTaps2.so + 0xa98d8
Eip = 0xb73918d9 esp = 0xb2953210 ebp = 0xb2953288
Found by: previous frame's frame pointer
15 libTaps2.so + 0xa78b0
Eip = 0xb738f8b1 esp = 0xb2953290 ebp = 0xb29532b8
Found by: previous frame's frame pointer
16 libTaps2.so + 0xa7960
Eip = 0xb738f961 esp = 0xb29532c0 ebp = 0xb29532e8
Found by: previous frame's frame pointer
17 libTaps2.so + 0xa88a5
Eip = 0xb73908a6 esp = 0xb29532f0 ebp = 0xb2953338
Found by: previous frame's frame pointer
18 libTaps2.so + 0x7207a
Eip = 0xb735a07b esp = 0xb2953340 ebp = 0xb2953358
Found by: previous frame's frame pointer
19 tapsdaemon + 0x2e168
Eip = 0x08076169 esp = 0xb2953360 ebp = 0xb2953388
Found by: previous frame's frame pointer
20 libpthread-2.11.1.so + 0x596d
Eip = 0xb5ba196e esp = 0xb2953390 ebp = 0xb2953488
Found by: previous frame's frame pointer
21 libc-2.11.1.so + 0xcda4d
Eip = 0xb5b0fa4e esp = 0xb2953490 ebp = 0x00000000
Found by: previous frame's frame pointer

 

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.