Skip to content

benchmarks: prevent repeated heap batch cleanup - #99

Open
edsiper wants to merge 2 commits into
masterfrom
fix/records-batch-cleanup
Open

edsiper wants to merge 2 commits into
masterfrom
fix/records-batch-cleanup

Conversation

@edsiper

@edsiper edsiper commented Oct 22, 2026

Copy link
Copy Markdown
Member

A successful heap benchmark batch left freed pointers in roots. If a later batch failed before replacing every entry, cleanup could destroy those pointers again. Clear each entry after destruction and add a regression test that injects failure at the first, middle, and last record of a later batch.

Clarify that the large-object threshold applies only to arena-aware owned SDS payloads larger than 1 KiB. Payloads up to and including 1 KiB use pooled size classes regardless of the threshold; the existing size-class and cfl_sds_alloc() capacity descriptions are preserved.

Validation:

  • BUILD_DIR=/tmp/cfl-feedback-verify scripts/agent-verify.sh: all 35 tests passed; whitespace checks passed.
  • valgrind --quiet --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 /tmp/cfl-feedback-verify/tests/cfl-test-benchmark_records: passed without errors or leaks.
  • The same regression test against a temporary copy of the original benchmark reproduced a use-after-free under Valgrind.
  • Heap and arena benchmark smoke checks passed with 8 3 owned 1.

Only benchmark behavior, its test registration, and documentation change. No library implementation, API, ABI, or allocator behavior changes; consumers do not need an upgrade for this fix. Cross-platform and downstream checks were not run locally and remain CI coverage.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper
edsiper force-pushed the fix/records-batch-cleanup branch from 4a146a0 to 270c8b1 Compare October 22, 2026 17:25
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