From e7d9ea53df7292ec7a0016778d9679537f7ffd7e Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 12 Sep 2024 18:03:20 +0200 Subject: [PATCH] EXPERIMENT: GH-44071: [C++] Leak S3 structures if finalization happens too late --- cpp/src/arrow/filesystem/s3fs.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/src/arrow/filesystem/s3fs.cc b/cpp/src/arrow/filesystem/s3fs.cc index 96c771aeb61b8..ac373a69e7cd6 100644 --- a/cpp/src/arrow/filesystem/s3fs.cc +++ b/cpp/src/arrow/filesystem/s3fs.cc @@ -3389,6 +3389,9 @@ struct AwsInstance { ARROW_LOG(WARNING) << " arrow::fs::FinalizeS3 was not called even though S3 was initialized. " "This could lead to a segmentation fault at exit"; + auto leaked_ptr = new std::shared_ptr(GetClientFinalizer()); + ARROW_UNUSED(leaked_ptr); + return; } GetClientFinalizer()->Finalize(); #ifdef ARROW_S3_HAS_S3CLIENT_CONFIGURATION