diff --git a/changelogs/unreleased/gh-8074-fix-backtraces-on-m1-macs.md b/changelogs/unreleased/gh-8074-fix-backtraces-on-m1-macs.md new file mode 100644 index 0000000000000000000000000000000000000000..ffc2ef39db07874fbe7805b79fc9b7fe101642d0 --- /dev/null +++ b/changelogs/unreleased/gh-8074-fix-backtraces-on-m1-macs.md @@ -0,0 +1,4 @@ +## bugfix/core + +* Fixed the collection of fiber backtraces on the M1/M2 macOS platform + (gh-8074). diff --git a/src/lib/core/backtrace.c b/src/lib/core/backtrace.c index 27e64532655edf35d47cf8421867b1d1b2f2f4a1..243e9450d4503d0fddb653ef46848a08b63cbee3 100644 --- a/src/lib/core/backtrace.c +++ b/src/lib/core/backtrace.c @@ -75,6 +75,13 @@ collect_current_stack(struct backtrace *bt, void *stack) "status: %d", rc); return stack; } +#ifdef __aarch64__ + /* + * Apple's libunwind for AArch64 returns the IP with the Pointer + * Authentication Codes (bits 47-63). Strip them out. + */ + ip &= 0x7fffffffffffull; +#endif /* __aarch64__ */ append_frame(bt, (void *)ip); rc = unw_step(&unw_cur); if (rc <= 0) { diff --git a/test/app-luatest/fiber_parent_backtrace_test.lua b/test/app-luatest/fiber_parent_backtrace_test.lua index 5a25f602ddd7687c515cee37db08bb4b5b562d59..a7d663f2a5389d94ef8e693b0921ebba545de769 100644 --- a/test/app-luatest/fiber_parent_backtrace_test.lua +++ b/test/app-luatest/fiber_parent_backtrace_test.lua @@ -4,8 +4,6 @@ local t = require('luatest') local g = t.group() g.before_all(function() - t.skip_if(jit.arch == 'arm64' and jit.os == 'OSX', - 'Disabled on macOS/M1 due to tarantool/tarantool-qa#309') g.dflt = server:new({alias = 'dflt'}) g.dflt:start() g.dflt:exec(function() diff --git a/test/app/fiber.skipcond b/test/app/fiber.skipcond index d62035b2b810a9f6fb3dc0e113c730fe0a823ed8..9c1ca22b178585ed8676bc74034a6e4e34222922 100644 --- a/test/app/fiber.skipcond +++ b/test/app/fiber.skipcond @@ -4,8 +4,4 @@ import platform if platform.system() == 'OpenBSD': self.skip = 1 -# Disabled on macOS/M1 due to fail tarantool/tarantool-qa#308. -if platform.machine() == 'arm64' and platform.system() == 'Darwin': - self.skip = 1 - # vim: set ft=python: