From c3d9f7ba5effd615374b1359ad98ecf801559f83 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 00:06:30 -0300 Subject: canim: a call followed down to the kernel; rows that say what they do; the heap from the inside From the user. The disassembly can descend: the syscalls scene is glibc's hello by instruction, and open is followed from main through its PLT stub, whose jmp reads the GOT, into libc's wrapper to the syscall row, which crosses to the kernel's window under it, and back up. The band keeps the calls so far as strace writes them. Operands lose their size words and show a width as byte cells only where nothing else says it. A compare shows its values and the flags it leaves, a jump the flags it reads, lea its result, an indirect jump its target and the slot it read, a call that has run its C form. The backtrace has its newest frame at the bottom. A new scene shows glibc 2.44's heap from blocks that exist: chunks read by fields (a size with its bits, a protected pointer), the free list as arcs, the tcache in a loupe, the program's list over malloc's own. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- anim/tools/chart.py | 4 +++- anim/tools/heap.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 anim/tools/heap.c (limited to 'anim/tools') diff --git a/anim/tools/chart.py b/anim/tools/chart.py index 4f58312..998e704 100644 --- a/anim/tools/chart.py +++ b/anim/tools/chart.py @@ -42,7 +42,9 @@ none, beside, subject = split(0, 0, 14, 17, 8, 4), split(152, 152, 8, 17, 8), sp motion.REGIONS.update({ "fib": {**subject, **words}, "sort": {**subject, **words}, - "syscalls": {**subject, **words}, + # The band is the calls so far; the disassembly a descent. + "syscalls": {**beside, **words}, + "heap": {**subject, **words}, "list": {**subject, **words}, # The band's drawing is the backtrace, then the kernel's side. "sqlite": {**subject, **words}, diff --git a/anim/tools/heap.c b/anim/tools/heap.c new file mode 100644 index 0000000..3c95f07 --- /dev/null +++ b/anim/tools/heap.c @@ -0,0 +1,31 @@ +#include + +typedef struct node { + long value; + struct node *next; +} node; + +node *head; + +void push(long value) { + node *n = malloc(sizeof *n); + n->value = value; + n->next = head; + head = n; +} + +void pop(void) { + node *n = head; + head = n->next; + free(n); +} + +int main(void) { + push(7); + push(12); + push(9); + pop(); + pop(); + push(25); + return 0; +} -- cgit v1.3