[MDEV-26394] Assertion `null_value' failed in virtual bool Item::send(Protocol*, String*) Created: 2021-08-18  Updated: 2023-07-06  Resolved: 2023-07-06

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Alexey Botchkov
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

The crash is from galera multi-master pquery run.

10.2.41

mysqld: /test/mtest/10.2_dbg/sql/item.cc:6915: virtual bool Item::send(Protocol*, String*): Assertion `null_value' failed.

10.2.41

Core was generated by `/test/mtest/GAL_MD170821-mariadb-10.2.41-linux-x86_64-dbg/bin/mysqld --defaults'.
Program terminated with signal SIGABRT, Aborted.
#0  0x0000000070000002 in ?? ()
[Current thread is 1 (Thread 0x60ce43839700 (LWP 1405950))]
(gdb) bt
#0  0x0000000070000002 in ?? ()
#1  0x000019ae30e5a766 in _raw_syscall () at /home/roc/rr/rr/src/preload/raw_syscall.S:120
#2  0x000019ae30e5604e in traced_raw_syscall (call=<optimized out>) at /home/roc/rr/rr/src/preload/syscallbuf.c:272
#3  0x000019ae30e594d1 in syscall_hook_internal (call=0x153e8a968fa0) at /home/roc/rr/rr/src/preload/syscallbuf.c:3295
#4  syscall_hook (call=0x153e8a968fa0) at /home/roc/rr/rr/src/preload/syscallbuf.c:3329
#5  0x000019ae30e55e50 in _syscall_hook_trampoline () at /home/roc/rr/rr/src/preload/syscall_hook.S:313
#6  0x000019ae30e55eaf in __morestack () at /home/roc/rr/rr/src/preload/syscall_hook.S:458
#7  0x000019ae30e55f08 in _syscall_hook_trampoline_89_c2_f7_da () at /home/roc/rr/rr/src/preload/syscall_hook.S:504
#8  0x00007ffe65a58f0c in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#9  0x00005612b6953fe2 in my_write_core (sig=sig@entry=6) at /test/mtest/10.2_dbg/mysys/stacktrace.c:382
#10 0x00005612b62447b3 in handle_fatal_signal (sig=6) at /test/mtest/10.2_dbg/sql/signal_handler.cc:355
#11 <signal handler called>
#12 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#13 0x0000582a3d0fa859 in __GI_abort () at abort.c:79
#14 0x0000582a3d0fa729 in __assert_fail_base (fmt=0x582a3d290588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5612b6ac8881 "null_value", file=0x5612b6abffa0 "/test/mtest/10.2_dbg/sql/item.cc", line=6915, function=<optimized out>) at assert.c:92
#15 0x0000582a3d10bf36 in __GI___assert_fail (assertion=assertion@entry=0x5612b6ac8881 "null_value", file=file@entry=0x5612b6abffa0 "/test/mtest/10.2_dbg/sql/item.cc", line=line@entry=6915, function=function@entry=0x5612b6ac0e48 "virtual bool Item::send(Protocol*, String*)") at assert.c:101
#16 0x00005612b625ab54 in Item::send (this=0xaa11802efb8, protocol=0xaa11801ef78, buffer=0x60ce438362d0) at /test/mtest/10.2_dbg/sql/item.cc:6993
#17 0x00005612b5f80084 in Protocol::send_result_set_row (this=this@entry=0xaa11801ef78, row_items=row_items@entry=0xaa118022e30) at /test/mtest/10.2_dbg/sql/protocol.cc:992
#18 0x00005612b5ffe2ec in select_send::send_data (this=0xaa11802f1b0, items=@0xaa118022e30: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xaa11802f0e0, last = 0xaa11802f0e0, elements = 1}, <No data fields>}) at /test/mtest/10.2_dbg/sql/sql_class.cc:2801
#19 0x00005612b60a8f64 in JOIN::exec_inner (this=this@entry=0xaa11802f1d0) at /test/mtest/10.2_dbg/sql/sql_select.cc:3543
#20 0x00005612b60a9bc3 in JOIN::exec (this=this@entry=0xaa11802f1d0) at /test/mtest/10.2_dbg/sql/sql_select.cc:3446
#21 0x00005612b60aa5b6 in mysql_select (thd=thd@entry=0xaa11801e9c0, tables=0x0, wild_num=0, fields=@0xaa118022e30: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xaa11802f0e0, last = 0xaa11802f0e0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2281966336, result=0xaa11802f1b0, unit=0xaa1180225b8, select_lex=0xaa118022d08) at /test/mtest/10.2_dbg/sql/sql_select.cc:3849
#22 0x00005612b60aa84b in handle_select (thd=thd@entry=0xaa11801e9c0, lex=lex@entry=0xaa1180224f8, result=result@entry=0xaa11802f1b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/mtest/10.2_dbg/sql/sql_select.cc:361
#23 0x00005612b602ee85 in execute_sqlcom_select (thd=thd@entry=0xaa11801e9c0, all_tables=0x0) at /test/mtest/10.2_dbg/sql/sql_parse.cc:6271
#24 0x00005612b603916c in mysql_execute_command (thd=thd@entry=0xaa11801e9c0) at /test/mtest/10.2_dbg/sql/sql_parse.cc:3582
#25 0x00005612b6042809 in mysql_parse (thd=thd@entry=0xaa11801e9c0, rawbuf=rawbuf@entry=0xaa11802ee48 "SELECT ST_BOUNDARY(1)", length=length@entry=21, parser_state=parser_state@entry=0x60ce43838540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/mtest/10.2_dbg/sql/sql_parse.cc:7793
#26 0x00005612b6043e12 in wsrep_mysql_parse (thd=thd@entry=0xaa11801e9c0, rawbuf=0xaa11802ee48 "SELECT ST_BOUNDARY(1)", length=21, parser_state=parser_state@entry=0x60ce43838540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/mtest/10.2_dbg/sql/sql_parse.cc:7585
#27 0x00005612b604536b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0xaa11801e9c0, packet=packet@entry=0xaa118026661 "", packet_length=packet_length@entry=22, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/mtest/10.2_dbg/sql/sql_class.h:1109
#28 0x00005612b604814a in do_command (thd=0xaa11801e9c0) at /test/mtest/10.2_dbg/sql/sql_parse.cc:1381
#29 0x00005612b614e1b1 in do_handle_one_connection (connect=connect@entry=0x593d317778a0) at /test/mtest/10.2_dbg/sql/sql_connect.cc:1336
#30 0x00005612b614e3dc in handle_one_connection (arg=0x593d317778a0) at /test/mtest/10.2_dbg/sql/sql_connect.cc:1241
#31 0x00007ffe65a50609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#32 0x0000582a3d1f7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95



 Comments   
Comment by Ramesh Sivaraman [ 2022-05-04 ]

Reproducible test case. Optimized build goes to hung mode when executing the test case.

SELECT ST_BOUNDARY (1);

Leads to:

10.2.44 (Debug)

mysqld: /test/10.2_dbg/sql/item.cc:6959: virtual bool Item::send(Protocol*, String*): Assertion `null_value' failed.

