[MDEV-26463] Memory leak in embedded server bootstrap Created: 2021-08-23 Updated: 2023-12-19 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Embedded Server |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | ASAN, leak | ||
| Issue Links: |
|
||||||||
| Description |
|
A memory leak on the embedded server bootstrap makes ./mtr --embedded almost useless for AddressSanitizer runs:
Note: When the code is compiled with GCC, many tests will pass despite leaks. When compiled with Clang, tests will fail more easily.
Similar leaks are reported for 10.5 and 10.6 as well. Furthermore, the ./mtr --embedded run of a 10.6 GCC ASAN build would seemingly hang using 100% CPU; sudo perf top -g would attribute 95% of all samples to __asan::AsanDie(). This would happen after only 2 reported test failures, after 4197 tests, 1167 to go. I suspect that it could be related to the bootstrap leak. |
| Comments |
| Comment by Eric Xu [ 2022-01-10 ] |
|
Hi, guys, Is there any progress on resolving this issue ? |
| Comment by Sergei Golubchik [ 2022-01-10 ] |
|
Not yet. Why, is it an important issue for you? |
| Comment by Eric Xu [ 2022-01-20 ] |
|
Hi, Sergei, I'm using mariadb as an embedded database within a http server. For each natural language query received, we parse and create corresponding sql query. Now I found the embedded database might have memory leak issue. The issue could be detected by valgrind |
| Comment by Sergei Golubchik [ 2022-03-10 ] |
|
axu123, this leak is a memory allocated on library load and not freed — at least that's what it looks like from the stack trace. It will only be a concern for you if your application (http server or php or whatever) constantly loads and unloads libmysqld.so. So I expect it should not be an issue for you. It's practically a problem only for us as it produces annoying errors in the test suite. |