Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
-
None
-
None
Description
--source include/have_innodb.inc
|
|
create table t1 (c decimal(7,0)) engine=innodb ; |
insert into t1 values (0),(1),(2),(3); |
|
select distinct 1 from t1 |
group by make_set((updatexml('1975-09-25', 'b', 5)), (trim('t' from c)), (convert((@a := 'a'), decimal(5,1)))) |
with rollup; |
10.2 d565895bbd8e2a163be48b9b |
Version: '10.2.32-MariaDB-debug-log' socket: '/10.2/mysql-test/var/tmp/mysqld.1.sock' port: 16000 Source distribution
|
=================================================================
|
==15791==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c00007b3b0 at pc 0x7fdd3e12d8ae bp 0x7fdd27a955b0 sp 0x7fdd27a94d60
|
READ of size 1 at 0x60c00007b3b0 thread T27
|
#0 0x7fdd3e12d8ad in __interceptor_memmove (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x378ad)
|
#1 0x5612efd9427c in String::copy(String const&) /10.2/sql/sql_string.cc:179
|
#2 0x5612f03c0396 in Item_func_make_set::val_str(String*) /10.2/sql/item_strfunc.cc:2836
|
#3 0x5612f02a2098 in Cached_item_str::cmp() /10.2/sql/item_buff.cc:84
|
#4 0x5612efcdf030 in test_if_group_changed(List<Cached_item>&) /10.2/sql/sql_select.cc:23301
|
#5 0x5612efccc3f3 in end_write_group(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:20531
|
#6 0x5612efcfa74d in AGGR_OP::put_record(bool) /10.2/sql/sql_select.cc:26794
|
#7 0x5612efd08162 in AGGR_OP::put_record() (/10.2/sql/mysqld+0x106b162)
|
#8 0x5612efcbc2b8 in sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:18588
|
#9 0x5612efcbee2b in evaluate_join_record /10.2/sql/sql_select.cc:19087
|
#10 0x5612efcbd61c in sub_select(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:18867
|
#11 0x5612efcbb19f in do_select /10.2/sql/sql_select.cc:18411
|
#12 0x5612efc51d39 in JOIN::exec_inner() /10.2/sql/sql_select.cc:3633
|
#13 0x5612efc4f8a7 in JOIN::exec() /10.2/sql/sql_select.cc:3428
|
#14 0x5612efc52f0b in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /10.2/sql/sql_select.cc:3828
|
#15 0x5612efc2fafd in handle_select(THD*, LEX*, select_result*, unsigned long) /10.2/sql/sql_select.cc:361
|
#16 0x5612efba4143 in execute_sqlcom_select /10.2/sql/sql_parse.cc:6224
|
#17 0x5612efb8f04a in mysql_execute_command(THD*) /10.2/sql/sql_parse.cc:3531
|
#18 0x5612efbad8ef in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/sql/sql_parse.cc:7739
|
#19 0x5612efb84001 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/sql/sql_parse.cc:1830
|
#20 0x5612efb806b2 in do_command(THD*) /10.2/sql/sql_parse.cc:1384
|
#21 0x5612eff22c21 in do_handle_one_connection(CONNECT*) /10.2/sql/sql_connect.cc:1336
|
#22 0x5612eff224e2 in handle_one_connection /10.2/sql/sql_connect.cc:1241
|
#23 0x5612f13c597f in pfs_spawn_thread /10.2/storage/perfschema/pfs.cc:1869
|
#24 0x7fdd3e0dcfa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
|
#25 0x7fdd3da884ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
|
|
0x60c00007b3b0 is located 112 bytes inside of 124-byte region [0x60c00007b340,0x60c00007b3bc)
|
freed by thread T27 here:
|
#0 0x7fdd3e1defb0 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8fb0)
|
#1 0x5612f15ab601 in free_memory /10.2/mysys/safemalloc.c:279
|
#2 0x5612f15aabbf in sf_free /10.2/mysys/safemalloc.c:197
|
#3 0x5612f157832b in my_free /10.2/mysys/my_malloc.c:218
|
#4 0x5612ef93c313 in String::free() /10.2/sql/sql_string.h:351
|
#5 0x5612efd93625 in String::real_alloc(unsigned long) /10.2/sql/sql_string.cc:44
|
#6 0x5612ef9650e3 in String::alloc(unsigned long) /10.2/sql/sql_string.h:361
|
#7 0x5612f0551016 in my_decimal2string(unsigned int, my_decimal const*, unsigned int, unsigned int, char, String*) /10.2/sql/my_decimal.cc:118
|
#8 0x5612f0331e18 in Item_decimal_typecast::val_str(String*) /10.2/sql/item_func.cc:1162
|
#9 0x5612f03c02b4 in Item_func_make_set::val_str(String*) /10.2/sql/item_strfunc.cc:2816
|
#10 0x5612f02a2098 in Cached_item_str::cmp() /10.2/sql/item_buff.cc:84
|
#11 0x5612efcdf030 in test_if_group_changed(List<Cached_item>&) /10.2/sql/sql_select.cc:23301
|
#12 0x5612efccc3f3 in end_write_group(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:20531
|
#13 0x5612efcfa74d in AGGR_OP::put_record(bool) /10.2/sql/sql_select.cc:26794
|
#14 0x5612efd08162 in AGGR_OP::put_record() (/10.2/sql/mysqld+0x106b162)
|
#15 0x5612efcbc2b8 in sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:18588
|
#16 0x5612efcbee2b in evaluate_join_record /10.2/sql/sql_select.cc:19087
|
#17 0x5612efcbd61c in sub_select(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:18867
|
#18 0x5612efcbb19f in do_select /10.2/sql/sql_select.cc:18411
|
#19 0x5612efc51d39 in JOIN::exec_inner() /10.2/sql/sql_select.cc:3633
|
#20 0x5612efc4f8a7 in JOIN::exec() /10.2/sql/sql_select.cc:3428
|
#21 0x5612efc52f0b in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /10.2/sql/sql_select.cc:3828
|
#22 0x5612efc2fafd in handle_select(THD*, LEX*, select_result*, unsigned long) /10.2/sql/sql_select.cc:361
|
#23 0x5612efba4143 in execute_sqlcom_select /10.2/sql/sql_parse.cc:6224
|
#24 0x5612efb8f04a in mysql_execute_command(THD*) /10.2/sql/sql_parse.cc:3531
|
#25 0x5612efbad8ef in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/sql/sql_parse.cc:7739
|
#26 0x5612efb84001 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/sql/sql_parse.cc:1830
|
#27 0x5612efb806b2 in do_command(THD*) /10.2/sql/sql_parse.cc:1384
|
#28 0x5612eff22c21 in do_handle_one_connection(CONNECT*) /10.2/sql/sql_connect.cc:1336
|
#29 0x5612eff224e2 in handle_one_connection /10.2/sql/sql_connect.cc:1241
|
|
previously allocated by thread T27 here:
|
#0 0x7fdd3e1df330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
|
#1 0x5612f15aa563 in sf_malloc /10.2/mysys/safemalloc.c:118
|
#2 0x5612f15778ee in my_malloc /10.2/mysys/my_malloc.c:101
|
#3 0x5612efd93684 in String::real_alloc(unsigned long) /10.2/sql/sql_string.cc:45
|
#4 0x5612ef9650e3 in String::alloc(unsigned long) /10.2/sql/sql_string.h:361
|
#5 0x5612f0551016 in my_decimal2string(unsigned int, my_decimal const*, unsigned int, unsigned int, char, String*) /10.2/sql/my_decimal.cc:118
|
#6 0x5612f017e81c in Field_new_decimal::val_str(String*, String*) /10.2/sql/field.cc:3489
|
#7 0x5612f024d554 in Item_field::val_str(String*) /10.2/sql/item.cc:2824
|
#8 0x5612f03b7bfc in Item_func_trim::val_str(String*) /10.2/sql/item_strfunc.cc:2013
|
#9 0x5612f03c02b4 in Item_func_make_set::val_str(String*) /10.2/sql/item_strfunc.cc:2816
|
#10 0x5612f02a2098 in Cached_item_str::cmp() /10.2/sql/item_buff.cc:84
|
#11 0x5612efcdf030 in test_if_group_changed(List<Cached_item>&) /10.2/sql/sql_select.cc:23301
|
#12 0x5612efccc3f3 in end_write_group(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:20531
|
#13 0x5612efcfa74d in AGGR_OP::put_record(bool) /10.2/sql/sql_select.cc:26794
|
#14 0x5612efd08162 in AGGR_OP::put_record() (/10.2/sql/mysqld+0x106b162)
|
#15 0x5612efcbc2b8 in sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:18588
|
#16 0x5612efcbee2b in evaluate_join_record /10.2/sql/sql_select.cc:19087
|
#17 0x5612efcbd61c in sub_select(JOIN*, st_join_table*, bool) /10.2/sql/sql_select.cc:18867
|
#18 0x5612efcbb19f in do_select /10.2/sql/sql_select.cc:18411
|
#19 0x5612efc51d39 in JOIN::exec_inner() /10.2/sql/sql_select.cc:3633
|
#20 0x5612efc4f8a7 in JOIN::exec() /10.2/sql/sql_select.cc:3428
|
#21 0x5612efc52f0b in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /10.2/sql/sql_select.cc:3828
|
#22 0x5612efc2fafd in handle_select(THD*, LEX*, select_result*, unsigned long) /10.2/sql/sql_select.cc:361
|
#23 0x5612efba4143 in execute_sqlcom_select /10.2/sql/sql_parse.cc:6224
|
#24 0x5612efb8f04a in mysql_execute_command(THD*) /10.2/sql/sql_parse.cc:3531
|
#25 0x5612efbad8ef in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/sql/sql_parse.cc:7739
|
#26 0x5612efb84001 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/sql/sql_parse.cc:1830
|
#27 0x5612efb806b2 in do_command(THD*) /10.2/sql/sql_parse.cc:1384
|
#28 0x5612eff22c21 in do_handle_one_connection(CONNECT*) /10.2/sql/sql_connect.cc:1336
|
#29 0x5612eff224e2 in handle_one_connection /10.2/sql/sql_connect.cc:1241
|
|
Thread T27 created by T0 here:
|
#0 0x7fdd3e146db0 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x50db0)
|
#1 0x5612f13c5dbb in spawn_thread_v1 /10.2/storage/perfschema/pfs.cc:1919
|
#2 0x5612ef916484 in inline_mysql_thread_create /10.2/include/mysql/psi/mysql_thread.h:1246
|
#3 0x5612ef92e8b6 in create_thread_to_handle_connection(CONNECT*) /10.2/sql/mysqld.cc:6514
|
#4 0x5612ef92f00b in create_new_thread /10.2/sql/mysqld.cc:6584
|
#5 0x5612ef9302b3 in handle_connections_sockets() /10.2/sql/mysqld.cc:6859
|
#6 0x5612ef92dce9 in mysqld_main(int, char**) /10.2/sql/mysqld.cc:6133
|
#7 0x5612ef914dd4 in main /10.2/sql/main.cc:25
|
#8 0x7fdd3d9b309a in __libc_start_main ../csu/libc-start.c:308
|
|
SUMMARY: AddressSanitizer: heap-use-after-free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x378ad) in __interceptor_memmove
|
Shadow bytes around the buggy address:
|
0x0c1880007620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04
|
0x0c1880007630: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
0x0c1880007640: 00 00 00 00 00 00 00 04 fa fa fa fa fa fa fa fa
|
0x0c1880007650: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c1880007660: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
|
=>0x0c1880007670: fd fd fd fd fd fd[fd]fd fa fa fa fa fa fa fa fa
|
0x0c1880007680: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
0x0c1880007690: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
0x0c18800076a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
0x0c18800076b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
0x0c18800076c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
Shadow byte legend (one shadow byte represents 8 application bytes):
|
Addressable: 00
|
Partially addressable: 01 02 03 04 05 06 07
|
Heap left redzone: fa
|
Freed heap region: fd
|
Stack left redzone: f1
|
Stack mid redzone: f2
|
Stack right redzone: f3
|
Stack after return: f5
|
Stack use after scope: f8
|
Global redzone: f9
|
Global init order: f6
|
Poisoned by user: f7
|
Container overflow: fc
|
Array cookie: ac
|
Intra object redzone: bb
|
ASan internal: fe
|
Left alloca redzone: ca
|
Right alloca redzone: cb
|
==15791==ABORTING
|
|
on 10.5
10.5 9075973dbf2ef69e95d |
Version: '10.5.3-MariaDB-debug-log'
|
ERROR: AddressSanitizer: heap-use-after-free on address 0x60e00002db68 at pc 0x7fb59de878ae bp 0x7fb58f5ac8c0 sp 0x7fb58f5ac070
|
READ of size 1 at 0x60e00002db68 thread T12
|
#0 0x7fb59de878ad in __interceptor_memmove (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x378ad)
|
#1 0x555d8d73818e in Binary_string::copy(Binary_string const&) /10.5/sql/sql_string.cc:230
|
#2 0x555d8d3f4185 in String::copy(String const&) /10.5/sql/sql_string.h:827
|
#3 0x555d8de9ad37 in Item_func_make_set::val_str(String*) /10.5/sql/item_strfunc.cc:2891
|
#4 0x555d8dd68b57 in Cached_item_str::cmp() /10.5/sql/item_buff.cc:84
|
#5 0x555d8d653d77 in test_if_group_changed(List<Cached_item>&) /10.5/sql/sql_select.cc:25088
|
#6 0x555d8d640a1c in end_write_group(JOIN*, st_join_table*, bool) /10.5/sql/sql_select.cc:22290
|
#7 0x555d8d670c81 in AGGR_OP::put_record(bool) /10.5/sql/sql_select.cc:28821
|
#8 0x555d8d680b70 in AGGR_OP::put_record() (/10.5/sql/mariadbd+0x1b8cb70)
|
#9 0x555d8d631290 in sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) /10.5/sql/sql_select.cc:20319
|
#10 0x555d8d6339c7 in evaluate_join_record /10.5/sql/sql_select.cc:20826
|
#11 0x555d8d632356 in sub_select(JOIN*, st_join_table*, bool) /10.5/sql/sql_select.cc:20603
|
#12 0x555d8d6303e4 in do_select /10.5/sql/sql_select.cc:20137
|
#13 0x555d8d5be5dd in JOIN::exec_inner() /10.5/sql/sql_select.cc:4463
|
#14 0x555d8d5bbc2f in JOIN::exec() /10.5/sql/sql_select.cc:4244
|
#15 0x555d8d5bfb44 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /10.5/sql/sql_select.cc:4668
|
#16 0x555d8d591e87 in handle_select(THD*, LEX*, select_result*, unsigned long) /10.5/sql/sql_select.cc:417
|
#17 0x555d8d5041d4 in execute_sqlcom_select /10.5/sql/sql_parse.cc:6168
|
#18 0x555d8d4f25f6 in mysql_execute_command(THD*) /10.5/sql/sql_parse.cc:3901
|
#19 0x555d8d50f222 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.5/sql/sql_parse.cc:7953
|
#20 0x555d8d4e5010 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.5/sql/sql_parse.cc:1839
|
#21 0x555d8d4e1a45 in do_command(THD*) /10.5/sql/sql_parse.cc:1358
|
#22 0x555d8d900b8e in do_handle_one_connection(CONNECT*, bool) /10.5/sql/sql_connect.cc:1422
|
#23 0x555d8d900429 in handle_one_connection /10.5/sql/sql_connect.cc:1319
|
#24 0x555d8e59e965 in pfs_spawn_thread /10.5/storage/perfschema/pfs.cc:2201
|
#25 0x7fb59de36fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
|
#26 0x7fb59d4674ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
|
Attachments
Issue Links
- relates to
-
MDEV-21589 AddressSanitizer: memcpy-param-overlap in Static_binary_string::q_append or String::append
- Closed
-
MDEV-32762 Heap-Use-After-Free at /mariadb-11.3.0/sql/sql_string.cc:261
- Confirmed