UBSAN: runtime error: member access within null pointer of type 'struct st_my_thread_var' in spider_create_sys_thd and untime error: null pointer passed as argument 1, which is declared to never be null in spider_create_table_name_string
#13 0x557f6153083a in do_command(THD*) /test/10.5_dbg_san/sql/sql_parse.cc:1376
#14 0x557f61e24735 in do_handle_one_connection(CONNECT*, bool) /test/10.5_dbg_san/sql/sql_connect.cc:1417
#15 0x557f61e25c50 in handle_one_connection /test/10.5_dbg_san/sql/sql_connect.cc:1319
#16 0x14e7c1097ad9 in start_thread nptl/pthread_create.c:444
#17 0x14e7c112847b in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
This looks to be a new regression, not present in 10.5 of 25 May 2024 @ 736449d30ffb2ec71bd700ac84eb38ba30bb662c (UBSAN, opt), nor in a 11.6 build (UBSAN, opt) of 17 June @ 29e9ade269d803b6823ec57808e0b7fad28baf9e.
Attachments
Issue Links
relates to
MDEV-35881SIGSEGV in __strcmp_evex() from my_load_defaults on INSERT when using DEFAULT_GROUP and UBSAN: runtime error: member access within null pointer of type 'struct st_my_thread_var'
Roel Van de Paar
added a comment - - edited This testcase produces the same issue:
SET sql_mode= '' ;
INSTALL PLUGIN Spider SONAME 'ha_spider.so' ;
CREATE TABLE t1 (c INT ) ENGINE=Spider;
This testcase can also be used as-is in MTR.
I could not reproduce either testcase at 10.5 3c508d4c71c8bf27c6ecceba53ab9d4325a1bd6c with UBASAN debug, release or relwithdebinfo build, using cli or mtr.
In relwithdebinfo with the following flags
-DWITH_ASAN=ON
-DWITH_ASAN_SCOPE=ON
-DWITH_UBSAN=ON
-DWSREP_LIB_WITH_ASAN=ON
-DCMAKE_CXX_FLAGS=-static-libasan
-DMYSQL_MAINTAINER_MODE=OFF
I get weird warnings in sys_var.inl like the following when testing:
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1405:26: runtime error: store to address 0x55e08f2941e0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55e08f2c00a4 with insufficient space for an object of type 'uchar'
worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029
SET sql_mode='';
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
CREATE TABLE t1 (c INT) ENGINE=Spider;
spider/bugfix.mdev_34591 [ fail ] Found warnings/errors in server log file!
Test ended at 2024-07-15 14:45:24
line
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:458:24: runtime error: store to address 0x55f47ea2fb60 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47ea2fc08 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47ea2fb88 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:519:28: runtime error: store to address 0x55f47e175040 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47e17a160 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1838:8: runtime error: load of address 0x55f47e179fe0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1838:26: runtime error: store to address 0x55f47e179fe0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:389:22: runtime error: store to address 0x55f47d39a320 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:826:35: runtime error: store to address 0x55f47e17ba68 with insufficient space for an object of type 'size_t'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:826:35: runtime error: store to address 0x55f47e17ba28 with insufficient space for an object of type 'size_t'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47e17ab20 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1405:26: runtime error: store to address 0x55f47e17a1e0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47e1a60a4 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:428:18: runtime error: load of address 0x55f47e199cc0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:2165:18: runtime error: load of address 0x55f47e176540 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1493:18: runtime error: load of address 0x55f47e171ca0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1888:18: runtime error: load of address 0x55f47e179fe0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1730:18: runtime error: load of address 0x55f47e17bbe0 with insufficient space for an object of type 'uchar'
Yuchen Pei
added a comment - - edited I could not reproduce either testcase at 10.5 3c508d4c71c8bf27c6ecceba53ab9d4325a1bd6c with UBASAN debug, release or relwithdebinfo build, using cli or mtr.
In relwithdebinfo with the following flags
-DWITH_ASAN=ON
-DWITH_ASAN_SCOPE=ON
-DWITH_UBSAN=ON
-DWSREP_LIB_WITH_ASAN=ON
-DCMAKE_CXX_FLAGS=-static-libasan
-DMYSQL_MAINTAINER_MODE=OFF
I get weird warnings in sys_var.inl like the following when testing:
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1405:26: runtime error: store to address 0x55e08f2941e0 with insufficient space for an object of type 'uchar'
0x55e08f2941e0: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55e08f2c00a4 with insufficient space for an object of type 'uchar'
0x55e08f2c00a4: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029
SET sql_mode='';
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
CREATE TABLE t1 (c INT) ENGINE=Spider;
spider/bugfix.mdev_34591 [ fail ] Found warnings/errors in server log file!
Test ended at 2024-07-15 14:45:24
line
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:458:24: runtime error: store to address 0x55f47ea2fb60 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47ea2fc08 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47ea2fb88 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:519:28: runtime error: store to address 0x55f47e175040 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47e17a160 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1838:8: runtime error: load of address 0x55f47e179fe0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1838:26: runtime error: store to address 0x55f47e179fe0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:389:22: runtime error: store to address 0x55f47d39a320 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:826:35: runtime error: store to address 0x55f47e17ba68 with insufficient space for an object of type 'size_t'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:826:35: runtime error: store to address 0x55f47e17ba28 with insufficient space for an object of type 'size_t'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47e17ab20 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1405:26: runtime error: store to address 0x55f47e17a1e0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:193:18: runtime error: store to address 0x55f47e1a60a4 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:428:18: runtime error: load of address 0x55f47e199cc0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:2165:18: runtime error: load of address 0x55f47e176540 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1493:18: runtime error: load of address 0x55f47e171ca0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1888:18: runtime error: load of address 0x55f47e179fe0 with insufficient space for an object of type 'uchar'
/home/ycp/source/mariadb-server/push-10.5/src/sql/sys_vars.inl:1730:18: runtime error: load of address 0x55f47e17bbe0 with insufficient space for an object of type 'uchar'
Bisecting.