Recently know the exact line that uses DMESG and addr2line to locate a segment error. So he did a small experiment, in the experiment found that this method is sometimes not brilliant, depending on the type of paragraph errors.
I wrote the applet:
After compiling a segment error, the DMESG command is used to locate the wrong address, and then use Addr2line to locate the row number, and find that the location failed. It seems that this kind of error is not feasible in this way.
Here's what you find on the Web:
The Addr2line tool (which is part of the standard GNU Binutils) is a tool that converts the address and executable image of a directive into a file name, function name, and number of source code lines.
D MESG command:
syntax:dMESG [-cn][-s < buffer size;]
Additional Note:the kernel will store the boot information in ring buffer. If you are too late to view the information, you can use DMESG to view it. The boot information is also stored in the/var/log directory, in the file named DMESG.
Parameters
-C Clears the contents of the ring buffer after displaying the information.
-s< buffer size > pre-set to 8196, just equal to the size of the ring buffer.
-N Sets the level of logging information.
DMESG Command main purpose
Main applications:
DMESG is used to display the kernel ring buffer (kernel-ring buffer) content, and the kernel stores various messages here. At system boot time, the kernel fills in this buffer with information related to hardware and module initialization. Messages in the kernel ring buffer are often useful for diagnosing system problems. When you run DMESG, it displays a lot of information. It is common to use the pipe to view the output of DMESG through less or grep , which makes it easier to find unknown origin information. For example, if you find that your hard disk is performing poorly, you can use DMESG to check that they are running in DMA mode:
$DMESG | grep DMA
A small exploration of the address of analytic function with Addr2line