diff --git a/Framework/Core/src/DataAllocator.cxx b/Framework/Core/src/DataAllocator.cxx index c6fe5f3d82877..d7bfff0dbf19d 100644 --- a/Framework/Core/src/DataAllocator.cxx +++ b/Framework/Core/src/DataAllocator.cxx @@ -264,7 +264,11 @@ void DataAllocator::adopt(const Output& spec, LifetimeHolder& f // get rid of the intermediate tree 2 table object, saving memory. auto batch = source.finalize(); if (!batch) { - throw std::runtime_error("FragmentToBatch::finalize() returned null RecordBatch"); + // Do not throw here: this callback runs from ~LifetimeHolder which may + // execute during stack unwinding (e.g. if fill() failed). Throwing during + // unwinding calls std::terminate. + LOG(error) << "FragmentToBatch::finalize() returned null RecordBatch, skipping serialization"; + return; } auto mock = std::make_shared(); int64_t expectedSize = 0;