[llvm-bugs] [Bug 47750] New: __register_frame should accept CIE as well as FDE

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 6 14:55:02 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47750

            Bug ID: 47750
           Summary: __register_frame should accept CIE as well as FDE
           Product: Runtime Libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: libunwind
          Assignee: unassignedbugs at nondot.org
          Reporter: nick at wasmer.io
                CC: llvm-bugs at lists.llvm.org

Related to bug 44074.

libgcc_s's __register_frame accepts a CIE as the argument and registers all the
FDEs inside it. I'm not convinced it even works if you give it an FDE, I tried
to call it with each FDE entry in my CIE but it appeared to be a no-op. It's
possible this is supposed to work, though I found the code in libgcc/ difficult
to follow. At least the comments talk about __register_frame's input pointer
being ".eh_frame" which would be a CIE, not an FDE.

libunwind's __register_frame only accepts FDEs and when given a CIE it emits a
warning and ignores the contents of the CIE.

Please accept CIEs in __register_frame by registering each FDE in the CIE
provided.

Alternatively stop providing an implementation of __register_frame because it
is incompatible with libgcc's and (unless I'm mistaken) impossible for callers
to satisfy the API requirements of both libunwind and libgcc.


If you'd like to see the CIE and its FDEs I was working with, here's the hex:

const char eh_frame[] = {0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0,
0x1, 0x78, 0x10, 0xc, 0x7, 0x8, 0x90, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c,
0x0, 0x0, 0x0, 0x1c, 0x0, 0x0, 0x0, 0x20, 0x70, 0x51, 0x45, 0xf5, 0x7f, 0x0,
0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x42, 0xe, 0x10, 0x86, 0x2, 0x43,
0xd, 0x6, 0x24, 0x0, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x70, 0x51, 0x45,
0xf5, 0x7f, 0x0, 0x0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x42, 0xe, 0x10,
0x86, 0x2, 0x43, 0xd, 0x6, 0x4f, 0xc, 0x7, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0};

(Side feature request, it'd be helpful if llvm-dwarfdump could parse a detached
eh_frame like this.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201006/d2c39d07/attachment.html>


More information about the llvm-bugs mailing list