[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] cfi execution issue
From: |
Dave Watson |
Subject: |
Re: [Libunwind-devel] cfi execution issue |
Date: |
Mon, 30 Oct 2017 10:49:37 -0700 |
User-agent: |
Mutt/1.6.0 (2016-04-01) |
On 10/27/17 10:14 AM, Yichao Yu wrote:
> Hi,
>
> I've hit some issue trying to unwind a clang compiled program with fpo
> enabled on x86. I've found a fix that I would have cleaned up and
> submitted a pull request if not because I'm partially confused by the
> comment there.
>
> The issue is very similar to the one worked around in
> https://github.com/libunwind/libunwind/commit/3d9a694de85f2ba10368b4fbc2aff1c6b8b76f58
> and happens to me when there's a cfi right after the call instruction
> of a noreturn function. GCC usually emits a `restore_state` in that
> case which is what the above patch works around. However, that is
> definately not mandated and clang actually emits normal
> `def_cfi_offset`s which cause libunwind to mess up badly....
Thanks, will review the pull request when I get a chance.
Yea, I was sure there were other cases besides restore_state where we
needed to not apply the CFI, but it seemed to break the tests and I
didn't find the root cause, looks like you might have!