How to build a MariaDB server that contains debug information
Instructions on how to build a mysqld that contains all the information we need to fix the problem: (A more detailed explanation can be found here.)
Note: this text has been extracted into a separate article from Reporting bugs, see its full history there.
- Add the
--core-file
option to your /.my.cnf or /etc/my.cnf file under the [mysqld] tag. - Get the latest MariaDB code from GitHub.
- Compile MariaDB with the -g compiler flag (Unix). The scripts in the BUILD directory will do this automatically for you.
- Shut down your old mysqld server
- Install the new compiled mysqld
- restart mysqld
Compiling with -g should not cause any notable slowdown of the server.
Example of doing a debug build
Here is an example of how to do the compilation (assuming you are using AMD or Intel hardware)
cd mariadb-source-dir ./BUILD/compile-pentium-max make ./client/mysqladmin shutdown mv mariadb-install-dir/mysqld mariadb-install-dir/mysqld-old cp sql/mysqld mariadb-install-dir/mysqld 'restart mysqld'
You can of course also do make install, but the above way allows you to go back to your old binary if needed.
If you get any errors about wrong number of error messages, you can fix that by copying the corresponding language file from sql/share over your old ones (this should be reasonably safe to do).
cp sql/share/english/* mariadb-install-dir/share/mysql/english
What to do when you get a crash after installing a debug binary
Now when you get a crash do the following:
- Create a README file that described the problem. (You can use the mysqlbug script to generate a template for this).
- Create a tar file containing the core, the mysqld binary and README. If possible, also add any database files that could help us repeat the problem!
sh> tar cvfz /tmp/mariadb-bug-'short-description'.tgz mariadb-data-dir/core* mariadb-install-dir/libexec/mysqld README
- Send it to our secure ftp server:
sh> ftp -a ftp.askmonty.org ftp> cd private ftp> binary ftp> put /tmp/mariadb-bug-'short-description'.tgz ftp> quit
- To be able to follow the progress, create a bug report in JIRA about this. This should be easy to do based on the information you have in your README file.