Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL)
Description
Present in 10.5+ only, both in debug and optimized.
IF(NOT (scalar (@0s)>scalar (@0s))) { die (.);�ku u va�oj SQL sINTaksi{ die (. na liniji0;; |
SHUTDOWN;
|
Leads to (ref error log after shutdown):
11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug) |
2023-02-18 14:22:07 0 [Note] /test/MD180223-mariadb-11.0.1-linux-x86_64-dbg/bin/mariadbd: Shutdown complete
|
Warning: Memory not freed: 280
|
In all affected versions.
No UBSAN/ASAN issues observed.
I tried to make this work under MTR for some time, but failed. AFAICS ftm, this issue can only be reproduced in a client, not in MTR, not even when using the CLI via MTR i.e. --start-and-exit.
As such, you will need to start mariadbd and then mariadb manually/directly to reproduce.
Attachments
Issue Links
- relates to
-
MDEV-26186 280 Bytes lost in mysys/array.c, mysys/hash.c, sql/sp.cc, sql/sp.cc, sql/item_create.cc, sql/item_create.cc, sql/sql_yacc.yy:10748 when using oracle sql_mode
-
- Closed
-
-
MDEV-31578 DECLARE CURSOR: "Memory not freed: 280 bytes lost" on syntax error
-
- Closed
-
Additional testcase now gives LeakSanitizer: detected memory leaks, likely from sp_add_used_routine. Again has to be reproduced in CLI.
SHUTDOWN;
Leads to:
11.0.2 368dd22a816f3b437bccd0b9ff28b9de9b1abf0a (Debug)
2023-05-13 14:01:55 0 [Note] /test/UBASAN_MD120523-mariadb-11.0.2-linux-x86_64-dbg/bin/mariadbd: Shutdown complete
Warning: Memory not freed: 280
=================================================================
==2471466==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 280 byte(s) in 1 object(s) allocated from:
#0 0x5637a4d68337 in __interceptor_malloc (/test/UBASAN_MD120523-mariadb-11.0.2-linux-x86_64-dbg/bin/mariadbd+0x7964337)
#1 0x5637a947f703 in my_malloc /test/11.0_dbg_san/mysys/my_malloc.c:91
#2 0x5637a941352b in init_dynamic_array2 /test/11.0_dbg_san/mysys/array.c:73
#3 0x5637a9423c9d in my_hash_init2 /test/11.0_dbg_san/mysys/hash.c:99
#4 0x5637a7d6b865 in sp_add_used_routine(Query_tables_list*, Query_arena*, MDL_key const*, Sp_handler const*, TABLE_LIST*) /test/11.0_dbg_san/sql/sp.cc:2328
#5 0x5637a7d6fd55 in Sp_handler::add_used_routine(Query_tables_list*, Query_arena*, Database_qualified_name const*) const /test/11.0_dbg_san/sql/sp.cc:2642
#6 0x5637a728717f in Create_sp_func::create_with_db(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, bool, List<Item>*) /test/11.0_dbg_san/sql/item_create.cc:2731
#7 0x5637a722912d in Create_qfunc::create_func(THD*, st_mysql_const_lex_string const*, List<Item>*) /test/11.0_dbg_san/sql/item_create.cc:2578
#8 0x5637a69279f3 in MYSQLparse(THD*) /test/11.0_dbg_san/sql/sql_yacc.yy:10516
#9 0x5637a56e1383 in parse_sql(THD*, Parser_state*, Object_creation_ctx*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:10409
#10 0x5637a56e2f31 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.0_dbg_san/sql/sql_parse.cc:7966
#11 0x5637a56f3707 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1894
#12 0x5637a5701542 in do_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1407
#13 0x5637a60d68b5 in do_handle_one_connection(CONNECT*, bool) /test/11.0_dbg_san/sql/sql_connect.cc:1416
#14 0x5637a60d7dd0 in handle_one_connection /test/11.0_dbg_san/sql/sql_connect.cc:1318
#15 0x148133a94b42 in start_thread nptl/pthread_create.c:442
SUMMARY: AddressSanitizer: 280 byte(s) leaked in 1 allocation(s).
230513 14:01:56 [ERROR] mysqld got signal 6 ;