View error log:
We got the crash location 0xee36f1. How to find the corresponding code location?
Find a test machine and obtain the installation package of the corresponding version:
Unzip:
Then use GDB to open mysqld:
At 0xee36f1 Make a breakpoint at the location:
We can see that gdb prints out the file name and line number of the crash location.
The rest can be left to the development engineer. Follow this crash stack to troubleshoot.
Gift chapter
What is this string of information in the red box? Let's unpack it and take a look.
This information is divided into two parts. "+0x71" is an offset, preceded by a string of text. We parse the text:
You can see that the previous string of text is the encoding of a function signature. After using c++filt to restore the encoding, you can see the complete function signature.
The string of information in the red box means that the crash position is the starting position of a function + offset.
We can probably guess that this MySQL flaw occurs when a new file name is generated for binlog.
Tips:
The function starting position + offset is a representation of the memory location, but the location is not necessarily the code within this function.
In this example, at the position 0xee36f1, the program finds the starting position of the nearby function generate_new_name, and calculates that there are as many offsets as 0x71, which is expressed in the form generate_new_name+0x71.
But the code at 0xee36f1 is most likely, but not necessarily, a piece of code inside the generate_new_name function.