From f3388648e0f502d832b32e430146bce910c26321 Mon Sep 17 00:00:00 2001 From: Sanal Date: Thu, 21 Mar 2024 12:46:09 -0700 Subject: [PATCH] Fix asan stack use after return error. (#359) --- conanfile.py | 2 +- src/lib/checkpoint/cp_mgr.cpp | 2 +- src/lib/index/wb_cache.cpp | 4 ++-- src/lib/logstore/log_store_service.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conanfile.py b/conanfile.py index efe16b56a..9711ef8e4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class HomestoreConan(ConanFile): name = "homestore" - version = "5.1.14" + version = "5.1.15" homepage = "https://github.com/eBay/Homestore" description = "HomeStore Storage Engine" diff --git a/src/lib/checkpoint/cp_mgr.cpp b/src/lib/checkpoint/cp_mgr.cpp index fba5a6099..d73a0ddd1 100644 --- a/src/lib/checkpoint/cp_mgr.cpp +++ b/src/lib/checkpoint/cp_mgr.cpp @@ -291,7 +291,7 @@ void CPManager::start_cp_thread() { { std::unique_lock< std::mutex > lk{ctx->mtx}; - ctx->cv.wait(lk, [&ctx] { return (ctx->thread_cnt == 1); }); + ctx->cv.wait(lk, [ctx] { return (ctx->thread_cnt == 1); }); } } diff --git a/src/lib/index/wb_cache.cpp b/src/lib/index/wb_cache.cpp index c48a3292e..5bc277fe8 100644 --- a/src/lib/index/wb_cache.cpp +++ b/src/lib/index/wb_cache.cpp @@ -57,7 +57,7 @@ void IndexWBCache::start_flush_threads() { for (int32_t i{0}; i < nthreads; ++i) { iomanager.create_reactor("index_cp_flush" + std::to_string(i), iomgr::INTERRUPT_LOOP, 1u, - [this, &ctx](bool is_started) { + [this, ctx](bool is_started) { if (is_started) { { std::unique_lock< std::mutex > lk{ctx->mtx}; @@ -71,7 +71,7 @@ void IndexWBCache::start_flush_threads() { { std::unique_lock< std::mutex > lk{ctx->mtx}; - ctx->cv.wait(lk, [&ctx, nthreads] { return (ctx->thread_cnt == nthreads); }); + ctx->cv.wait(lk, [ctx, nthreads] { return (ctx->thread_cnt == nthreads); }); } } diff --git a/src/lib/logstore/log_store_service.cpp b/src/lib/logstore/log_store_service.cpp index 68f08d275..0fd3a090f 100644 --- a/src/lib/logstore/log_store_service.cpp +++ b/src/lib/logstore/log_store_service.cpp @@ -260,7 +260,7 @@ void LogStoreService::start_threads() { m_flush_fiber = nullptr; iomanager.create_reactor("log_flush_thread", iomgr::TIGHT_LOOP | iomgr::ADAPTIVE_LOOP, 1 /* num_fibers */, - [this, &ctx](bool is_started) { + [this, ctx](bool is_started) { if (is_started) { m_flush_fiber = iomanager.iofiber_self(); { @@ -273,7 +273,7 @@ void LogStoreService::start_threads() { m_truncate_fiber = nullptr; iomanager.create_reactor("logstore_truncater", iomgr::INTERRUPT_LOOP, 2 /* num_fibers */, - [this, &ctx](bool is_started) { + [this, ctx](bool is_started) { if (is_started) { m_truncate_fiber = iomanager.sync_io_capable_fibers()[0]; { @@ -285,7 +285,7 @@ void LogStoreService::start_threads() { }); { std::unique_lock< std::mutex > lk{ctx->mtx}; - ctx->cv.wait(lk, [&ctx] { return (ctx->thread_cnt == 2); }); + ctx->cv.wait(lk, [ctx] { return (ctx->thread_cnt == 2); }); } }