Skip to content

[VL] Allocate VarChar sub-messages on protobuf arena in VeloxToSubstraitExpr#11636

Merged
rui-mo merged 2 commits intoapache:mainfrom
acvictor:acvictor/fixProtobufMemLeak
Mar 9, 2026
Merged

[VL] Allocate VarChar sub-messages on protobuf arena in VeloxToSubstraitExpr#11636
rui-mo merged 2 commits intoapache:mainfrom
acvictor:acvictor/fixProtobufMemLeak

Conversation

@acvictor
Copy link
Contributor

What changes are proposed in this pull request?

This PR replaces new allocation of VarChar sub-messages with Arena::CreateMessage to match the arena-allocated parent in VeloxToSubstraitExpr.cc. When a protobuf message is arena-allocated, its destructor never runs so children attached via set_allocated_* that were heap-allocated with new are never deleted. Every other sub-message in this file already uses
Arena::CreateMessage correctly and VarChar was the only exception.

How was this patch tested?

Existing UTs

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the VELOX label Feb 20, 2026
@acvictor acvictor marked this pull request as ready for review February 28, 2026 11:41
@acvictor
Copy link
Contributor Author

@rui-mo can you please review this PR? Thanks in advance!

Copy link
Contributor

@jinchengchenghh jinchengchenghh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@acvictor
Copy link
Contributor Author

acvictor commented Mar 9, 2026

@rui-mo thanks for the review and approvals! Please let me know if there’s anything else needed from my side.

@rui-mo rui-mo merged commit fd5fbbb into apache:main Mar 9, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants