Closed
Description
I have unw_backtrace() on x86-64 machine always returning addresses that are off by one relative to the instruction address after the call. This issue is related to fast backtrace optimization and I guess it may be caused by not restoring rip after decrementing it by use_prev_instr flag. Indeed, in src/x86_64/Gtrace.c we have:
line 438: rip -= d->use_prev_instr;
and before finishing the loop iteration:
line 543: buffer[depth++] = (void *) (rip - d->use_prev_instr);
I see no place where rip gets incremented again in this loop, so at least for standard frames we definitely write to the buffer the wrong value.
There is no problem if I manually unwind the stack using unw_step().
Metadata
Metadata
Assignees
Labels
No labels