From 6727f0f58a1251028eb22e0d74dc0551925189a2 Mon Sep 17 00:00:00 2001 From: SGZW Date: Fri, 9 Aug 2024 15:06:37 -0700 Subject: [PATCH] fix compaction_picker_test asan heap use after free (#12908) Summary: ![image](https://github.com/user-attachments/assets/3290fe18-aca2-4691-b072-fbbc96a15fb1) this testcase set syncpoint function which reference this test case heap variable "enable_per_key_placement_" and this sync point function will be triggered by another testcase, so asan will report asan heap use after free error Pull Request resolved: https://github.com/facebook/rocksdb/pull/12908 Reviewed By: hx235 Differential Revision: D60973363 Pulled By: cbi42 fbshipit-source-id: df4f488f51e7741784d5a92fc0a5fc538c5d5b1a --- db/compaction/compaction_picker_test.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/compaction/compaction_picker_test.cc b/db/compaction/compaction_picker_test.cc index 13418486882..b58f5d01008 100644 --- a/db/compaction/compaction_picker_test.cc +++ b/db/compaction/compaction_picker_test.cc @@ -214,7 +214,10 @@ class CompactionPickerTest : public CompactionPickerTestBase { explicit CompactionPickerTest() : CompactionPickerTestBase(BytewiseComparator()) {} - ~CompactionPickerTest() override = default; + ~CompactionPickerTest() override { + SyncPoint::GetInstance()->ClearAllCallBacks(); + SyncPoint::GetInstance()->DisableProcessing(); + } }; class CompactionPickerU64TsTest : public CompactionPickerTestBase {