Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.11, 11.1(EOL), 11.2(EOL), 11.4, 11.8, 12.0
Description
USE test;
|
SET SQL_MODE='';
|
CREATE FUNCTION f(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t WHERE x = z);
|
CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB;
|
SELECT f('a');
|
DROP TEMPORARY TABLES t;
|
SHOW FUNCTION CODE f;
|
Leads to:
10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b |
Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
|
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
|
[Current thread is 1 (Thread 0x153fb7541700 (LWP 1691430))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
|
#1 0x000056063413d4d7 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:518
|
#2 0x00005606338f79ba in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330
|
#3 <signal handler called>
|
#4 TABLE_LIST::print (this=0x153f92c90568, thd=thd@entry=0x153f92c15088, eliminated_tables=eliminated_tables@entry=0, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27553
|
#5 0x00005606336a8876 in print_table_array (query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF, end=0x153f92c742e8, table=0x153f92c742e0, str=0x153fb753f2a0, eliminated_tables=0, thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_select.cc:27243
|
#6 print_join (thd=thd@entry=0x153f92c15088, eliminated_tables=0, str=str@entry=0x153fb753f2a0, tables=0x153f92c90130, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27399
|
#7 0x00005606336a8e23 in st_select_lex::print (this=0x153f92c8ff68, thd=thd@entry=0x153f92c15088, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27699
|
#8 0x00005606339e4696 in subselect_single_select_engine::print (this=0x153f92c91030, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:4478
|
#9 0x00005606339e4c03 in Item_subselect::print (this=0x153f92c90e88, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:1038
|
#10 0x000056063357fd83 in sp_instr_freturn::print (this=0x153f92c8dea0, str=0x153fb753f2a0) at /test/10.5_dbg/sql/sp_head.cc:4203
|
#11 0x000056063358a50e in sp_head::show_routine_code (this=0x153f92c8f0a0, thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sp_head.cc:3385
|
#12 0x00005606336505e5 in mysql_execute_command (thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:5728
|
#13 0x0000560633658752 in mysql_parse (thd=thd@entry=0x153f92c15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153fb7540350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7993
|
#14 0x0000560633645204 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153f92c15088, packet=packet@entry=0x153f92c67089 "", packet_length=packet_length@entry=20, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1866
|
#15 0x00005606336439de in do_command (thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:1347
|
#16 0x000056063379fc3b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x153f964c7808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
|
#17 0x00005606337a0357 in handle_one_connection (arg=arg@entry=0x153f964c7808) at /test/10.5_dbg/sql/sql_connect.cc:1313
|
#18 0x0000560633c03ca8 in pfs_spawn_thread (arg=0x153fb4446508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
|
#19 0x0000153fb64ba6db in start_thread (arg=0x153fb7541700) at pthread_create.c:463
|
#20 0x0000153fb58b8a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.3.24 (dbg), 10.4.15 (dbg), 10.5.5 (dbg)
Bug confirmed not present in:
MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (dbg), 10.4.14 (opt), 10.5.5 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)
Attachments
Issue Links
- relates to
-
MDEV-25784 Server crashes in Table_function_json_table::print upon SHOW FUNCTION CODE/SHOW CREATE VIEW, UBSAN: member access within null pointer
-
- Confirmed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{noformat}
USE test; SET SQL_MODE=''; CREATE FUNCTION f(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t WHERE x = z); CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB; SELECT f('a'); DROP TEMPORARY TABLES t; SHOW FUNCTION CODE f; {noformat} Leads to: {noformat:title=10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b} Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 [Current thread is 1 (Thread 0x153fb7541700 (LWP 1691430))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 #1 0x000056063413d4d7 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:518 #2 0x00005606338f79ba in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 TABLE_LIST::print (this=0x153f92c90568, thd=thd@entry=0x153f92c15088, eliminated_tables=eliminated_tables@entry=0, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27553 #5 0x00005606336a8876 in print_table_array (query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF, end=0x153f92c742e8, table=0x153f92c742e0, str=0x153fb753f2a0, eliminated_tables=0, thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_select.cc:27243 #6 print_join (thd=thd@entry=0x153f92c15088, eliminated_tables=0, str=str@entry=0x153fb753f2a0, tables=0x153f92c90130, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27399 #7 0x00005606336a8e23 in st_select_lex::print (this=0x153f92c8ff68, thd=thd@entry=0x153f92c15088, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27699 #8 0x00005606339e4696 in subselect_single_select_engine::print (this=0x153f92c91030, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:4478 #9 0x00005606339e4c03 in Item_subselect::print (this=0x153f92c90e88, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:1038 #10 0x000056063357fd83 in sp_instr_freturn::print (this=0x153f92c8dea0, str=0x153fb753f2a0) at /test/10.5_dbg/sql/sp_head.cc:4203 #11 0x000056063358a50e in sp_head::show_routine_code (this=0x153f92c8f0a0, thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sp_head.cc:3385 #12 0x00005606336505e5 in mysql_execute_command (thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:5728 #13 0x0000560633658752 in mysql_parse (thd=thd@entry=0x153f92c15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153fb7540350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7993 #14 0x0000560633645204 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153f92c15088, packet=packet@entry=0x153f92c67089 "", packet_length=packet_length@entry=20, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1866 #15 0x00005606336439de in do_command (thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:1347 #16 0x000056063379fc3b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x153f964c7808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411 #17 0x00005606337a0357 in handle_one_connection (arg=arg@entry=0x153f964c7808) at /test/10.5_dbg/sql/sql_connect.cc:1313 #18 0x0000560633c03ca8 in pfs_spawn_thread (arg=0x153fb4446508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201 #19 0x0000153fb64ba6db in start_thread (arg=0x153fb7541700) at pthread_create.c:463 #20 0x0000153fb58b8a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.3.24 (dbg), 10.5.5 (dbg) Bug confirmed not present in: MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (dbg), 10.4.14 (opt), 10.5.5 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt) |
{noformat}
USE test; SET SQL_MODE=''; CREATE FUNCTION f(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t WHERE x = z); CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB; SELECT f('a'); DROP TEMPORARY TABLES t; SHOW FUNCTION CODE f; {noformat} Leads to: {noformat:title=10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b} Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 [Current thread is 1 (Thread 0x153fb7541700 (LWP 1691430))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 #1 0x000056063413d4d7 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:518 #2 0x00005606338f79ba in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 TABLE_LIST::print (this=0x153f92c90568, thd=thd@entry=0x153f92c15088, eliminated_tables=eliminated_tables@entry=0, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27553 #5 0x00005606336a8876 in print_table_array (query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF, end=0x153f92c742e8, table=0x153f92c742e0, str=0x153fb753f2a0, eliminated_tables=0, thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_select.cc:27243 #6 print_join (thd=thd@entry=0x153f92c15088, eliminated_tables=0, str=str@entry=0x153fb753f2a0, tables=0x153f92c90130, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27399 #7 0x00005606336a8e23 in st_select_lex::print (this=0x153f92c8ff68, thd=thd@entry=0x153f92c15088, str=str@entry=0x153fb753f2a0, query_type=query_type@entry=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/sql_select.cc:27699 #8 0x00005606339e4696 in subselect_single_select_engine::print (this=0x153f92c91030, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:4478 #9 0x00005606339e4c03 in Item_subselect::print (this=0x153f92c90e88, str=0x153fb753f2a0, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /test/10.5_dbg/sql/item_subselect.cc:1038 #10 0x000056063357fd83 in sp_instr_freturn::print (this=0x153f92c8dea0, str=0x153fb753f2a0) at /test/10.5_dbg/sql/sp_head.cc:4203 #11 0x000056063358a50e in sp_head::show_routine_code (this=0x153f92c8f0a0, thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sp_head.cc:3385 #12 0x00005606336505e5 in mysql_execute_command (thd=thd@entry=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:5728 #13 0x0000560633658752 in mysql_parse (thd=thd@entry=0x153f92c15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153fb7540350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7993 #14 0x0000560633645204 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153f92c15088, packet=packet@entry=0x153f92c67089 "", packet_length=packet_length@entry=20, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1866 #15 0x00005606336439de in do_command (thd=0x153f92c15088) at /test/10.5_dbg/sql/sql_parse.cc:1347 #16 0x000056063379fc3b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x153f964c7808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411 #17 0x00005606337a0357 in handle_one_connection (arg=arg@entry=0x153f964c7808) at /test/10.5_dbg/sql/sql_connect.cc:1313 #18 0x0000560633c03ca8 in pfs_spawn_thread (arg=0x153fb4446508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201 #19 0x0000153fb64ba6db in start_thread (arg=0x153fb7541700) at pthread_create.c:463 #20 0x0000153fb58b8a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.3.24 (dbg), 10.4.15 (dbg), 10.5.5 (dbg) Bug confirmed not present in: MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (dbg), 10.4.14 (opt), 10.5.5 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt) |
Affects Version/s | 10.4 [ 22408 ] |
Fix Version/s | 10.4 [ 22408 ] |
Labels | not-10.1 not-10.2 not-10.4 regression | not-10.1 not-10.2 regression |
Summary | SIGSEGV in TABLE_LIST::print on SHOW FUNCTION CODE | SIGSEGV in TABLE_LIST::print on SHOW FUNCTION CODE *and* Assertion `s' failed in TABLE::versioned |
Summary | SIGSEGV in TABLE_LIST::print on SHOW FUNCTION CODE *and* Assertion `s' failed in TABLE::versioned | SIGSEGV in TABLE_LIST::print on SHOW FUNCTION CODE *and* Assertion `s' failed in TABLE::versioned on SHOW FUNCTION CODE |
Workflow | MariaDB v3 [ 111388 ] | MariaDB v4 [ 142105 ] |
Link | This issue is duplicated by MDEV-25784 [ MDEV-25784 ] |
Link | This issue relates to MDEV-25784 [ MDEV-25784 ] |
Link | This issue is duplicated by MDEV-25784 [ MDEV-25784 ] |
Fix Version/s | 10.3 [ 22126 ] |
Affects Version/s | 11.2 [ 28603 ] |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] |
Affects Version/s | 11.1 [ 28549 ] |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] |
Fix Version/s | 10.4 [ 22408 ] |
Fix Version/s | 11.1 [ 28549 ] |
Fix Version/s | 11.2(EOL) [ 28603 ] |
Summary | SIGSEGV in TABLE_LIST::print on SHOW FUNCTION CODE *and* Assertion `s' failed in TABLE::versioned on SHOW FUNCTION CODE | SIGSEGV's in TABLE_LIST::print and TABLE::versioned, and Assertion `s' failed in TABLE::versioned on SHOW FUNCTION CODE |
Labels | not-10.1 not-10.2 regression | ASAN heap-use-after-free not-10.1 not-10.2 regression |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Fix Version/s | 11.4 [ 29301 ] | |
Fix Version/s | 11.8 [ 29921 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.11 [ 27614 ] | |
Affects Version/s | 11.4 [ 29301 ] | |
Affects Version/s | 11.8 [ 29921 ] | |
Affects Version/s | 12.0 [ 29945 ] |
DROP DATABASE test;
CREATE DATABASE test;
USE test;
SET INNODB_DEFAULT_ENCRYPTION_KEY_ID=99;
CREATE TABLE t(c INT) ENGINE=InnoDB;
CREATE FUNCTION f() RETURNS INT RETURN (SELECT * FROM t);
SELECT f();
ALTER TABLE t ADD COLUMN d INT;
SHOW FUNCTION CODE f;
Also reproduces the issue (seemingly deterministic) on 10.5, and highly sporadically on 10.4, both with the same Unique Bug ID. However, 10.4 also has an assert being triggered (hard to hit), ref next comment