Skip to content

Fix crash when serializing RowVectors with null children#15712

Closed
avinaashgupta wants to merge 1 commit intomainfrom
export-D88493291
Closed

Fix crash when serializing RowVectors with null children#15712
avinaashgupta wants to merge 1 commit intomainfrom
export-D88493291

Conversation

@avinaashgupta
Copy link
Copy Markdown
Contributor

Summary:
The batch serializer introduced in D87873415 crashes when serializing RowVectors with null children. Null children can exists in RowVector, but the Presto wire format does not support them. This diff fixes the crash by recursively materializing null children as null constant vectors before serialization.

The issue was reported by a team (stack trace in P2067237549) where nested RowVectors with nullptr children caused a SIGSEGV in VectorStream::flush().

This fix:

  • Adds materializeNullChildrenRecursive() helper that recursively traverses RowVectors and replaces nullptr children with BaseVector::createNullConstant()
  • Updates rowVectorToIOBuf() to call materialization before serialization
  • Handles null children at all nesting levels
  • Maintains compatibility with Presto deserialization

Differential Revision: D88493291

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 5, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 1c518b3
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/693324e419b2ee0008ebb747

@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 Dec 5, 2025
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Dec 5, 2025

@avinaashgupta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88493291.

Summary:

The batch serializer introduced in D87873415 crashes when serializing RowVectors with null children. Null children can exists in RowVector, but the Presto wire format does not support them. This diff fixes the crash by recursively materializing null children as null constant vectors before serialization.

The issue was reported by a team (stack trace in P2067237549) where nested RowVectors with nullptr children caused a SIGSEGV in VectorStream::flush().

This fix:
- Adds materializeNullChildrenRecursive() helper that recursively traverses RowVectors and replaces nullptr children with BaseVector::createNullConstant()
- Updates rowVectorToIOBuf() to call materialization before serialization
- Handles null children at all nesting levels
- Maintains compatibility with Presto deserialization

Differential Revision: D88493291
@stale
Copy link
Copy Markdown

stale bot commented Mar 5, 2026

This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the PR, make sure you've addressed reviewer comments, and rebase on the latest main. Thank you for your contributions!

@stale stale bot added the stale label Mar 5, 2026
@stale stale bot closed this Mar 20, 2026
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. fb-exported meta-exported stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant