Bug #105797 mysqltest crashes with async client and shutdown commands
Submitted: 4 Dec 2021 3:07 Modified: 4 May 2022 22:16
Reporter: Herman Lee Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S7 (Test Cases)
Version:8.0.23,8.0.27 OS:Any
Assigned to: CPU Architecture:Any

[4 Dec 2021 3:07] Herman Lee
Description:
mysqltest crashes on an assertion involving async_context->async_qp_data not being nullptr:

CURRENT_TEST: innodb_undo.undo_tablespace_encrypt_rotate
mysqltest: /home/herman/rocks-mysql/Oracle-mysql-server/sql-common/client.cc:7631: net_async_status mysql_send_query_nonblocking(MYSQL*, const char*, ulong): Assertion `async_context->async_qp_data == nullptr' failed.
mysqltest got signal 6
mysqltest: At line 15: show session status
In included file ./include/wait_until_disconnected.inc: 15
included from /data/users/herman/rocks-mysql/Oracle-mysql-server/mysql-test/suite/innodb_undo/t/undo_tablespace_encrypt_rotate.test: 37
conn->name: default
Attempting backtrace.
stack_bottom = 0 thread_stack 0x10000
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest(my_print_stacktrace(unsigned char const*, unsigned long)+0x43) [0x5d6cf0]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest() [0x4e1e3f]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest() [0x4e1e70]
/lib64/libpthread.so.0(+0x12c20) [0x7f236c15ac20]
/lib64/libc.so.6(gsignal+0x10f) [0x7f236a6eb37f]
/lib64/libc.so.6(abort+0x127) [0x7f236a6d5db5]
/lib64/libc.so.6(+0x21c89) [0x7f236a6d5c89]
/lib64/libc.so.6(+0x2fa76) [0x7f236a6e3a76]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest(mysql_send_query_nonblocking+0x104) [0x54244c]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest() [0x4cbe34]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest() [0x4cc5d8]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest() [0x4e0096]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest() [0x4e14dc]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest(main+0x12e0) [0x4e32c0]
/lib64/libc.so.6(__libc_start_main+0xf3) [0x7f236a6d7493]
/home/herman/rocks-mysql/Oracle-mysql-server/bld_debug_8.0.27/runtime_output_directory//mysqltest(_start+0x2e) [0x4cb4ae]
Writing a core file.
safe_process[1169536]: Child process: 1169537, killed by signal: 6

How to repeat:
./mysql-test/mysql-test-run.pl --mem --async-client innodb_undo.undo_tablespace_encrypt_rotate

Suggested fix:
It looks like async_qp_data is not freed or cleaned up correctly for the error cases in mysql_send_query_nonblocking(), when NET_ASYNC_ERROR is returned.
[7 Dec 2021 5:06] MySQL Verification Team
Hello Herman Lee,

Thank you for the report and feedback.
Verified as described with 8.0.27 src(debug) build.

regards,
Umesh
[4 May 2022 22:16] Christine Cole
Fixed as of the upcoming MySQL 8.0.30 release, and here's the proposed changelog entry from the documentation team:

Test cases executed with the --async-client option that had shutdown commands caused mysqltest to halt unexpectedly.

Thank you for the bug report.
[4 May 2022 22:18] Christine Cole
Fixed as of the upcoming MySQL 8.0.30 release, and here's the proposed changelog entry from the documentation team:

Test cases executed with the --async-client option that had shutdown commands caused mysqltest to halt unexpectedly.

Thank you for the bug report.