Skip to content

fix: Spark cast benchmark shutdown crash - #18624

Open
rui-mo wants to merge 1 commit into
facebookincubator:mainfrom
rui-mo:wip_cast_benchmark
Open

fix: Spark cast benchmark shutdown crash#18624
rui-mo wants to merge 1 commit into
facebookincubator:mainfrom
rui-mo:wip_cast_benchmark

Conversation

@rui-mo

@rui-mo rui-mo commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

The timestamp cast benchmarks captured owning Velox objects in
folly::addBenchmark. Since Folly stores benchmark registrations globally,
these objects could be destroyed after the local pool/context, causing a
shutdown crash in AlignedBuffer::freeToPool().

This PR keeps ownership in main() and makes the registered lambda capture
only non-owning pointers, so Velox objects are destroyed while their
pool/context are still valid.

Stack trace:

EXC_BAD_ACCESS (code=1, address=0x80)

#0  facebook::velox::AlignedBuffer::freeToPool() + 40
#1  facebook::velox::FlatVector<facebook::velox::Timestamp>::~FlatVector() + 288
#2  facebook::velox::RowVector::~RowVector() + 164
#3  std::__1::__function::__func<... addTypedCastBenchmark(...)::$_0 ...>::~__func() + 140
#4  std::__1::function<folly::detail::TimeIterData(unsigned int)>::~function()
#8  folly::detail::BenchmarkRegistration::~BenchmarkRegistration()
#12 std::__1::vector<folly::detail::BenchmarkRegistration>::clear()
#17 folly::detail::BenchmarkingStateBase::~BenchmarkingStateBase()
#19 folly::detail::BenchmarkingState<std::chrono::steady_clock>::~BenchmarkingState()
#20 __cxa_finalize_ranges
#21 exit
#24 start

@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit cb4576f
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6a8880d16cb3ea00080f85e9

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2026
@github-actions

Copy link
Copy Markdown

Selective Build Plan

Linux release with adapters is running a selective build of 1 cmake targets (out of 622 total). See the CI workflows README for what this means.

Affected targets (1)

Directly changed (1)

Target Changed Files
velox_sparksql_benchmarks_cast CastBenchmark.cpp

Fast path • Graph from main@c2a52d02141d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant