Skip to content

Commit

Permalink
Fix asan stack use after return error.
Browse files Browse the repository at this point in the history
  • Loading branch information
sanebay committed Mar 21, 2024
1 parent 2c500c5 commit 3510dd3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/checkpoint/cp_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/index/wb_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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); });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/logstore/log_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool HomeLogStore::write_sync(logstore_seq_num_t seq_num, const sisl::io_blob& b

{
std::unique_lock< std::mutex > lk{ctx->write_mutex};
ctx->write_cv.wait(lk, [&ctx] { return ctx->write_done; });
ctx->write_cv.wait(lk, [ctx] { return ctx->write_done; });
}

return ctx->ret;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/logstore/log_store_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
{
Expand All @@ -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];
{
Expand All @@ -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); });
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/replication/repl_dev/raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void RaftReplDev::on_fetch_data_received(intrusive< sisl::GenericRpcData >& rpc_
// accumulate the sgs for later use (send back to the requester));
sgs_vec.push_back(sgs);

async_read(local_blkid, sgs, total_size).thenValue([this, &ctx](auto&& err) {
async_read(local_blkid, sgs, total_size).thenValue([this, ctx](auto&& err) {
if (err) {
COUNTER_INCREMENT(m_metrics, read_err_cnt, 1);
RD_REL_ASSERT(false, "Error in reading data"); // TODO: Find a way to return error to the Listener
Expand All @@ -236,7 +236,7 @@ void RaftReplDev::on_fetch_data_received(intrusive< sisl::GenericRpcData >& rpc_
{
// wait for read to complete;
std::unique_lock< std::mutex > lk{ctx->mtx};
ctx->cv.wait(lk, [&ctx] { return (ctx->outstanding_read_cnt == 0); });
ctx->cv.wait(lk, [ctx] { return (ctx->outstanding_read_cnt == 0); });
}

// now prepare the io_blob_list to response back to requester;
Expand Down

0 comments on commit 3510dd3

Please sign in to comment.