Fix memory leaks reported by ASAN (with suppressions turned off) part 2#10491
Merged
locker merged 5 commits intotarantool:masterfrom Aug 30, 2024
Merged
Fix memory leaks reported by ASAN (with suppressions turned off) part 2#10491locker merged 5 commits intotarantool:masterfrom
locker merged 5 commits intotarantool:masterfrom
Conversation
p7nov
approved these changes
Aug 30, 2024
locker
requested changes
Aug 30, 2024
changelogs/unreleased/gh-10489-fix-vinyl-on-dump-failure-memleak.md
Outdated
Show resolved
Hide resolved
locker
reviewed
Aug 30, 2024
locker
approved these changes
Aug 30, 2024
Besides mentioned tarantool#10484 we fix another memleak (filter_temporary_ddl_stmt() error path) that introduced by the same commit 96a5224 ("box: factor out new_tuple def construction"). Closes tarantool#10484 Part-of tarantool#10211 NO_TEST=covered by existing tests NO_DOC=bugfix
Besides mentioned tarantool#10485 we also fix a similar memleak (updating user) that introduced by the same commit 5b32bb7 ("alter: Refactor access_check outside constructors"). Closes tarantool#10485 Part-of tarantool#10211 NO_TEST=covered by existing tests NO_DOC=bugfix
The issue is we increment `page_count` only on page write. If we fail
for some reason before then page info `min_key` in leaked.
LSAN report for 'vinyl/recovery_quota.test.lua':
```
2024-07-05 13:30:34.605 [478603] main/103/on_shutdown vy_scheduler.c:1668 E> 512/0: failed to compact range (-inf..inf)
=================================================================
==478603==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x5e4ebafcae09 in malloc (/home/shiny/dev/tarantool/build-asan-debug/src/tarantool+0x1244e09) (BuildId: 20c5933d67a3831c4f43f6860379d58d35b81974)
tarantool#1 0x5e4ebb3f9b69 in vy_key_dup /home/shiny/dev/tarantool/src/box/vy_stmt.c:308:14
tarantool#2 0x5e4ebb49b615 in vy_page_info_create /home/shiny/dev/tarantool/src/box/vy_run.c:257:23
tarantool#3 0x5e4ebb48f59f in vy_run_writer_start_page /home/shiny/dev/tarantool/src/box/vy_run.c:2196:6
tarantool#4 0x5e4ebb48c6b6 in vy_run_writer_append_stmt /home/shiny/dev/tarantool/src/box/vy_run.c:2287:6
tarantool#5 0x5e4ebb72877f in vy_task_write_run /home/shiny/dev/tarantool/src/box/vy_scheduler.c:1132:8
tarantool#6 0x5e4ebb73305e in vy_task_compaction_execute /home/shiny/dev/tarantool/src/box/vy_scheduler.c:1485:9
tarantool#7 0x5e4ebb73e152 in vy_task_f /home/shiny/dev/tarantool/src/box/vy_scheduler.c:1795:6
tarantool#8 0x5e4ebb01e0b1 in fiber_cxx_invoke(int (*)(__va_list_tag*), __va_list_tag*) /home/shiny/dev/tarantool/src/lib/core/fiber.h:1331:10
tarantool#9 0x5e4ebc389ee0 in fiber_loop /home/shiny/dev/tarantool/src/lib/core/fiber.c:1182:18
tarantool#10 0x5e4ebd3e9595 in coro_init /home/shiny/dev/tarantool/third_party/coro/coro.c:108:3
SUMMARY: AddressSanitizer: 4 byte(s) leaked in 1 allocation(s).
```
Closes tarantool#10489
Part-of tarantool#10211
NO_TEST=covered by existing tests
NO_DOC=bugfix
`ffi.C.tnt_iconv_open` returns pointer to `struct iconv`. In this case `__gc` in metatable is not bound to the object. Closes tarantool#10487 Part-of tarantool#10211 NO_TEST=covered by existing tests NO_DOC=bugfix
When replica is deleted from cluster it receives the deletion statement and then connection to master is closed by master. Since the commit 25aac11 ("box: apply deletion of replica from `_cluster` on the deleted replica") we kill applier to master on the deletion. Thus the exit message produced due to EOF on connection to master is never executed. This message in next in queue after the deletion statement. As a result the exit message diag with SocketError from applier thread is not freed. Closes tarantool#10490 Part-of tarantool#10211 NO_TEST=covered by existing tests NO_DOC=bugfix
Member
|
Cherry-picked to 2.11 and 3.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #10211
Factored out from all-in-one PR #10207
Closes #10484
Closes #10485
Closes #10487
Closes #10489
Closes #10490