This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Invalid program counters and unwinding
On 06/26/2018, Jakub Jelinek wrote:
The usual ways to get bogus PCs in the frames is:
1) stack corruption
2) setcontext/swapcontext with uninitialized or corrupted ucontext_t
3) bogus unwind info (compiler or linker etc. bug)
At least for unwinding, I think we don't and shouldn't care, we assume only
valid programs.
That assumption is not reliable in practice. About once per year I find
a totally bogus PC value while unwinding, such as:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66874
RFE: x86_64_fallback_frame_state more robust
https://sourceware.org/bugzilla/show_bug.cgi?id=18635
stdlib/tst-makecontext fails on ix86
At least *some* run-time effort should be made to protect against SIGSEGV
when a purported PC is 0, or otherwise obviously bogus.