10.2.44 (Debug)

Core was generated by `/test/MD020322-mariadb-10.2.44-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x14cfb40ed700 (LWP 2772433))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x00005623bebeebb8 in my_write_core (sig=sig@entry=6) at /test/10.2_dbg/mysys/stacktrace.c:382
#2  0x00005623be4d3123 in handle_fatal_signal (sig=6) at /test/10.2_dbg/sql/signal_handler.cc:355
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014cfb79e3859 in __GI_abort () at abort.c:79
#6  0x000014cfb79e3729 in __assert_fail_base (fmt=0x14cfb7b79588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5623bed635a9 "null_value", file=0x5623bed5d844 "/test/10.2_dbg/sql/item.cc", line=6959, function=<optimized out>) at assert.c:92
#7  0x000014cfb79f4f36 in __GI___assert_fail (assertion=assertion@entry=0x5623bed635a9 "null_value", file=file@entry=0x5623bed5d844 "/test/10.2_dbg/sql/item.cc", line=line@entry=6959, function=function@entry=0x5623bed5bb58 "virtual bool Item::send(Protocol*, String*)") at assert.c:101
#8  0x00005623be4e94d8 in Item::send (this=0x14cf58011460, protocol=0x14cf58001348, buffer=0x14cfb40ea3d0) at /test/10.2_dbg/sql/item.cc:7037
#9  0x00005623be21104a in Protocol::send_result_set_row (this=this@entry=0x14cf58001348, row_items=row_items@entry=0x14cf58005200) at /test/10.2_dbg/sql/protocol.cc:993
#10 0x00005623be28ee95 in select_send::send_data (this=0x14cf58011638, items=@0x14cf58005200: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14cf58011588, last = 0x14cf58011588, elements = 1}, <No data fields>}) at /test/10.2_dbg/sql/sql_class.cc:2792
#11 0x00005623be338d92 in JOIN::exec_inner (this=this@entry=0x14cf58011658) at /test/10.2_dbg/sql/sql_select.cc:3543
#12 0x00005623be3399f2 in JOIN::exec (this=this@entry=0x14cf58011658) at /test/10.2_dbg/sql/sql_select.cc:3446
#13 0x00005623be33a3e8 in mysql_select (thd=thd@entry=0x14cf58000d90, tables=0x0, wild_num=0, fields=@0x14cf58005200: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14cf58011588, last = 0x14cf58011588, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14cf58011638, unit=0x14cf58004988, select_lex=0x14cf580050d8) at /test/10.2_dbg/sql/sql_select.cc:3849
#14 0x00005623be33a67d in handle_select (thd=thd@entry=0x14cf58000d90, lex=lex@entry=0x14cf580048c8, result=result@entry=0x14cf58011638, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.2_dbg/sql/sql_select.cc:361
#15 0x00005623be2bfb29 in execute_sqlcom_select (thd=thd@entry=0x14cf58000d90, all_tables=0x0) at /test/10.2_dbg/sql/sql_parse.cc:6271
#16 0x00005623be2c9dd6 in mysql_execute_command (thd=thd@entry=0x14cf58000d90) at /test/10.2_dbg/sql/sql_parse.cc:3582
#17 0x00005623be2d3607 in mysql_parse (thd=thd@entry=0x14cf58000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14cfb40ec540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.2_dbg/sql/sql_parse.cc:7793
#18 0x00005623be2d6107 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14cf58000d90, packet=packet@entry=0x14cf580195e1 "", packet_length=packet_length@entry=22, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.2_dbg/sql/sql_class.h:1109
#19 0x00005623be2d8ef5 in do_command (thd=0x14cf58000d90) at /test/10.2_dbg/sql/sql_parse.cc:1381
#20 0x00005623be3dd476 in do_handle_one_connection (connect=connect@entry=0x5623c20c6840) at /test/10.2_dbg/sql/sql_connect.cc:1336
#21 0x00005623be3dd6a1 in handle_one_connection (arg=0x5623c20c6840) at /test/10.2_dbg/sql/sql_connect.cc:1241
#22 0x000014cfb7eec609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#23 0x000014cfb7ae0293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.44 (dbg)

Comment by Alice Sherepa [ 2023-07-06 ]

10.4-10.11 :

MariaDB [test]> SELECT ST_BOUNDARY (1);
ERROR 4079 (HY000): Illegal parameter data type int for operation 'st_boundary'

I will close the bug as 10.2 is no longer maintained

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