[PATCH] D126343: [libunwind] Use process_vm_readv to avoid potential segfaults

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 13:09:41 PDT 2022


smeenai added inline comments.


================
Comment at: libunwind/test/bad_unwind_info.pass.cpp:70
+
+void bad_unwind_info();
+}
----------------
smeenai wrote:
> smeenai wrote:
> > MaskRay wrote:
> > > Use `__attribute__((naked))` with basic asm (https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html), then get rid of the inline assembly language at file scope.
> > I wanted to do this originally, but GCC doesn't support `__attribute__((naked))` on aarch64: https://godbolt.org/z/15rbv6GEG. I'm not sure if we need to support gcc in the test suite, but I thought at least libc++ tried to.
> That being said, it looks like GCC isn't performing any stack manipulation in this case anyway, just adding a nop and a ret, which should be harmless. Not sure if we can rely on that in general though.
I ended up just unsupporting the test on gcc, because `__attribute__((naked))` makes it much cleaner. Thanks for the suggestion :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126343



More information about the llvm-commits mailing list