Skip to content

Commit

Permalink
utils: fix container-overflow in tracking allocator
Browse files Browse the repository at this point in the history
=================================================================
==524==ERROR: AddressSanitizer: container-overflow on address 0x52100028a100 at pc 0x7f29c0bf51fd bp 0x7ffda75397d0 sp 0x7ffda75397c8
READ of size 4 at 0x52100028a100 thread T0
    #0 0x7f29c0bf51fc in util::mem_tracker::pretty_print_ascii() const /var/lib/buildkite-agent/builds/buildkite-amd64-builders-i-024f8676eb7b139e9-1/redpanda/vtools/src/v/utils/tracking_allocator.cc:75:31
    redpanda-data#1 0x55be1ac7eb7b in mem_tracker_pretty_printing::test_method() /var/lib/buildkite-agent/builds/buildkite-amd64-builders-i-024f8676eb7b139e9-1/redpanda/vtools/src/v/utils/tests/tracking_allocator_tests.cc:82:5
    redpanda-data#2 0x55be1ac7d651 in mem_tracker_pretty_printing_invoker() /var/lib/buildkite-agent/builds/buildkite-amd64-builders-i-024f8676eb7b139e9-1/redpanda/vtools/src/v/utils/tests/tracking_allocator_tests.cc:50:1

Signed-off-by: Noah Watkins <[email protected]>
  • Loading branch information
dotnwat committed Sep 26, 2024
1 parent 6f6c2cb commit 71c352c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/v/utils/tracking_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ ss::sstring mem_tracker::pretty_print_ascii() const {
// rooted at the current tracker to avoid an O(n^2) loop.
result << pretty_print_ascii_level(
top.first, tracker._label, tracker._consumption);
stack.pop();
auto next_level = top.first + 1;
stack.pop();
for (const auto& child : tracker._children) {
stack.push(std::pair(next_level, std::cref(child)));
}
Expand Down

0 comments on commit 71c352c

Please sign in to comment.