This is an automated email from the ASF dual-hosted git repository.
zhztheplayer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new e0ec40a894 [VL] Fix native SIGSEGV in ~ObjectStore when release()
races with store destruction (#12740)
e0ec40a894 is described below
commit e0ec40a8949a37afe34c87056228e2f673938881
Author: Kaifei Yi <[email protected]>
AuthorDate: Wed Aug 12 17:14:44 2026 +0800
[VL] Fix native SIGSEGV in ~ObjectStore when release() races with store
destruction (#12740)
---
cpp/core/utils/ObjectStore.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cpp/core/utils/ObjectStore.cc b/cpp/core/utils/ObjectStore.cc
index 05fd584373..4e8df37623 100644
--- a/cpp/core/utils/ObjectStore.cc
+++ b/cpp/core/utils/ObjectStore.cc
@@ -46,12 +46,13 @@ std::pair<gluten::ObjectStore*, gluten::ResourceHandle>
gluten::ObjectStore::loo
gluten::ObjectStore::~ObjectStore() {
for (;;) {
- if (aliveObjects_.empty()) {
- break;
- }
std::shared_ptr<void> tempObj;
{
const std::lock_guard<std::mutex> lock(mtx_);
+ // The empty-check and the pop of the last alive object must be atomic
under `mtx_`.
+ if (aliveObjects_.empty()) {
+ break;
+ }
// destructing in reversed order (the last added object destructed first)
auto itr = aliveObjects_.rbegin();
const ResourceHandle handle = (*itr).first;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]