From 882c3332dd1ecdf12ec266f9f1110781517849d5 Mon Sep 17 00:00:00 2001 From: liqiang Date: Tue, 5 Nov 2024 06:56:31 +0000 Subject: [PATCH 1/2] fix: use-after-free when remove pipeline but not clear flusher pointer --- core/pipeline/Pipeline.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/pipeline/Pipeline.cpp b/core/pipeline/Pipeline.cpp index 7be446e4cf..bedc8359f7 100644 --- a/core/pipeline/Pipeline.cpp +++ b/core/pipeline/Pipeline.cpp @@ -431,9 +431,11 @@ void Pipeline::Stop(bool isRemoving) { ProcessQueueManager::GetInstance()->DisablePop(mName, isRemoving); WaitAllItemsInProcessFinished(); - if (!isRemoving) { - FlushBatch(); - } + // flush or clear + // if (!isRemoving) { + FlushBatch(); + // } + // TimeoutFlushManager::GetInstance()->ClearRecords(mName); if (!mGoPipelineWithoutInput.isNull()) { // Go pipeline `Stop` will stop and delete From f037d35c0cd8e5d2be823ff3a4af5a143f562503 Mon Sep 17 00:00:00 2001 From: liqiang Date: Tue, 5 Nov 2024 09:41:46 +0000 Subject: [PATCH 2/2] fix: ua-raw-pointer-flusher --- core/pipeline/Pipeline.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/pipeline/Pipeline.cpp b/core/pipeline/Pipeline.cpp index bedc8359f7..40dec54bd6 100644 --- a/core/pipeline/Pipeline.cpp +++ b/core/pipeline/Pipeline.cpp @@ -431,11 +431,7 @@ void Pipeline::Stop(bool isRemoving) { ProcessQueueManager::GetInstance()->DisablePop(mName, isRemoving); WaitAllItemsInProcessFinished(); - // flush or clear - // if (!isRemoving) { FlushBatch(); - // } - // TimeoutFlushManager::GetInstance()->ClearRecords(mName); if (!mGoPipelineWithoutInput.isNull()) { // Go pipeline `Stop` will stop and delete