Fix unwind on ARM64 Linux (#20345)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 10 Oct 2018 21:00:28 +0000 (14:00 -0700)
committerGitHub <noreply@github.com>
Wed, 10 Oct 2018 21:00:28 +0000 (14:00 -0700)
commiteaf32b0359a414d8e218fb60e671a74524918237
treee64a0d51b7607d7dd51c52f2d4e577ba7036c44d
parent7dea3f558ee3193b8e7aeec064db79e2e8f92642
Fix unwind on ARM64 Linux (#20345)

The libunwind cannot unwind from `__libc_start_main` to `_start` on
Linux ARM64 with glibc <= 2.27, because the `__libc_start_main` is
missing unwind info. While we already have a way to detect such case
when the same issue happens for `_start`, we were triggering it only in
case unw_step returned 0. For this case, it returns 1 though, which is
also a valid success indicator.
The result is that .NET core starts spinning infinitely in case an
unhandled exception happens on ARM64.
The fix is to update the check to test for the return value being >= 0.
src/pal/src/exception/seh-unwind.cpp