[MDEV-23526] InnoDB leaks memory for some static objects Created: 2020-08-21 Updated: 2020-10-06 Resolved: 2020-08-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.4.4, 10.5.0 |
| Fix Version/s: | 10.4.16, 10.5.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | leak | ||
| Issue Links: |
|
||||||||||||
| Description |
|
InnoDB is leaking some memory for statically allocated objects. The leaks were caught by some changes to SAFEMALLOC that allow instrumenting operator new. I did not try to find out how to make AddressSanitizer report them. The impact is small, because the few dozen bytes will be freed by the operating system when the process is terminated. But, because memory leaks can be a telltale sign of subsystems not being closed down properly, we prefer to fix them. The leaks were identified by monty and cvicentiu. |
| Comments |
| Comment by Eugene Kosov (Inactive) [ 2020-08-21 ] |
|
SAFEMALLOC performs it's check with std::atexit(). It really happens when destruction of static objects like fil_system_t fil_system happens. In our case sf_terminate() was called before the fil_system_t::~fil_system_t() was called. And a false positive was reported. |
| Comment by Marko Mäkelä [ 2020-08-21 ] |
|
I agree that leak could be a too strong word for this. Some recovery-related memory in 10.5 was not being freed until shutdown. It was only a few hundred bytes, so this is not a big deal. Still, I think that it is useful to fix anything found by any instrumentation, because I remember some occurrences where AddressSanitizer does not report memory leak details while SAFEMALLOC would. |