|
UBSAN: runtime error: member call on null pointer of type 'struct Explain_node' in Explain_node::print_explain_for_children on EXPLAIN...UNION
CREATE TABLE t (c INT) ENGINE=InnoDB;
|
EXPLAIN SELECT * FROM t WHERE c in (SELECT c FROM t UNION SELECT c FROM t ORDER BY (SELECT c)) UNION SELECT * FROM t ORDER BY (SELECT c);
|
Leads to:
|
10.9.0 161fd2d29cc2f8390fa3bf7e739c52bc8d5c39df (Optimized)
|
/test/10.9_opt_san/sql/sql_explain.cc:665:28: runtime error: member call on null pointer of type 'struct Explain_node'
|
|
10.9.0 161fd2d29cc2f8390fa3bf7e739c52bc8d5c39df (Optimized)
|
#0 0x5557334a0405 in Explain_node::print_explain_for_children(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_opt_san/sql/sql_explain.cc:665
|
#1 0x5557334af2e0 in Explain_union::print_explain(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_opt_san/sql/sql_explain.cc:590
|
#2 0x5557334a0254 in Explain_node::print_explain_for_children(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_opt_san/sql/sql_explain.cc:665
|
#3 0x5557334b6df4 in Explain_select::print_explain(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_opt_san/sql/sql_explain.cc:857
|
#4 0x5557334adc76 in Explain_union::print_explain(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_opt_san/sql/sql_explain.cc:505
|
#5 0x555732a67872 in execute_sqlcom_select /test/10.9_opt_san/sql/sql_parse.cc:6223
|
#6 0x555732aa588b in mysql_execute_command(THD*, bool) /test/10.9_opt_san/sql/sql_parse.cc:3959
|
#7 0x555732a350a8 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/10.9_opt_san/sql/sql_parse.cc:8043
|
#8 0x555732a8b439 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/10.9_opt_san/sql/sql_parse.cc:1910
|
#9 0x555732a96c92 in do_command(THD*, bool) /test/10.9_opt_san/sql/sql_parse.cc:1407
|
#10 0x555733381d3d in do_handle_one_connection(CONNECT*, bool) /test/10.9_opt_san/sql/sql_connect.cc:1418
|
#11 0x555733384834 in handle_one_connection /test/10.9_opt_san/sql/sql_connect.cc:1312
|
#12 0x5557354821f9 in pfs_spawn_thread /test/10.9_opt_san/storage/perfschema/pfs.cc:2201
|
#13 0x14800fec3608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
|
#14 0x14800f138162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162)
|
|
10.9.0 161fd2d29cc2f8390fa3bf7e739c52bc8d5c39df (Debug)
|
/test/10.9_dbg_san/sql/sql_explain.cc:665:28: runtime error: member call on null pointer of type 'struct Explain_node'
|
|
10.9.0 161fd2d29cc2f8390fa3bf7e739c52bc8d5c39df (Debug)
|
#0 0x557e24a2647f in Explain_node::print_explain_for_children(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_dbg_san/sql/sql_explain.cc:665
|
#1 0x557e24a2d313 in Explain_union::print_explain(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_dbg_san/sql/sql_explain.cc:590
|
#2 0x557e24a263b2 in Explain_node::print_explain_for_children(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_dbg_san/sql/sql_explain.cc:665
|
#3 0x557e24a4777b in Explain_select::print_explain(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_dbg_san/sql/sql_explain.cc:857
|
#4 0x557e24a2711f in Explain_union::print_explain(Explain_query*, select_result_sink*, unsigned char, bool) /test/10.9_dbg_san/sql/sql_explain.cc:505
|
#5 0x557e24a24993 in Explain_query::print_explain(select_result_sink*, unsigned char, bool) /test/10.9_dbg_san/sql/sql_explain.cc:213
|
#6 0x557e23d94be6 in execute_sqlcom_select /test/10.9_dbg_san/sql/sql_parse.cc:6223
|
#7 0x557e23dfb216 in mysql_execute_command(THD*, bool) /test/10.9_dbg_san/sql/sql_parse.cc:3959
|
#8 0x557e23d5d728 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/10.9_dbg_san/sql/sql_parse.cc:8043
|
#9 0x557e23dd344e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/10.9_dbg_san/sql/sql_parse.cc:1910
|
#10 0x557e23de9fa9 in do_command(THD*, bool) /test/10.9_dbg_san/sql/sql_parse.cc:1407
|
#11 0x557e248b6c4b in do_handle_one_connection(CONNECT*, bool) /test/10.9_dbg_san/sql/sql_connect.cc:1418
|
#12 0x557e248b9ae5 in handle_one_connection /test/10.9_dbg_san/sql/sql_connect.cc:1312
|
#13 0x557e26e12c62 in pfs_spawn_thread /test/10.9_dbg_san/storage/perfschema/pfs.cc:2201
|
#14 0x14d784f50608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
|
#15 0x14d7841c5162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162)
|
Setup:
Compiled with GCC >=7.5.0 (I use GCC 9.4.0) and:
|
-DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_UBSAN=ON -DWITH_RAPID=OFF -DWSREP_LIB_WITH_ASAN=ON
|
Set before execution:
|
export UBSAN_OPTIONS=print_stacktrace=1
|
Bug confirmed present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt)
|