Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Not a Bug
-
11.8, 11.7(EOL)
Description
SET SQL_MODE=''; |
CREATE TABLE t (pk INT KEY,v VECTOR (5) NOT NULL,VECTOR (v)); |
INSERT INTO t (pk) VALUES(1); |
Leads to:
|
CS 11.7.2 14a80f092914c966e552128f1f5ae744dad86220 (Optimized, UBASAN, Clang) |
/test/11.7_opt_san/sql/vector_mhnsw.cc:105:7: runtime error: index 4 out of bounds for type 'int16_t [4]'
|
SUMMARY: UndefinedBehaviorSanitizer: out-of-bounds-index /test/11.7_opt_san/sql/vector_mhnsw.cc:105:7 in
|
#0 0x29df080 in FVector::create(metric_type, void*, void const*, unsigned long) /test/11.7_opt_san/sql/vector_mhnsw.cc:105:20
|
#1 0x29e0828 in FVectorNode::FVectorNode(MHNSW_Share*, void const*, unsigned char, void const*) /test/11.7_opt_san/sql/vector_mhnsw.cc:712:8
|
#2 0x29e59ca in mhnsw_insert(TABLE*, st_key*) /test/11.7_opt_san/sql/vector_mhnsw.cc:1164:20
|
#3 0xd07ba3 in TABLE::hlindexes_on_insert() /test/11.7_opt_san/sql/sql_base.cc:9880:18
|
#4 0x2219062 in handler::ha_write_row(unsigned char const*) /test/11.7_opt_san/sql/handler.cc:8192:34
|
#5 0xe6baa1 in write_record(THD*, TABLE*, st_copy_info*, select_result*) /test/11.7_opt_san/sql/sql_insert.cc:2312:12
|
#6 0xe58224 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) /test/11.7_opt_san/sql/sql_insert.cc:1171:14
|
#7 0x101a22d in mysql_execute_command(THD*, bool) /test/11.7_opt_san/sql/sql_parse.cc:4485:10
|
#8 0xfd9e02 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.7_opt_san/sql/sql_parse.cc:7915:18
|
#9 0xfce6d4 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.7_opt_san/sql/sql_parse.cc:1903:7
|
#10 0xfdcc3e in do_command(THD*, bool) /test/11.7_opt_san/sql/sql_parse.cc:1416:17
|
#11 0x181e2b4 in do_handle_one_connection(CONNECT*, bool) /test/11.7_opt_san/sql/sql_connect.cc:1415:11
|
#12 0x181d884 in handle_one_connection /test/11.7_opt_san/sql/sql_connect.cc:1327:5
|
#13 0x146da493a608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
|
#14 0x146da4650132 in clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
 |
SUMMARY: UndefinedBehaviorSanitizer: out-of-bounds-index /test/11.7_opt_san/sql/vector_mhnsw.cc:105:7 in
|
Setup:
Compiled with a recent version of Clang (I used Clang 10.0.0) with LLVM 18:
|
# Note: llvm-17-linker-tools installs /usr/lib/llvm-17/lib/LLVMgold.so, which is needed for compilation, and LLVMgold.so is no longer included in LLVM 18
|
sudo apt install clang llvm-18 llvm-18-linker-tools llvm-18-runtime llvm-18-tools llvm-18-dev libstdc++-14-dev llvm-dev llvm-17-linker-tools
|
sudo ln -s /usr/lib/llvm-17/lib/LLVMgold.so /usr/lib/llvm-18/lib/LLVMgold.so
|
Compiled with: '-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++' and:
|
-DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_UBSAN=ON -DWSREP_LIB_WITH_ASAN=ON
|
Set before execution:
|
export UBSAN_OPTIONS=print_stacktrace=1:report_error_type=1 # And you may also want to supress UBSAN startup issues using 'suppressions=UBSAN.filter'. For an example of UBSAN.filter, which includes current startup issues see: https://github.com/mariadb-corporation/mariadb-qa/blob/master/UBSAN.filter
|
Bug confirmed present in:
MariaDB: 11.7.2 (opt), 11.8.0 (dbg), 11.8.0 (opt)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.5.28 (opt), 10.6.21 (dbg), 10.6.21 (opt), 10.11.10 (dbg), 10.11.10 (opt), 11.4.4 (dbg), 11.4.4 (opt)