Bug #112883 mysql 8.1.0/8.2.0, mysqld got signal 11, when send sql, show parse_tree
Submitted: 30 Oct 2023 14:27 Modified: 17 Jun 2024 18:09
Reporter: Shawn Yan (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Parser Severity:S6 (Debug Builds)
Version:8.1.0 OS:Any
Assigned to: CPU Architecture:Any

[30 Oct 2023 14:27] Shawn Yan
Description:
when I send sql, db got crash.

sql:
mysql> show parse_tree create schema s1\G
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
ERROR: 
Can't connect to the server

log:
2023-10-30T10:10:10.461041Z 0 [System] [MY-010931] [Server] /usr/local/mysql/bin/mysqld: ready for connections. Version: '8.2.0-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution.
2023-10-30T10:10:25Z UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=e7491dd6283765f78d137a492a2d0e422de8be57
Thread pointer: 0x7f3694000be0
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 = 7f374410da30 thread_stack 0x100000
/usr/local/mysql/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x43) [0x4d2e14f]
/usr/local/mysql/bin/mysqld(print_fatal_signal(int)+0x39c) [0x389f426]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x75) [0x389f629]
/lib64/libc.so.6(+0x54df0) [0x7f3759e54df0]
/usr/local/mysql/bin/mysqld(PT_show_parse_tree::make_cmd(THD*)+0x28) [0x3d1e946]
/usr/local/mysql/bin/mysqld(LEX::make_sql_cmd(Parse_tree_root*)+0x51) [0x361404b]
/usr/local/mysql/bin/mysqld(THD::sql_parser()+0x81) [0x356af45]
/usr/local/mysql/bin/mysqld(parse_sql(THD*, Parser_state*, Object_creation_ctx*)+0x29b) [0x366629f]
/usr/local/mysql/bin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x1a2) [0x36615eb]
/usr/local/mysql/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x17a1) [0x365787c]
/usr/local/mysql/bin/mysqld(do_command(THD*)+0x604) [0x36556c1]
/usr/local/mysql/bin/mysqld() [0x388a244]
/usr/local/mysql/bin/mysqld() [0x592f1ed]
/lib64/libc.so.6(+0x9f802) [0x7f3759e9f802]
/lib64/libc.so.6(+0x3f450) [0x7f3759e3f450]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f369401eb90): show parse_tree create schema s1
Connection ID (thread ID): 9
Status: NOT_KILLED

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.
[mysql@rocky9 mysql]$ 

How to repeat:
sql:
show parse_tree create schema s1\G

Suggested fix:
DB should not crash at laest.
[30 Oct 2023 14:51] MySQL Verification Team
Hi,

One question only .....

Can you repeat the problem in 8.1 ????
[30 Oct 2023 15:21] Shawn Yan
hi, team,
as 8.1 alread removed from download list,
could you help try that within your team?
[30 Oct 2023 16:50] Shawn Yan
hi team,
after try in MySQL 8.1.0, I got same issue.
Please help check.

sql:
mysql> show parse_tree create schema s1;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
ERROR: 
Can't connect to the server

mysql> 

2023-10-30T16:47:47Z UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=83bd55b575d1bacd15a7bafa9d7a8121f6caae47
Thread pointer: 0x7f275c001040
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 = 7f27fc268a30 thread_stack 0x100000
/usr/local/mysql/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x43) [0x4cd35f0]
/usr/local/mysql/bin/mysqld(print_fatal_signal(int)+0x39c) [0x38565de]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x75) [0x38567e1]
/lib64/libc.so.6(+0x54df0) [0x7f2822454df0]
/usr/local/mysql/bin/mysqld(PT_show_parse_tree::make_cmd(THD*)+0x28) [0x3cd29a4]
/usr/local/mysql/bin/mysqld(LEX::make_sql_cmd(Parse_tree_root*)+0x51) [0x35d0037]
/usr/local/mysql/bin/mysqld(THD::sql_parser()+0x81) [0x35272bf]
/usr/local/mysql/bin/mysqld(parse_sql(THD*, Parser_state*, Object_creation_ctx*)+0x29b) [0x3621dcb]
/usr/local/mysql/bin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x1a2) [0x361d117]
/usr/local/mysql/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x1687) [0x3613408]
/usr/local/mysql/bin/mysqld(do_command(THD*)+0x604) [0x361138a]
/usr/local/mysql/bin/mysqld() [0x3841468]
/usr/local/mysql/bin/mysqld() [0x5894bd1]
/lib64/libc.so.6(+0x9f802) [0x7f282249f802]
/lib64/libc.so.6(+0x3f450) [0x7f282243f450]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f275c01db20): show parse_tree create schema s1
Connection ID (thread ID): 8
Status: NOT_KILLED

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.
[31 Oct 2023 12:37] MySQL Verification Team
HI Mr. Yan,

Thank you for your bug report.

You are quite correct.

With a production build of both 8.1.0 and 8.2.0 we just get a syntax error, which is expected behaviour.

However, with debug builds, we get a crash !!!!!

Since this bug is not affecting production binary, this is not Security Vulnerability bug.

Verified as reported.

Thank you very much !!!!
[31 Oct 2023 12:41] Shawn Yan
thanks for your reply, and expect fix that before mysql 8.4 release.
[17 Jun 2024 18:09] Jon Stephens
Documented fix as follows in the MySQL 9.0.0 changelog:

    SHOW PARSE_TREE CREATE SCHEMA caused a server exit in debug
    builds.

    NOTE: SHOW PARSE_TREE is available in debug builds only.

Closed.