[MDEV-20379] Mroonga has memory leak in ha_mroonga::is_foreign_key_field Created: 2019-08-19  Updated: 2019-08-20  Resolved: 2019-08-20

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Mroonga
Affects Version/s: 10.5
Fix Version/s: 10.2.26

Type: Bug Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None
Environment:

BUILD/compile-pentium64-valgrind-max


Issue Links:
PartOf
is part of MDEV-20310 valgrind bugs found in 10.5 Open

 Description   

mtr --valgrind mroonga/storage.update_virtual_column
==6093== 40 bytes in 1 blocks are definitely lost in loss record 2 of 12
==6093== at 0x4C2E2BB: malloc (vg_replace_malloc.c:309)
==6093== by 0xF759E47: grn_malloc_default (alloc.c:780)
==6093== by 0xF434920: accessor_new (db.c:5543)
==6093== by 0xF435091: grn_obj_get_accessor (db.c:5748)
==6093== by 0xF42DCC7: grn_obj_column (db.c:4682)
==6093== by 0xF3B0518: ha_mroonga::is_foreign_key_field(char const*, char const*) (ha_mroonga.cpp:8979)
==6093== by 0xF3A3392: ha_mroonga::storage_update_row(unsigned char const*, unsigned char const*) (ha_mroonga.cpp:6661)
==6093== by 0xF3A52F7: ha_mroonga::update_row(unsigned char const*, unsigned char const*) (ha_mroonga.cpp:7021)
==6093== by 0xBB7C56: handler::ha_update_row(unsigned char const*, unsigned char const*) (handler.cc:6680)
==6093== by 0x99F18C: mysql_update(THD*, TABLE_LIST*, List<Item>&, List<Item>&, Item*, unsigned int, st_order*, unsigned long long, bool, unsigned long long*, unsigned long long*) (sql_update.cc:1045)
==6093== by 0x88EEDB: mysql_execute_command(THD*) (sql_parse.cc:4358)
==6093== by 0x89AFCE: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:7943)
==6093== by 0x887C17: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1853)
==6093== by 0x886489: do_command(THD*) (sql_parse.cc:1369)
==6093== by 0xA101D5: do_handle_one_connection(CONNECT*, bool) (sql_connect.cc:1414)
==6093== by 0xA0FF09: handle_one_connection (sql_connect.cc:1309)
==6093== by 0xE41174: pfs_spawn_thread (pfs.cc:1862)
==6093== by 0x4E42568: start_thread (in /lib64/libpthread-2.26.so)
==6093== by 0x6ECBA2E: clone (in /lib64/libc-2.26.so)



 Comments   
Comment by Michael Widenius [ 2019-08-20 ]

Problem was that ha_mroonga::is_foreign_key_field() didn't properly free some variables.

Comment by Michael Widenius [ 2019-08-20 ]

Fix by Kentoku, tested and applied by Monty

Generated at Thu Feb 08 08:59:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.