[libcxx-commits] [PATCH] D123428: [libunwind] Add configuration to disable sigreturn frame check

Shoaib Meenai via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 11 15:56:56 PDT 2022

smeenai added a comment.

In D123428#3443648 <https://reviews.llvm.org/D123428#3443648>, @MaskRay wrote:

>> We're observing such segfaults internally (possibly due to invalid unwind info in libraries which are out of our control).
> It would be interesting to know whether Clang does anything wrong here. `@chill` is improving such stuff.
> (Without signal trampoline frame recognization, it could be bad for crash reporting: https://maskray.me/blog/2022-04-10-unwinding-through-signal-handler#glibc-aarch64 )

Unfortunately, we're only observing this crash on a small subset of devices in the wild, and I haven't had any luck reproducing it locally, so I can't say whether Clang is producing invalid debug info or there's some system libraries on those particular devices with issues.

Our crash reporting uses a different unwinding flow which won't be affected by the change here. This configuration will only affect the unwinding used for exceptions, and we're willing to try not being able to unwind through `sigreturn` frames for that scenario.

The "fix" (that's still subject to time-of-check-to-time-of-use issues) would be to see if memory is readable before accessing it, like nongnu libunwind does, but there were concerns raised in the original review about the system calls required not being accessible because of security configurations (https://reviews.llvm.org/D90898#2384775), plus the overhead of the checking. Do you have any ideas for that?

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list