[MDEV-25876] Warning: Memory not freed: 8/16/32 on setting session_track_system_variables Created: 2021-06-08  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Variables
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: affects-tests, memory_not_freed


 Description   

SET GLOBAL session_track_system_variables='a';
SHUTDOWN;

Leads to:

10.6.2 06dd151bb86ad5b87d4d46011f36da1289c01074 (Debug)

2021-06-08 19:38:22 0 [Note] /test/MD050621-mariadb-10.6.2-linux-x86_64-dbg/bin/mysqld: Shutdown complete
 
Warning: Memory not freed: 32
Warning:   32 bytes lost at 0x14db2401b2e0, allocated by T@0 at 0x55c68baa843d, mysys/my_malloc.c:221, sql/sys_vars.ic:568, sql/set_var.cc:207, sql/set_var.cc:858, sql/set_var.cc:745, sql/sql_parse.cc:5027, sql/sql_parse.cc:8016
Memory lost: 32 bytes in 1 chunks
Warning:   32 bytes lost at 0x14db2401b2e0, allocated by T@0 at sql/sql_parse.cc:1897, mysys/my_malloc.c:221, sql/sys_vars.ic:568, sql/set_var.cc:207, sql/set_var.cc:858, sql/set_var.cc:745, sql/sql_parse.cc:5027, sql/sql_parse.cc:8016
Memory lost: 32 bytes in 1 chunks

Bug present in 10.2-10.6 both opt and dbg.

The memory loss size has changed over time. 10.2 Debug gives:

10.2.38 (Debug)

2021-06-08 19:43:51 23053458228992 [Note] /test/MD270421-mariadb-10.2.38-linux-x86_64-dbg/bin/mysqld: Shutdown complete
 
Warning: Memory not freed: 8
Warning:    8 bytes lost at 0x14f748008b70, allocated by T@0 at mysys/my_malloc.c:229, sql/sys_vars.ic:527, sql/set_var.cc:208, sql/set_var.cc:837, sql/set_var.cc:738, sql/sql_parse.cc:4644, sql/sql_parse.cc:7796, sql/sql_parse.cc:1827
Memory lost: 8 bytes in 1 chunks
Warning:    8 bytes lost at 0x14f748008b70, allocated by T@0 at mysys/my_malloc.c:229, sql/sys_vars.ic:527, sql/set_var.cc:208, sql/set_var.cc:837, sql/set_var.cc:738, sql/sql_parse.cc:4644, sql/sql_parse.cc:7796, sql/sql_parse.cc:1827
Memory lost: 8 bytes in 1 chunks

And 10.3 optimized (10.3 debug also has 8 bytes):
2021-06-08 19:45:50 0 [Note] /test/MD270421-mariadb-10.3.29-linux-x86_64-opt/bin/mysqld: Shutdown complete

10.3.29 4d412e9854ccb3676a9a51a002fbcc6b44a26294 (Optimized)

Warning: Memory not freed: 16



 Comments   
Comment by Roel Van de Paar [ 2021-06-08 ]

For an example fix on a similar bug, see MDEV-24509

Comment by Roel Van de Paar [ 2022-08-27 ]

Up to 10.11

10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

2022-08-27 14:11:36 0 [Note] /test/MD190822-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld: Shutdown complete
Warning: Memory not freed: 32
Warning:   32 bytes lost at 0x154f14019f30, allocated by T@0 at 0x55ba3bbec757, 0x55ba3b3545be, mysys/my_malloc.c:221, sql/sys_vars.inl:568, sql/set_var.cc:207, sql/set_var.cc:863, sql/set_var.cc:745, sql/sql_parse.cc:5034
Memory lost: 32 bytes in 1 chunks
Warning:   32 bytes lost at 0x154f14019f30, allocated by T@0 at sql/sql_class.h:2746, sql/sql_parse.cc:1894, mysys/my_malloc.c:221, sql/sys_vars.inl:568, sql/set_var.cc:207, sql/set_var.cc:863, sql/set_var.cc:745, sql/sql_parse.cc:5034
Memory lost: 32 bytes in 1 chunks

Generated at Thu Feb 08 09:41:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.