[Bug] Flaky SIGSEGV in VariantParquetTest: Arrow IO thread frees PoolBuffer after the test's memory pool is destroyed
Maintainer antworten meist innerhalb von 1 Tag
@SteNicholas arbeitet bereits daran.
Seit 23.9.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Search before asking
- I searched in the issues and found nothing similar.
Paimon-cpp version
main, observed on commit dc745fe91932dc2cba919fb13639dfc427280006 (the change in that commit only touches realtime/, unrelated to this failure).
Minimal reproduce step
Flaky; observed in CI job gcc-release-x86_64: https://github.com/apache/paimon-cpp/actions/runs/35845901520/job/107134278444
paimon-parquet-format-test crashes with SIGSEGV right after VariantParquetTest.WriteAndReadRoundTrip passes, while VariantParquetTest.ShreddedWriteAndReadRoundTrip is starting:
[ RUN ] VariantParquetTest.ShreddedWriteAndReadRoundTrip
build_support/run-test.sh: line 98: 67868 Segmentation fault (core dumped)
Program terminated with signal SIGSEGV, Segmentation fault.
Thread 1 (Arrow IO thread pool):
#0 arrow::PoolBuffer::~PoolBuffer()
#1 arrow::Future<std::shared_ptr<arrow::Buffer>>::SetResult(...)::{lambda(void*)#1}::_FUN(void*)
#2 arrow::ConcreteFutureImpl::~ConcreteFutureImpl()
#3 std::_Sp_counted_base<...>::_M_release_last_use_cold()
#4 arrow::internal::FnOnce<void ()>::FnImpl<std::_Bind<arrow::detail::ContinueFuture (arrow::Future<std::shared_ptr<arrow::Buffer>>, arrow::io::RandomAccessFile::ReadAsync(arrow::io::IOContext const&, long, long)::{lambda()#1})>>::~FnImpl()
#5 arrow::internal::ThreadPool::LaunchWorkersUnlocked(int)::{lambda()#1} ...
The main thread is already running the next test (VariantShreddingWritePlan::CreateFromPhysicalSchema) and is unrelated to the crash.
What doesn't meet your expectations?
The test binary should not crash. The crash is a use-after-free of the Arrow memory pool in the test fixture:
VariantParquetTest::SetUp()creates a per-test pool adaptor:arrow_pool_ = GetArrowPool(pool_);(src/paimon/format/parquet/variant_parquet_test.cpp). It is destroyed together with the fixture.- Several tests (
WriteAndReadRoundTrip,ShreddedWriteAndReadRoundTrip, and the helper around line 548) open the file for a raw sanity check with the plain Arrow reader:
Only the rawauto file = arrow::io::ReadableFile::Open(file_path_, arrow_pool_.get()); ::parquet::arrow::OpenFile(file.ValueOrDie(), arrow_pool_.get(), &raw_reader);arrow::MemoryPool*is passed, so nothing keeps the adaptor alive. - With Arrow 17,
ArrowReaderProperties::pre_buffer()defaults totrue, soReadTableissuesRandomAccessFile::ReadAsync.ReadableFiledoes not override it, so the base implementation submitsReadAtto the IO thread pool and the resultPoolBufferis allocated fromarrow_pool_. - The IO worker holds the last reference to the future (and therefore the buffer) until its task object is destroyed, which can happen after the reader has consumed the data and the test has finished. When the fixture is torn down first,
~PoolBuffer()callsFree()on the already destroyed adaptor -> SIGSEGV.
Paimon's own read path (ArrowInputStreamAdapter::ReadAsync) is not affected: it uses a callback-based implementation and already retains the pool with the returned buffer (#182). This issue is limited to tests that use arrow::io::ReadableFile with a raw pointer to a short-lived pool.
Anything else?
Possible fixes (test-only):
- Use a process-lifetime Arrow pool for these raw sanity-check readers, e.g.
arrow::default_memory_pool(), instead of the per-fixturearrow_pool_.get(); or - Disable pre-buffering for the raw reader (
ArrowReaderProperties::set_pre_buffer(false)), so no async IO task outlives the test; or - Read through
ArrowInputStreamAdapter, which keeps the pool alive for returned buffers.
Other tests using arrow::io::ReadableFile::Open(..., pool.get()) with a per-test pool may have the same latent issue and should be checked as well.
- Vorherrschende Sprache
- C++
- Sterne
- 65
- Forks
- 29
- Ø Merge
- 2 T. 5 Std.
- Gemergte PRs (30 T.)
- 77
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/paimon-cpp
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
apache/paimon-cpp#389 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature] dictionary encoded binary supportEvtl. vergeben @zhangweilst hat das vor 5 Tagen übernommen. Offenenhancement
apache/paimon-cpp#381 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature] Bypass manifest lists on exact snapshot live-entry cache hitsEvtl. vergeben @wangyong9999 hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
apache/paimon-cpp#375 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature] Support vector and full-text search in File IndexEvtl. vergeben @zjw1111 hat das vor 5 Tagen übernommen. Offenenhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
apache/paimon-cpp#361 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature] Support 64-bit deletion vectors in Paimon C++Evtl. vergeben @lszskye hat das vor 5 Tagen übernommen. Offenenhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
apache/paimon-cpp#325 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/paimon-cpp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
KhronosGroup/Vulkan-Tutorial#524 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microsoft/onnxruntime-genai#2633 ·
Maintainer antworten meist innerhalb von 1 Tag
-
mapper bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
firebase/firebase-ios-sdk#16718 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
tesseract-ocr/tesseract#4627 ·