Compiling MariaDB for debugging in Ubuntu 16.04

Hi MariaDB-Team,

due to the fact, that in my mariadb-galera-cluster nodes randomly stop working and only few information is offered in the error-log file, I wanted to compile a mysqld binary with debugging options.

Currently I'am using the following software-verions

UbuntuUbuntu 16.04.1 LTS
mysqldVer 10.1.21-MariaDB-1xenial for debian-linux-gnu on x86_64 (mariadb.org binary distribution)
wsrep_provider_version25.3.19(r3667)
wsrep_protocol_version7

To do so, I started downloading the mariadb source via

apt-get source mariadb-server-10.1

The I configured/compiled the binary using your advice (https://mariadb.com/kb/en/mariadb/compiling-mariadb-for-debugging/)

cd mariadb-10.1-10.1.21+maria/
./BUILD/compile-pentium64-debug-max

The process finished without an error. Under the path /mariadb-10.1-10.1.21+maria/sql a mysqld binary was created.

So shutdown my running mysqld process and modified the file /etc/mysql/my.cnf and added the following lines, to provide a full stack trace as described here (https://mariadb.com/kb/en/mariadb/how-to-produce-a-full-stack-trace-for-mysqld/)

[mysqld_safe]
core-file-size          = unlimited

[mysqld]
stack-trace
core-file

Then I replaced the binary in /usr/sbin/ like it's told in instruction (https://mariadb.com/kb/en/mariadb/how-to-produce-a-full-stack-trace-for-mysqld/)

cd /usr/sbin/
mv mysqld mysqld_org
cp ~/mariadb-10.1-10.1.21+maria/sql/mysqld .

Now, starting the service via service call service mysql start first starts the service.

The following lines are written to mysql-error.log

2017-01-23 15:26:47 140710085396288 [Note] InnoDB: 128 rollback segment(s) are active.
2017-01-23 15:26:47 140710085396288 [Note] InnoDB: Waiting for purge to start
2017-01-23 15:26:47 140710085396288 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 9268642492589
2017-01-23 15:26:47 140690481362688 [Note] InnoDB: Dumping buffer pool(s) not yet started
2017-01-23 15:26:47 140710085396288 [Note] Plugin 'FEEDBACK' is disabled.
2017-01-23 15:26:47 140710085396288 [Note] Server socket created on IP: 'aaa.bbb.ccc.ddd'.
2017-01-23 15:26:48 140710085396288 [Note] WSREP: Signalling provider to continue.
2017-01-23 15:26:48 140710085396288 [Note] WSREP: SST received: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1594447177
2017-01-23 15:26:48 140709437741824 [Note] WSREP: Receiving IST: 5507 writesets, seqnos 1594447177-1594452684
2017-01-23 15:26:48 140710085396288 [Note] Reading of all Master_info entries succeded
2017-01-23 15:26:48 140710085396288 [Note] Added new Master_info '' to hash table
2017-01-23 15:26:48 140710085396288 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.21-MariaDB-debug'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Source distribution
2017-01-23 15:27:11 140709437741824 [Note] WSREP: IST received: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1594452684
2017-01-23 15:27:11 140700733503232 [Note] WSREP: 5.0 (nodename05): State transfer from 4.0 (nodename03) complete.
2017-01-23 15:27:11 140700733503232 [Note] WSREP: Shifting JOINER -> JOINED (TO: 1594455586)

But then, after a few seconds, where the service seems to be part of the cluster, it shuts down on its own. This is the output from mysql-error.log

2017-01-23 15:28:02 140700316179200 [Note] Got signal 15 to shutdown mysqld
2017-01-23 15:28:02 140700314966784 [Note] /usr/sbin/mysqld: Normal shutdown
2017-01-23 15:28:02 140700314966784 [Note] WSREP: Stop replication
2017-01-23 15:28:02 140700314966784 [Note] WSREP: Closing send monitor...
2017-01-23 15:28:02 140700314966784 [Note] WSREP: Closed send monitor.
2017-01-23 15:28:02 140700314966784 [Note] WSREP: gcomm: terminating thread
2017-01-23 15:28:02 140700314966784 [Note] WSREP: gcomm: joining thread
2017-01-23 15:28:02 140700314966784 [Note] WSREP: gcomm: closing backend
2017-01-23 15:28:02 140700314966784 [Note] WSREP: view(view_id(NON_PRIM,3e21b476,241) memb {
	f0640361,0
} joined {
} left {
} partitioned {
	3e21b476,0
	6c3ebf6b,0
	85878261,0
	99f886d0,0
	b71683e8,0
})
2017-01-23 15:28:02 140700314966784 [Note] WSREP: view((empty))
2017-01-23 15:28:02 140700314966784 [Note] WSREP: gcomm: closed//

During this startup and shutdown process the command service mysql start does not finish in that way, that I get my promt back. Only after the service shut down on its own, I get my prompt back.

Changing back the binary to the original one lets mysqld start properly via the command service mysql start.

So how do I build a running mariadb debug version on ubuntu 16.04? Did I do something wrong?

Best regards

Mrk

Answer Answered by Anel Husakovic in this comment.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.