summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-04-05 10:29:58 +0900
committerNobuyoshi Nakada <[email protected]>2025-04-05 10:31:20 +0900
commit229784d160452dcdaa85ae4b5c5fae5c2728324b (patch)
tree2da9f3253f07a5ffa4488bf4a5b2d94f6e10a3ae
parent085cc6e43473f2a3c81311a07c1fc8efa46c118b (diff)
[Bug #21150] macOS: unwinding coroutine workaround is only for arm64
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13072
-rw-r--r--vm_dump.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 7bfa7c1d7a..1e4fe976f9 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -511,6 +511,7 @@ rb_vmdebug_thread_dump_state(FILE *errout, VALUE self)
# include <sys/mman.h>
# undef backtrace
+# if defined(__arm64__)
static bool
is_coroutine_start(unw_word_t ip)
{
@@ -518,6 +519,7 @@ is_coroutine_start(unw_word_t ip)
extern void ruby_coroutine_start(struct coroutine_context *, struct coroutine_context *);
return ((void *)(ip) == (void *)ruby_coroutine_start);
}
+# endif
int
backtrace(void **trace, int size)
@@ -614,7 +616,7 @@ darwin_sigtramp:
}
return n;
-# else /* defined(__arm64__) */
+# elif defined(__arm64__)
/* Since Darwin arm64's _sigtramp is implemented as normal function,
* unwind can unwind frames without special code.
* https://github.com/apple/darwin-libplatform/blob/215b09856ab5765b7462a91be7076183076600df/src/setjmp/generic/sigtramp.c
@@ -631,6 +633,8 @@ darwin_sigtramp:
if (is_coroutine_start(ip)) break;
}
return n;
+# else
+# error unsupported architecture
# endif
}
# elif defined(BROKEN_BACKTRACE)