mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #21150] macOS: Temporary workaround at unwinding coroutine
On arm64 macOS, libunwind (both of system library and homebrew llvm-18) seems not to handle our coroutine switching code.
This commit is contained in:
parent
d97884a58b
commit
1bc57b5e0e
Notes:
git
2025-02-21 10:17:54 +00:00
3 changed files with 20 additions and 1 deletions
12
vm_dump.c
12
vm_dump.c
|
@ -510,6 +510,15 @@ rb_vmdebug_thread_dump_state(FILE *errout, VALUE self)
|
|||
# include <libunwind.h>
|
||||
# include <sys/mman.h>
|
||||
# undef backtrace
|
||||
|
||||
static bool
|
||||
is_coroutine_start(unw_word_t ip)
|
||||
{
|
||||
struct coroutine_context;
|
||||
extern void ruby_coroutine_start(struct coroutine_context *, struct coroutine_context *);
|
||||
return ((void *)(ip) == (void *)ruby_coroutine_start);
|
||||
}
|
||||
|
||||
int
|
||||
backtrace(void **trace, int size)
|
||||
{
|
||||
|
@ -617,6 +626,9 @@ darwin_sigtramp:
|
|||
// I wish I could use "ptrauth_strip()" but I get an error:
|
||||
// "this target does not support pointer authentication"
|
||||
trace[n++] = (void *)(ip & 0x7fffffffffffull);
|
||||
|
||||
// Apple's libunwind can't handle our coroutine switching code
|
||||
if (is_coroutine_start(ip)) break;
|
||||
}
|
||||
return n;
|
||||
# endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue