Bug #107490 Segmentation Fault on key.h:239: rec_per_key_float[key_part_no]
Submitted: 6 Jun 2022 2:40 Modified: 6 Jun 2022 12:08
Reporter: zhijun long Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.21 OS:Any
Assigned to: CPU Architecture:Any

[6 Jun 2022 2:40] zhijun long
Description:
Segmentation Fault on sql/key.h:239.

Crash BT:
stack_bottom = 7fdbc74714a8 thread_stack 0x46000
/usr/local/engine/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x16725dd]
/usr/local/engine/bin/mysqld(handle_fatal_signal+0x171) [0xe1ddb6]
/lib64/libpthread.so.0(+0xf700) [0x7fe1c2ad8700]
/usr/local/engine/bin/mysqld() [0xdb0827]
/usr/local/engine/bin/mysqld() [0xd7ad63]
/usr/local/engine/bin/mysqld(SELECT_LEX::optimize(THD*)+0xd6) [0x1cfd8b6]
/usr/local/engine/bin/mysqld(SELECT_LEX_UNIT::optimize(THD*, TABLE*)+0x80) [0x1d201f0]
/usr/local/engine/bin/mysqld(Sql_cmd_dml::execute_inner(THD*)+0x38) [0x1cffe38]
/usr/local/engine/bin/mysqld(Sql_cmd_dml::execute(THD*)+0x59e) [0x1bac06e]
/usr/local/engine/bin/mysqld(mysql_execute_command(THD*, bool)+0xbf1) [0x1ba3081]
/usr/local/engine/bin/mysqld(mysql_parse(THD*, Parser_state*)+0x3da) [0x1ba710a]
/usr/local/engine/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0xe7a) [0x1ba85fa]
/usr/local/engine/bin/mysqld(do_command(THD*)+0x114) [0x1ba7574]

Code:
# addr2line -e ./mysqld 0xdb0827 ./obj/sql/../../sql/key.h:239
239     if (rec_per_key_float[key_part_no] != REC_PER_KEY_UNKNOWN)
240       return rec_per_key_float[key_part_no];

# addr2line -e ./mysqld 0xd7ad63 sql_optimizer.cc:?

How to repeat:
Unfortunately, there is no way to stably reproduce.
[6 Jun 2022 12:08] MySQL Verification Team
Hi Mr. long,

Thank you for your bug report.

However, you are using an ancient release of 8.0. Current release is 8.0.29. Hence, please download a binary from our site and upgrade your installation.

If you have the same problem with 8.0.29, then please report a new bug.