[MDEV-13093] Leak of Datafile::m_crypt_info on shutdown after failed startup Created: 2017-06-14 Updated: 2019-01-25 Resolved: 2017-08-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.9, 10.3.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
Also reproducible on bb-10.2-marko 8f2043673c. |
| Comments |
| Comment by Marko Mäkelä [ 2017-06-15 ] | ||||||||||||||||||||
|
In a build configured with cmake -DWITH_ASAN:BOOL=ON, some useful detail is available:
The reason for this crash is that fil_space_crypt_t::~fil_space_crypt_t() was never called on this object. The fil_space_crypt_t is only allocated by fil_space_create_crypt_data() and only freed by fil_space_destroy_crypt_data(). We are clearly missing a call to the latter. | ||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-06-15 ] | ||||||||||||||||||||
|
As I have pointed out earlier, the ownership rules of Datafile::m_crypt_info and SysTablespace::m_crypt_info need to be clarified. Why does SysTablespace::m_crypt_info exist at all? It is possible that a similar resource leak exists in 10.1 already but is not being caught. | ||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-06-15 ] | ||||||||||||||||||||
|
An even better approach would be remove Tablespace and Datafile altogether and move the code to member functions of fil_space_t and fil_node_t. But that is something longer-term, too big to do in a GA release. | ||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-06-26 ] | ||||||||||||||||||||
|
This memory leak affects Mariabackup (bb-10.2-backup) on Windows and Linux. Debug like this:
| ||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-08-31 ] | ||||||||||||||||||||
|
jplindst, I pushed into 10.2 an amended version of the commit. |