[MDEV-26425] MariaDB server crash in Predicant_to_list_comparator::Predicant_to_value_comparator::cleanup Created: 2021-08-19  Updated: 2021-08-26  Resolved: 2021-08-26

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.5, 10.6, 10.7
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: yaoguang Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: crash
Environment:

Linux version 5.13.0-1-MANJARO (builduser@LEGION) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Mon Jun 7 06:16:10 UTC 2021 x86_64


Issue Links:
Duplicate
duplicates MDEV-26407 Server crashes in Item_func_in::clean... Closed

 Description   

PoC:

CREATE TEMPORARY TABLE v0 ( v1 INT DEFAULT ( from_unixtime ( LAST_DAY ( CASE 0 WHEN 'x' THEN 'x' ELSE 'x' END ) ) ) ) ;
 UPDATE v0 SET v1 = '' WHERE v1 IS NULL ;
 INSERT INTO v0 ( ) VALUES ( NVL ( FALSE , EXP ( ( 'x' | 'x' ) ) ) , POINT ( ( NOT time_to_sec ( NULL ) ) , 90700366.000000 ) ) ;

crash log:

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 10.7.0-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467956 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x62b0000bd218
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 = 0x7f2bda03a850 thread_stack 0x5fc00
sanitizer_common/sanitizer_common_interceptors.inc:4203(__interceptor_backtrace.part.0)[0x7f2bf98e6c3e]
mysys/stacktrace.c:213(my_print_stacktrace)[0x559994ace747]
sql/signal_handler.cc:222(handle_fatal_signal)[0x559993a96120]
sigaction.c:0(__restore_rt)[0x7f2bf92d0870]
sql/item_cmpfunc.h:2105(Predicant_to_list_comparator::Predicant_to_value_comparator::cleanup())[0x559993bad53f]
sql/item.cc:574(Item::cleanup_processor(void*))[0x559993ae3dbc]
sql/item.h:5439(Item_func_or_sum::walk(bool (Item::)(void), bool, void*))[0x559993094774]
sql/item.h:2742(Item_args::walk_args(bool (Item::)(void), bool, void*))[0x5599930946c4]
sql/item.h:2742(Item_args::walk_args(bool (Item::)(void), bool, void*))[0x5599930946c4]
sql/table.cc:3616(fix_session_vcol_expr(THD*, Virtual_column_info*))[0x559993648d3a]
sql/sql_base.cc:5433(TABLE::fix_vcol_exprs(THD*))[0x5599931ba24f]
sql/sql_base.cc:5467(lock_tables(THD*, TABLE_LIST*, unsigned int, unsigned int))[0x5599931baf93]
sql/sql_base.cc:5261(open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*))[0x5599931bf800]
sql/sql_base.h:397(open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int))[0x559993275ef4]
sql/sql_parse.cc:4565(mysql_execute_command(THD*, bool))[0x55999332ebb8]
sql/sql_parse.cc:8047(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55999333b5a1]
sql/sql_parse.cc:1898(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55999334160c]
sql/sql_parse.cc:1406(do_command(THD*, bool))[0x55999334673d]
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x559993701e57]
sql/sql_connect.cc:1312(handle_one_connection)[0x55999370233d]
perfschema/pfs.cc:2204(pfs_spawn_thread)[0x559994192c2c]
pthread_create.c:0(start_thread)[0x7f2bf92c6259]
:0(_GI__clone)[0x7f2bf8e715e3]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x629000087238): INSERT INTO v0 ( ) VALUES ( NVL ( FALSE , EXP ( ( 'x' | 'x' ) ) ) , POINT ( ( NOT time_to_sec ( NULL ) ) , 90700366.000000 ) )

Connection ID (thread ID): 4
Status: NOT_KILLED



 Comments   
Comment by Alice Sherepa [ 2021-08-26 ]

Thank you for the report!
I repeated on 10.2, this is the same bug as MDEV-26407

10.2 228630f61ac10240c36717

210826 16:34:40 [ERROR] mysqld got signal 11 ;
 
sigaction.c:0(__restore_rt)[0x7ff5bfe283c0]
sql/item_cmpfunc.cc:3409(Item_func_case::cleanup())[0x55de1b98b26d]
sql/item.cc:681(Item::cleanup_processor(void*))[0x55de1b95881f]
sql/item.h:1687(Item::cleanup_excluding_fields_processor(void*))[0x55de1b5e20b4]
sql/item.h:4422(Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*))[0x55de1b65932c]
sql/item.h:4134(Item_args::walk_args(bool (Item::*)(void*), bool, void*))[0x55de1b658ead]
sql/item.h:4420(Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*))[0x55de1b6592db]
sql/item.h:4134(Item_args::walk_args(bool (Item::*)(void*), bool, void*))[0x55de1b658ead]
sql/item.h:4420(Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*))[0x55de1b6592db]
sql/table.cc:2838(fix_session_vcol_expr(THD*, Virtual_column_info*))[0x55de1b7c8a90]
sql/sql_base.cc:4986(TABLE::fix_vcol_exprs(THD*))[0x55de1b64df5c]
sql/sql_base.cc:5018(fix_all_session_vcol_exprs(THD*, TABLE_LIST*))[0x55de1b64e128]
sql/sql_base.cc:5189(lock_tables(THD*, TABLE_LIST*, unsigned int, unsigned int))[0x55de1b64e76e]
sql/sql_base.cc:4870(open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*))[0x55de1b64db4d]
sql/sql_base.h:508(open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int))[0x55de1b6135b9]
sql/sql_insert.cc:758(mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool))[0x55de1b696272]
sql/sql_parse.cc:4217(mysql_execute_command(THD*))[0x55de1b6be638]
sql/sql_parse.cc:7793(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55de1b6c9b42]
sql/sql_parse.cc:1830(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55de1b6b7d9d]
sql/sql_parse.cc:1381(do_command(THD*))[0x55de1b6b6898]
sql/sql_connect.cc:1336(do_handle_one_connection(CONNECT*))[0x55de1b812661]
sql/sql_connect.cc:1242(handle_one_connection)[0x55de1b8123c6]
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x55de1c03bec4]
nptl/pthread_create.c:478(start_thread)[0x7ff5bfe1c609]
x86_64/clone.S:97(__GI___clone)[0x7ff5bf9f7293]
 
Query (0x7ff564012708): INSERT INTO v0 ( ) VALUES ( NVL ( FALSE , EXP ( ( 'x' | 'x' ) ) ) , POINT ( ( NOT time_to_sec ( NULL ) ) , 90700366.000000 ) )

Generated at Thu Feb 08 09:45:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.