New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asan: leak at unit:swim.test:swim_test_encryption #5283
Comments
avtikhon
added a commit
that referenced
this issue
Sep 9, 2020
Found leak issue: [001] +==41031==ERROR: LeakSanitizer: detected memory leaks [001] + [001] +Direct leak of 96 byte(s) in 2 object(s) allocated from: [001] + #0 0x4d8e53 in __interceptor_malloc (/tnt/test/unit/swim.test+0x4d8e53) [001] + #1 0x53560f in crypto_codec_new /source/src/lib/crypto/crypto.c:239:51 [001] + #2 0x5299c4 in swim_scheduler_set_codec /source/src/lib/swim/swim_io.c:700:30 [001] + #3 0x511fe6 in swim_cluster_set_codec /source/test/unit/swim_test_utils.c:251:2 [001] + #4 0x50b3ae in swim_test_encryption /source/test/unit/swim.c:767:2 [001] + #5 0x50b3ae in main_f /source/test/unit/swim.c:1123 [001] + #6 0x544a3b in fiber_loop /source/src/lib/core/fiber.c:869:18 [001] + #7 0x5a13d0 in coro_init /source/third_party/coro/coro.c:110:3 [001] + [001] +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 2 allocation(s). Prepared minimal issue reproducer: static void swim_test_encryption(void) { swim_start_test(3); struct swim_cluster *cluster = swim_cluster_new(2); swim_cluster_set_codec(cluster, CRYPTO_ALGO_AES128, CRYPTO_MODE_CBC, "1234567812345678", CRYPTO_AES128_KEY_SIZE); swim_cluster_delete(cluster); swim_finish_test(); } Found that memory allocated for codec creation at crypto_codec_new() using swim_cluster_set_codec(). But there was no any memory free for it. Decided to integrate at test utilities swim_cluster_delete_codec() function for it available for tests. After this fix removed susspencion on memory leak for unit/swin.test. Closes #5283
avtikhon
added a commit
that referenced
this issue
Sep 9, 2020
Found leak issue: [001] +==41031==ERROR: LeakSanitizer: detected memory leaks [001] + [001] +Direct leak of 96 byte(s) in 2 object(s) allocated from: [001] + #0 0x4d8e53 in __interceptor_malloc (/tnt/test/unit/swim.test+0x4d8e53) [001] + #1 0x53560f in crypto_codec_new /source/src/lib/crypto/crypto.c:239:51 [001] + #2 0x5299c4 in swim_scheduler_set_codec /source/src/lib/swim/swim_io.c:700:30 [001] + #3 0x511fe6 in swim_cluster_set_codec /source/test/unit/swim_test_utils.c:251:2 [001] + #4 0x50b3ae in swim_test_encryption /source/test/unit/swim.c:767:2 [001] + #5 0x50b3ae in main_f /source/test/unit/swim.c:1123 [001] + #6 0x544a3b in fiber_loop /source/src/lib/core/fiber.c:869:18 [001] + #7 0x5a13d0 in coro_init /source/third_party/coro/coro.c:110:3 [001] + [001] +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 2 allocation(s). Prepared minimal issue reproducer: static void swim_test_encryption(void) { swim_start_test(3); struct swim_cluster *cluster = swim_cluster_new(2); swim_cluster_set_codec(cluster, CRYPTO_ALGO_AES128, CRYPTO_MODE_CBC, "1234567812345678", CRYPTO_AES128_KEY_SIZE); swim_cluster_delete(cluster); swim_finish_test(); } Found that memory allocation for codec creation at crypto_codec_new() using swim_cluster_set_codec() was not any freed at the test. Decided to integrate into test utilities swim_cluster_delete_codec() function which can be used for it in tests. After this fix removed susspencion on memory leak for unit/swim.test. Closes #5283
avtikhon
added a commit
that referenced
this issue
Sep 10, 2020
Found leak issue: [001] +==41031==ERROR: LeakSanitizer: detected memory leaks [001] + [001] +Direct leak of 96 byte(s) in 2 object(s) allocated from: [001] + #0 0x4d8e53 in __interceptor_malloc (/tnt/test/unit/swim.test+0x4d8e53) [001] + #1 0x53560f in crypto_codec_new /source/src/lib/crypto/crypto.c:239:51 [001] + #2 0x5299c4 in swim_scheduler_set_codec /source/src/lib/swim/swim_io.c:700:30 [001] + #3 0x511fe6 in swim_cluster_set_codec /source/test/unit/swim_test_utils.c:251:2 [001] + #4 0x50b3ae in swim_test_encryption /source/test/unit/swim.c:767:2 [001] + #5 0x50b3ae in main_f /source/test/unit/swim.c:1123 [001] + #6 0x544a3b in fiber_loop /source/src/lib/core/fiber.c:869:18 [001] + #7 0x5a13d0 in coro_init /source/third_party/coro/coro.c:110:3 [001] + [001] +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 2 allocation(s). Prepared minimal issue reproducer: static void swim_test_encryption(void) { swim_start_test(3); struct swim_cluster *cluster = swim_cluster_new(2); swim_cluster_set_codec(cluster, CRYPTO_ALGO_AES128, CRYPTO_MODE_CBC, "1234567812345678", CRYPTO_AES128_KEY_SIZE); swim_cluster_delete(cluster); swim_finish_test(); } Found that memory allocation for codec creation at crypto_codec_new() using swim_cluster_set_codec() was not any freed at the test. Added crypto_codec_delete() in swim_scheduler_destroy() function for it. After this fix removed susspencion on memory leak for unit/swim.test. Closes #5283
avtikhon
added a commit
that referenced
this issue
Sep 10, 2020
Found leak issue: [001] +==41031==ERROR: LeakSanitizer: detected memory leaks [001] + [001] +Direct leak of 96 byte(s) in 2 object(s) allocated from: [001] + #0 0x4d8e53 in __interceptor_malloc (/tnt/test/unit/swim.test+0x4d8e53) [001] + #1 0x53560f in crypto_codec_new /source/src/lib/crypto/crypto.c:239:51 [001] + #2 0x5299c4 in swim_scheduler_set_codec /source/src/lib/swim/swim_io.c:700:30 [001] + #3 0x511fe6 in swim_cluster_set_codec /source/test/unit/swim_test_utils.c:251:2 [001] + #4 0x50b3ae in swim_test_encryption /source/test/unit/swim.c:767:2 [001] + #5 0x50b3ae in main_f /source/test/unit/swim.c:1123 [001] + #6 0x544a3b in fiber_loop /source/src/lib/core/fiber.c:869:18 [001] + #7 0x5a13d0 in coro_init /source/third_party/coro/coro.c:110:3 [001] + [001] +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 2 allocation(s). Prepared minimal issue reproducer: static void swim_test_encryption(void) { swim_start_test(3); struct swim_cluster *cluster = swim_cluster_new(2); swim_cluster_set_codec(cluster, CRYPTO_ALGO_AES128, CRYPTO_MODE_CBC, "1234567812345678", CRYPTO_AES128_KEY_SIZE); swim_cluster_delete(cluster); swim_finish_test(); } Found that memory allocation for codec creation at crypto_codec_new() using swim_cluster_set_codec() was not any freed at the test. Added crypto_codec_delete() in swim_scheduler_destroy() function for it. After this fix removed susspencion on memory leak for unit/swim.test. Closes #5283 Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Co-authored-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
kyukhin
pushed a commit
that referenced
this issue
Sep 11, 2020
Found leak issue: [001] +==41031==ERROR: LeakSanitizer: detected memory leaks [001] + [001] +Direct leak of 96 byte(s) in 2 object(s) allocated from: [001] + #0 0x4d8e53 in __interceptor_malloc (/tnt/test/unit/swim.test+0x4d8e53) [001] + #1 0x53560f in crypto_codec_new /source/src/lib/crypto/crypto.c:239:51 [001] + #2 0x5299c4 in swim_scheduler_set_codec /source/src/lib/swim/swim_io.c:700:30 [001] + #3 0x511fe6 in swim_cluster_set_codec /source/test/unit/swim_test_utils.c:251:2 [001] + #4 0x50b3ae in swim_test_encryption /source/test/unit/swim.c:767:2 [001] + #5 0x50b3ae in main_f /source/test/unit/swim.c:1123 [001] + #6 0x544a3b in fiber_loop /source/src/lib/core/fiber.c:869:18 [001] + #7 0x5a13d0 in coro_init /source/third_party/coro/coro.c:110:3 [001] + [001] +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 2 allocation(s). Prepared minimal issue reproducer: static void swim_test_encryption(void) { swim_start_test(3); struct swim_cluster *cluster = swim_cluster_new(2); swim_cluster_set_codec(cluster, CRYPTO_ALGO_AES128, CRYPTO_MODE_CBC, "1234567812345678", CRYPTO_AES128_KEY_SIZE); swim_cluster_delete(cluster); swim_finish_test(); } Found that memory allocation for codec creation at crypto_codec_new() using swim_cluster_set_codec() was not any freed at the test. Added crypto_codec_delete() in swim_scheduler_destroy() function for it. After this fix removed susspencion on memory leak for unit/swim.test. Closes #5283 Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Co-authored-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> (cherry picked from commit ee9e3ae)
kyukhin
pushed a commit
that referenced
this issue
Sep 11, 2020
Found leak issue: [001] +==41031==ERROR: LeakSanitizer: detected memory leaks [001] + [001] +Direct leak of 96 byte(s) in 2 object(s) allocated from: [001] + #0 0x4d8e53 in __interceptor_malloc (/tnt/test/unit/swim.test+0x4d8e53) [001] + #1 0x53560f in crypto_codec_new /source/src/lib/crypto/crypto.c:239:51 [001] + #2 0x5299c4 in swim_scheduler_set_codec /source/src/lib/swim/swim_io.c:700:30 [001] + #3 0x511fe6 in swim_cluster_set_codec /source/test/unit/swim_test_utils.c:251:2 [001] + #4 0x50b3ae in swim_test_encryption /source/test/unit/swim.c:767:2 [001] + #5 0x50b3ae in main_f /source/test/unit/swim.c:1123 [001] + #6 0x544a3b in fiber_loop /source/src/lib/core/fiber.c:869:18 [001] + #7 0x5a13d0 in coro_init /source/third_party/coro/coro.c:110:3 [001] + [001] +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 2 allocation(s). Prepared minimal issue reproducer: static void swim_test_encryption(void) { swim_start_test(3); struct swim_cluster *cluster = swim_cluster_new(2); swim_cluster_set_codec(cluster, CRYPTO_ALGO_AES128, CRYPTO_MODE_CBC, "1234567812345678", CRYPTO_AES128_KEY_SIZE); swim_cluster_delete(cluster); swim_finish_test(); } Found that memory allocation for codec creation at crypto_codec_new() using swim_cluster_set_codec() was not any freed at the test. Added crypto_codec_delete() in swim_scheduler_destroy() function for it. After this fix removed susspencion on memory leak for unit/swim.test. Closes #5283 Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Co-authored-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> (cherry picked from commit ee9e3ae)
avtikhon
added a commit
that referenced
this issue
Sep 11, 2020
Removed susspencion on memory leak for unit/swim.test test. Closes #5283
kyukhin
pushed a commit
that referenced
this issue
Sep 11, 2020
Removed susspencion on memory leak for unit/swim.test test. Closes #5283
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tarantool version:
2.6.0-57-g2a01ce912
OS version:
Linux
Bug description:
Found memory leak in test:
test/unit/swim.test (sub-test: swim_test_encryption)
located at:
test/unit/swim.c:swim_test_encryption()
Issue:
Sub-test is:
The function can be minimized with the same issue up to:
Seems that root issue in the swim_cluster_set_codec() function which uses resources that later not freed.
To fix in need to integrate:
Steps to reproduce:
Use the attached patch to reproduce:
and run:
Optional (but very desirable):
The text was updated successfully, but these errors were encountered: