From 72a3415553306da1aec2cd5616d6c65ea5089f19 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Sat, 8 Nov 2025 23:09:14 -0400 Subject: [PATCH] Bugfix: Don't use eventfdDesc after stop() We call stop() inside the assembleFrameReq3, so when it returns, the eventfdDesc should be destroyed. Don't allow a possibly stale eventfdDesc obj to permit us to re-arm the eventfdDesc read_some call. --- .../livoxGen1/ioUringAssemblyEngine.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp b/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp index a4448f6..b32034c 100644 --- a/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp +++ b/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp @@ -587,17 +587,15 @@ void IoUringAssemblyEngine::onEventfdRead( } } + if (!isAssembling) { return; } + // Re-arm the eventfd read for next CQE notification - // Only re-arm if assembly is still active (stop() hasn't been called) - if (eventfdDesc && eventfdFd >= 0) - { - eventfdDesc->async_read_some( - boost::asio::buffer(&eventfd_value, sizeof(eventfd_value)), - std::bind( - &IoUringAssemblyEngine::onEventfdRead, this, - std::placeholders::_1, - std::placeholders::_2)); - } + eventfdDesc->async_read_some( + boost::asio::buffer(&eventfd_value, sizeof(eventfd_value)), + std::bind( + &IoUringAssemblyEngine::onEventfdRead, this, + std::placeholders::_1, + std::placeholders::_2)); } void IoUringAssemblyEngine::cancelIncompleteAndFillDummies()