Skip to content

Fix remaining C++ memory leak paths - #881

Merged
ColinLeeo merged 2 commits into
apache:developfrom
ColinLeeo:fix/cpp-memory-leak-followups
Jul 30, 2026
Merged

Fix remaining C++ memory leak paths#881
ColinLeeo merged 2 commits into
apache:developfrom
ColinLeeo:fix/cpp-memory-leak-followups

Conversation

@ColinLeeo

Copy link
Copy Markdown
Contributor

Summary

  • preserve the original allocation when mem_realloc fails in containers, tablets, and chunk readers
  • release reader and compressor buffers on early error paths, and clear cached LZO ownership after caller release
  • free aligned value buffers during reset and keep wrapped stream pointers synchronized after realloc
  • add deterministic realloc-failure injection and regression coverage for every repaired ownership path

This is a follow-up to #879.

Testing

  • ./mvnw spotless:check -P with-cpp
  • CMake Debug build of TsFile_Test
  • targeted allocation-failure tests: 10 passed
  • complete C++ test suite: 731 passed, 10 disabled
  • Release tsfile library build with BUILD_TEST=OFF

@ColinLeeo
ColinLeeo merged commit 46cf0a1 into apache:develop Jul 30, 2026
29 checks passed
@ColinLeeo
ColinLeeo deleted the fix/cpp-memory-leak-followups branch July 30, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant