[PATCH] D114818: [libunwind] Fix unwind_leaffunction test

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 02:02:05 PST 2021


danielkiss accepted this revision.
danielkiss added a comment.

In D114818#3162689 <https://reviews.llvm.org/D114818#3162689>, @ldionne wrote:

> Do we need to apply `__attribute__((noinline))` to `main`? Can you try that out and let me know if that helps?

Clang automatically adds noinline to main.

In D114818#3162675 <https://reviews.llvm.org/D114818#3162675>, @vvereschaka wrote:

> Hi @ldionne, @leonardchan
>
> I ran these changes on Linux (Ubuntu 18.04)/Aarch64 board. The test gets failed because of missed 'main':
>
>   ubuntu at jetson8:/tmp$ ./t.tmp.exe 
>   info.dli_sname: _Z14signal_handleri
>   info.dli_sname: __kernel_rt_sigreturn
>   info.dli_sname: _Z18crashing_leaf_funcv
>   info.dli_sname: __libc_start_main

Interesting it works on Ubuntu20.04/Aarch64, I compile the code with ToT clang or gcc-10.
could you share an objdump of main?

>   void func() {
>    crashing_leaf_func();
>   }
>
> Then the test passes, but it looks like unwinder skips past func (it jumps from _Z18crashing_leaf_funcv to main). Perhaps all this hints at an underlying issue in libunwind?

here `func` will tail call `crashing_leaf_func` so it is expected to not be visible during the unwind because the return address will point to somewhere in main.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114818/new/

https://reviews.llvm.org/D114818



More information about the llvm-commits mailing list