Bug #88830 With plugin-load and typo debugger aborts with missing DBUG_RETURN in '?func'
Submitted: 8 Dec 2017 9:55 Modified: 11 Apr 2018 12:48
Reporter: Narendra Singh Chauhan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:9.0.0 OS:Any
Assigned to: CPU Architecture:Any

[8 Dec 2017 9:55] Narendra Singh Chauhan
Description:
Scenario: By chance if we start server with incorrect server option(or TYPO), server is expected to Abort. But, with plugin-load and required GR variables properly set, we are getting Signal 6 and incorrect message, even after server is Aborted.

====
2017-12-08T09:30:37.803635Z 2 [ERROR] [000000] Plugin group_replication reported: 'Unable to start Group Replication. Replication applier infrastructure is not initialized since the server was started with --initialize or --initialize-insecure.'
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "?func"
====
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld(_db_return_+0xb9) [0x43e66b9]
/Narendra/mysql_work/git_repo/mysql-trunk/install/lib/plugin/group_replication.so(Delayed_initialization_thread::initialization_thread_handler()+0x278) [0x7f8fab207d96]
/Narendra/mysql_work/git_repo/mysql-trunk/install/lib/plugin/group_replication.so(+0x13e469) [0x7f8fab207469]
====

mysqld.1.err:-
==============
2017-12-08T09:30:37.696464Z 0 [ERROR] [004744] unknown variable 'group_replication_start_o_boot=OFF'
2017-12-08T09:30:37.696537Z 0 [Warning] [004625] The privilege system failed to initialize correctly. If you have upgraded your server, make sure you're executing mysql_upgrade to correct the issue.
2017-12-08T09:30:37.696734Z 0 [ERROR] [003742] Aborting
2017-12-08T09:30:37.803635Z 2 [ERROR] [000000] Plugin group_replication reported: 'Unable to start Group Replication. Replication applier infrastructure is not initialized since the server was started with --initialize or --initialize-insecure.'
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "?func"

09:30:37 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 67847 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x46000
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x55) [0x3c78aaa]
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld(handle_fatal_signal+0x424) [0x2c13625]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f901efef390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f901df9c428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f901df9e02a]
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld() [0x43e7df9]
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld(_db_return_+0xb9) [0x43e66b9]
/Narendra/mysql_work/git_repo/mysql-trunk/install/lib/plugin/group_replication.so(Delayed_initialization_thread::initialization_thread_handler()+0x278) [0x7f8fab207d96]
/Narendra/mysql_work/git_repo/mysql-trunk/install/lib/plugin/group_replication.so(+0x13e469) [0x7f8fab207469]
/Narendra/mysql_work/git_repo/mysql-trunk/install/bin/mysqld() [0x42b3136]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f901efe56ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f901e06e3dd]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

How to repeat:
Details:-
=========
Version checked: mysql-trunk

Steps to repro:
================
From basedir,
## Create required directories
1. mkdir -p mysql-test/var/mysqld.1/data mysql-test/var/log mysql-test/var/tmp/mysqld.1

## Initialize server
2. ./bin/mysqld --no-defaults --datadir=$PWD/mysql-test/var/mysqld.1/data --basedir=$PWD --log-error=$PWD/mysql-test/var/log/mysqld.1.err --initialize-insecure --core-file 2>&1 &

## Start and check that server & GR member come ONLINE properly.
3. ./bin/mysqld --defaults-file=tmysqld.cnf --socket=/tmp/mysqld.1.sock --datadir=$PWD/mysql-test/var/mysqld.1/data --basedir=$PWD --log-error=$PWD/mysql-test/var/log/mysqld.1.err --core-file 2>&1 &

 3.a: Check that GR member has come ONLINE.
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 41e2bf92-dbf8-11e7-92e6-0050b685f43c | 127.0.0.1   |       13000 | ONLINE       | PRIMARY     | 9.0.0          |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
1 row in set (0.04 sec)

## Kill the server and start it again with incorrect server option this time.
4. kill -9 %1

## Start server with any incorrect server option. Here, I'm taking a case where option is having TYPO (group_replication_start_o_boot).
5. ./bin/mysqld --defaults-file=tmysqld.cnf --socket=/tmp/mysqld.1.sock --datadir=$PWD/mysql-test/var/mysqld.1/data --basedir=$PWD --log-error=$PWD/mysql-test/var/log/mysqld.1.err --group_replication_start_o_boot=OFF --core-file 2>&1 &

6. Check mysqld.1.err file. You will see crash here.

where,
$ cat tmysqld.cnf 
[mysqld]
log-bin=                    server1
relay-log=                  server1-relay-log

binlog-format=              row
binlog-checksum=            NONE
enforce-gtid-consistency
gtid-mode=                  on
transaction-write-set-extraction=XXHASH64

plugin-dir='/Narendra/mysql_work/git_repo/mysql-trunk/install/lib/plugin/'
plugin-load='group_replication.so'

report-host=                127.0.0.1
report-user=                root
master-retry-count=         10
skip-slave-start
server-id=                  1
port=                       13000

loose-group_replication_single_primary_mode= FALSE
loose-group_replication_enforce_update_everywhere_checks= TRUE

loose-group_replication_group_name= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
loose-group_replication_local_address='127.0.0.1:21300'
loose-group_replication_group_seeds ="127.0.0.1:21300, 127.0.0.1:21301, 127.0.0.1:21302"
loose-group_replication_bootstrap_group= ON
loose-group_replication_start_on_boot=ON
[23 Apr 2018 13:43] Nuno Carvalho
Fixed on 8.0.11
[31 May 2018 14:51] David Moss
Reclosing.