Hello all, I'm running into an issue when using libunwind, where it seems to be unable to unwind through a function that contains no stack variables. This is coming from JIT'd code (specifically, LLVM's MCJIT), and I haven't set up a _U_dyn_register hook yet, so libunwind is falling back on the call-frame, which is fine since so far I'm disabling frame-pointer elimination. The problem is that I've apparently generated my first function that contains no stack variables, which means that rsp=rbp and libunwind judges it to be an invalid rbp value and stops the unwind.
Here's a very simple patch that changes the heuristic to allow zero-length frames:
It fixes this particular problem for me, but I don't know if an rbp=rsp situation is more commonly an unwind failure. I'm planning on adding a _U_dyn_register hook which I assume is the better fix, but I was curious if this behavior is intentional.
kmod