Bug #107045 mysqld coredump when start with wrong argument $
Submitted: 18 Apr 3:04 Modified: 27 Apr 13:05
Reporter: beon feng Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.27 for Linux on x86_64 (MySQL Commun OS:Red Hat (CentOS Linux release 7.6.1810 (Core) )
Assigned to: CPU Architecture:Any
Tags: coredump

[18 Apr 3:04] beon feng
Description:
when starting mysql server with the following cmd:
./mysql/bin/mysqld_safe --defaults-file=/greatdb/conf/mysql4406.cnf $

mysql server will coredump during starting:
./mysql/bin/mysqld_safe: line 199:  5517 Segmentation fault      (core dumped) env MYSQLD_PARENT_PID=3905 nohup /greatdb/svr/mysql/bin/mysqld --defaults-file=/greatdb/conf/mysql4406.cnf --basedir=/greatdb/svr/mysql --datadir=/greatdb/dbdata/mysql4406/data --plugin-dir=/greatdb/svr/mysql/lib/plugin --user=greatdb \$ --log-error=/greatdb/logs/error4406.log --open-files-limit=65535 --pid-file=/greatdb/dbdata/mysql4406/data/greatdb.pid --socket=/greatdb/dbdata/mysql4406/data/greatdb.sock --port=4406 < /dev/null > /dev/null 2>&1
2022-04-18T02:49:35.977475Z mysqld_safe mysqld from pid file /greatdb/dbdata/mysql4406/data/greatdb.pid ended

error log:
2022-04-18T10:49:33.862361+08:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose-group_replication_transaction_size_limit=268435456'.
2022-04-18T10:49:33.862375+08:00 0 [ERROR] [MY-010147] [Server] Too many arguments (first extra is '$').
2022-04-18T10:49:33.862389+08:00 0 [Note] [MY-010148] [Server] Use --verbose --help to get a list of available options!
2022-04-18T10:49:33.863001+08:00 0 [ERROR] [MY-010119] [Server] Aborting
2022-04-18T10:49:33.864306+08:00 0 [Note] [MY-012330] [InnoDB] FTS optimize thread exiting.
2022-04-18T10:49:34.800308+08:00 0 [Note] [MY-010120] [Server] Binlog end
。。。。。。
2022-04-18T10:49:35.377196+08:00 0 [System] [MY-010910] [Server] /greatdb/svr/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.27)  MySQL Community Server - GPL.
02:49:35 UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
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 0x40000
/greatdb/svr/mysql/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x1fc306d]
/greatdb/svr/mysql/bin/mysqld(handle_fatal_signal+0x30b) [0xee8cfb]
/lib64/libpthread.so.0(+0xf5d0) [0x7f5cc46165d0]
/lib64/libpthread.so.0(pthread_kill+0) [0x7f5cc46139a0]
/greatdb/svr/mysql/bin/mysqld(Mysqld_socket_listener::close_listener()+0x201) [0xee02d1]
/greatdb/svr/mysql/bin/mysqld(Mysqld_socket_listener::~Mysqld_socket_listener()+0x2a) [0xc8ed0a]
/greatdb/svr/mysql/bin/mysqld() [0xc8f27e]
/greatdb/svr/mysql/bin/mysqld() [0xc9336e]
/greatdb/svr/mysql/bin/mysqld(mysqld_main(int, char**)+0x30be) [0xc9fe6e]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f5cc2ac23d5]
/greatdb/svr/mysql/bin/mysqld() [0xc82e27]
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

core stack:
[root@localhost svr]# gdb mysql/bin/mysqld /greatdb/dbdata/mysql4406/data/core.5517 
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /greatdb/svr/mysql-8.0.27-el7-x86_64/bin/mysqld...Dwarf Error: wrong version in compilation unit header (is 0, should be 2, 3, or 4) [in module /greatdb/svr/mysql-8.0.27-el7-x86_64/bin/mysqld]
(no debugging symbols found)...done.
[New LWP 5517]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Dwarf Error: wrong version in compilation unit header (is 0, should be 2, 3, or 4) [in module /greatdb/svr/mysql/lib/plugin/component_reference_cache.so]
Core was generated by `/greatdb/svr/mysql/bin/mysqld --defaults-file=/greatdb/conf/mysql4406.cnf --bas'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f5cc46139d1 in pthread_kill () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libgcc-4.8.5-36.el7.x86_64 libstdc++-4.8.5-36.el7.x86_64 numactl-libs-2.0.12-5.el7.x86_64
(gdb) bt
#0  0x00007f5cc46139d1 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000ee8d2d in handle_fatal_signal ()
#2  <signal handler called>
#3  0x00007f5cc46139a0 in pthread_kill () from /lib64/libpthread.so.0
#4  0x0000000000ee02d1 in Mysqld_socket_listener::close_listener() ()
#5  0x0000000000c8ed0a in Mysqld_socket_listener::~Mysqld_socket_listener() ()
#6  0x0000000000c8f27e in clean_up(bool) ()
#7  0x0000000000c9336e in unireg_abort(int) ()
#8  0x0000000000c9fe6e in mysqld_main(int, char**) ()
#9  0x00007f5cc2ac23d5 in __libc_start_main () from /lib64/libc.so.6
#10 0x0000000000c82e27 in _start ()
(gdb) 

How to repeat:
start mysql server with the following cmd:

[root@localhost svr]# ./mysql/bin/mysqld_safe --defaults-file=/greatdb/conf/mysql4406.cnf $
2022-04-18T02:49:32.508042Z mysqld_safe Logging to '/greatdb/logs/error4406.log'.
2022-04-18T02:49:32.547762Z mysqld_safe Starting mysqld daemon with databases from /greatdb/dbdata/mysql4406/data

./mysql/bin/mysqld_safe: line 199:  5517 Segmentation fault      (core dumped) env MYSQLD_PARENT_PID=3905 nohup /greatdb/svr/mysql/bin/mysqld --defaults-file=/greatdb/conf/mysql4406.cnf --basedir=/greatdb/svr/mysql --datadir=/greatdb/dbdata/mysql4406/data --plugin-dir=/greatdb/svr/mysql/lib/plugin --user=greatdb \$ --log-error=/greatdb/logs/error4406.log --open-files-limit=65535 --pid-file=/greatdb/dbdata/mysql4406/data/greatdb.pid --socket=/greatdb/dbdata/mysql4406/data/greatdb.sock --port=4406 < /dev/null > /dev/null 2>&1
2022-04-18T02:49:35.977475Z mysqld_safe mysqld from pid file /greatdb/dbdata/mysql4406/data/greatdb.pid ended
[root@localhost svr]#
[27 Apr 13:05] MySQL Verification Team
Hi Mr. feng,

Thank you very much for your bug report.

However, it is not a bug.

Dollar sign has a very special meaning in Unix shell scripting, so using it wrongly will always result in crashes.

Not a bug.