broken memory management in TokuDB 5.6.28-76.1
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.6 |
Fix Released
|
High
|
George Ormond Lorch III | |||
5.7 |
Fix Released
|
High
|
George Ormond Lorch III |
Bug Description
in ha_tokudb_admin.cc, tokudb:
DBT key, prev_key;
...
error = cursor-
...
if (key.data) tokudb:
tokudb:
This is a major no-no, mixing memory allocators. In MariaDB this causes safemalloc warnings in debug builds and crashes because memory accounting doesn't add up. In MySQL 5.7, I suspect, it will break memory related performance schema tables.
A possible fix could be to use toku_set_
Changed in percona-server: | |
status: | New → Triaged |
tags: | added: tokudb |
description: | updated |
Thanks Sergei, we discovered this too in our 5.7 effort. It seems that FT allows a caller to have it return key/value data that was allocated within the FT lib but does not provide an API for the user of the library to free it.
We are considering implementing the same idea that you were looking for, passing in a set of allocator functions to the FT lib through the BDB/YDB API as part of the FT environment. Alternately, we will expose a proper API to allow a caller/recipient of internal FT memory to release it back through the FT BDB/YDB API.