From 58643dab07a803dbb579d84f68419911f5a2a16d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 23:04:17 -0300 Subject: trace: glibc's heap, read from a recording at any moment record --heap keeps the arena, the tcache and, of every chunk, its size word and the links of those on a list: free chunks stay readable, which --alloc dropped at the free. zt.heap.glibc gives the chunks in address order, the tcache's and the bins' chains (safe-linking as the stored value and the pointer it protects), the top; each with the address of the word it was read from, each chain saying how it ended. ztrace show prints it. Layouts for glibc 2.44 (no fastbins; a tcache made at the first free, counting the slots left) and 2.40; the arena found by symbol or by the struct whose next points at itself. Against pwndbg on 2.40: the same at every stop. Three bytes a moment and a sixth slower on the list by instruction. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- build.zig | 1 + 1 file changed, 1 insertion(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 82d4c46..e8856d9 100644 --- a/build.zig +++ b/build.zig @@ -95,6 +95,7 @@ pub fn build(b: *std.Build) void { // Each area adds its own artifacts, targets and test step. @import("build/debugger.zig").add(ctx); + @import("build/heap.zig").add(ctx); const agent = @import("build/agent.zig").add(ctx); const instrumented_list = @import("build/llvm.zig").add(ctx); -- cgit v1.3