From: luo rixin Date: Sat, 28 Dec 2019 03:17:29 +0000 (+0800) Subject: test/kv_store_bench: Fix double free error X-Git-Tag: v15.1.0~178^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32439%2Fhead;p=ceph.git test/kv_store_bench: Fix double free error kvs->aio_xxx is asynchronous function, cb_args will be used and deleted in aio_callbcak_timed, delete cb_agrs in test_teuthology_aio will cause double free error. Signed-off-by: Xuqiang Chen Signed-off-by: luo rixin --- diff --git a/src/test/kv_store_bench.cc b/src/test/kv_store_bench.cc index d3ca358b1fb..bc35346e41d 100644 --- a/src/test/kv_store_bench.cc +++ b/src/test/kv_store_bench.cc @@ -412,15 +412,16 @@ int KvStoreBench::test_teuthology_aio(next_gen_t distr, delete cb_args; continue; } - bufferlist val; ops_in_flight++; cb_args->sw.start_time(); kvs->aio_get(kv.first, &cb_args->val, aio_callback_timed, cb_args, &cb_args->err); break; + default: + // shouldn't happen here + assert(false); } - delete cb_args; } op_avail.wait(l, [this] { return ops_in_flight <= 0; });