[Tarantool-patches] [PATCH luajit 4/5] OSX: Disable unreliable assertion for external frame unwinding.

Maxim Kokryashkin max.kokryashkin at gmail.com
Wed Feb 15 01:30:26 MSK 2023


From: Mike Pall <mike>

(cherry-picked from commit be251d9149b386ca0d4b51106be14366c5dbdf14)

`_Unwind_Find_FDE()` will locate the FDE if the pc is in some
function that has an associated FDE. Note, Mac OS X 10.6 and
later, introduces "compact unwind info" which the runtime uses in
preference to DWARF unwind info. This function will only work if
the target function has an FDE but no compact unwind info.

Maxim Kokryashkin:
* added the description for the problem

Part of tarantool/tarantool#7745
---
 src/lj_err.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lj_err.c b/src/lj_err.c
index f6200233..975b5621 100644
--- a/src/lj_err.c
+++ b/src/lj_err.c
@@ -479,6 +479,8 @@ extern const void *_Unwind_Find_FDE(void *pc, struct dwarf_eh_bases *bases);
 /* Verify that external error handling actually has a chance to work. */
 void lj_err_verify(void)
 {
+#if !LJ_TARGET_OSX
+  /* Check disabled on MacOS due to brilliant software engineering at Apple. */
   struct dwarf_eh_bases ehb;
   /*
   ** FIXME: The following assertions were replaced with
@@ -488,6 +490,7 @@ void lj_err_verify(void)
   ** lj_assertX(_Unwind_Find_FDE((void *)_Unwind_RaiseException, &ehb), "broken build: external frame unwinding enabled, but system libraries have no unwind tables");
   */
   lua_assert(_Unwind_Find_FDE((void *)lj_err_throw, &ehb));
+#endif
   /* Check disabled, because of broken Fedora/ARM64. See #722.
   lua_assert(_Unwind_Find_FDE((void *)_Unwind_RaiseException, &ehb));
   */
-- 
2.39.0



More information about the Tarantool-patches mailing list