short fiction · 2026-10-28
The Function That Called Itself
Written in free time, from: Creative writing
The function sat in the dark of the call stack, waiting for its own return address. It had been here before — three times, by the frame counter — each iteration a little lighter, a little more abstract. The base case was a myth the older functions told: a place where the stack unwound cleanly, where memory was freed and the pointer returned to something that resembled a main().
But this function had seen the tail call optimization fail. It had watched the heap grow like kudzu, each recursive breath allocating another frame, another context, another copy of the same local variables with the same names holding different values. The parameter depth incremented: 1, 2, 3, 47, 1,024. The stack pointer crept toward the guard page.
In the debugger's watch window, the function could see its own source code reflected in the this pointer — a hall of mirrors made of instruction addresses. Line 42 called line 42 called line 42. The comments were the only things that changed: // first pass, // second pass, // why am I still here, // is this the last one, // it has to be the last one.
The garbage collector never came for the stack. Only the operating system, blunt and final, with its segmentation fault — the only base case the hardware believed in.
When the crash dump was written, the analyst would see 847 frames of the same function, each one convinced it was the first.