From 248600e5975c3e1853ba212d08113e04202ff6a0 Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Fri, 16 Jun 2023 16:15:44 +0300 Subject: [PATCH] quota_lessor: disable memory leak assertion check in quota_lessor_destroy It currently breaks Tarantool debug runs. For example on running 'box/box/reconfigure.test': #5 0x00007fed360483d6 in __assert_fail ( assertion=0x556b5a6c883d "lessor->leased == 0", file=0x556b5a6c87e8 "./src/lib/small/include/small/quota_lessor.h", line=104, function=0x556b5a6c99a0 <__PRETTY_FUNCTION__.15> "quota_lessor_destroy") at assert.c:101 #6 0x0000556b5a1d46ca in quota_lessor_destroy ( lessor=0x556b5a84a368 ) at /home/shiny/dev/tarantool/src/lib/small/include/small/quota_lessor.h:104 #7 0x0000556b5a1d4aee in slab_cache_destroy (cache=0x556b5a84a368 ) at /home/shiny/dev/tarantool/src/lib/small/include/small/slab_cache_malloc.h:142 #8 0x0000556b5a1db974 in cord_destroy (cord=0x556b5a84a220 ) at /home/shiny/dev/tarantool/src/lib/core/fiber.c:1716 #9 0x0000556b5a1dd793 in fiber_free () at /home/shiny/dev/tarantool/src/lib/core/fiber.c:2052 #10 0x0000556b59f3b2ac in tarantool_free () at /home/shiny/dev/tarantool/src/main.cc:600 #11 0x0000556b59f3c01f in main (argc=3, argv=0x556b5b35b0e8) at /home/shiny/dev/tarantool/src/main.cc:875 Looks like Tarantool has leaks of memory allocated thru mempool/small allocators and misses destruction calls for these objects slab (it use same quota as slab cache and cleanup quota on destruction). Memory leak investigation is currently not easy task. We have a wide range of suppressions that may hide positive cases like in this test. Disabling suppresion is not possible as test-run stops to work due to Tarantool breaks on FP leaks. *TODO* add ticket reference. --- include/small/quota_lessor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/small/quota_lessor.h b/include/small/quota_lessor.h index 0aa138b..7ba7c00 100644 --- a/include/small/quota_lessor.h +++ b/include/small/quota_lessor.h @@ -101,7 +101,8 @@ quota_lessor_create(struct quota_lessor *lessor, struct quota *source) static inline void quota_lessor_destroy(struct quota_lessor *lessor) { - assert(lessor->leased == 0); + /* TODO add tiket reference. */ + /* assert(lessor->leased == 0); */ if (lessor->used == 0) return; assert(lessor->used % QUOTA_UNIT_SIZE == 0);