logoalt Hacker News

dustbunny06/15/20252 repliesview on HN

Does a stack trace from a crash in a bound function show the line number of where the bind() took place?


Replies

delusional06/15/2025

Assuming the stack trace is generated by walking up the stack at the time when the crash happened, nothing that works like a C function pointer would ever do that. Assigning a a pointer to a memory location doesn't generate a stack frame, so there's no residual left in the stack that could be walked back.

A simple example. If you were to bind a function pointer in one stack frame, and the immediately return it to the parent stack frame which then invokes that bound pointer, the stack that bound the now called function would literally not exist anymore.

spacechild106/15/2025

No, but neither does the author's solution.