Fix backtrace beyond _singtramp on macOS arm64 (#7015)

* move ptrauth_strip logic into vm_dump.c
* don't use _sigtramp special logic on arm64
This commit is contained in:
NARUSE, Yui 2022-12-24 02:24:55 +09:00 committed by GitHub
parent 1876cda972
commit ee60756495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-12-23 17:25:14 +00:00
Merged-By: nurse <naruse@airemix.jp>
2 changed files with 17 additions and 11 deletions

View file

@ -2549,15 +2549,6 @@ rb_dump_backtrace_with_lines(int num_traces, void **traces)
/* 2 is NULL + main executable */
void **dladdr_fbases = (void **)calloc(num_traces+2, sizeof(void *));
#if defined(__APPLE__) && defined(__aarch64__)
// Strip Arm64's pointer authentication.
for (i = 0; i < num_traces; i++) {
// I wish I could use "ptrauth_strip()" but I get an error:
// "this target does not support pointer authentication"
traces[i] = (void*)(((uint64_t)traces[i]) & 0x7fffffffffffull);
}
#endif
#ifdef HAVE_MAIN_EXE_PATH
char *main_path = NULL; /* used on printing backtrace */
ssize_t len;