From 501fa3bad30d3ae0ca4df43b852c21ec27472302 Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Tue, 27 Apr 2021 11:29:00 +0200 Subject: [PATCH] ref: Disable Async Stacktraces Due to some problems with arm64 devices, we disable this feature until we find out how to fix them. We don't want this feature to block 7.0.0 GA. The plan is to add a flag to SentryOptions for enabling and disabling this feature in the future, see #1086. --- CHANGELOG.md | 4 ++++ Sources/Sentry/SentryCrashIntegration.m | 3 ++- Sources/SentryCrash/Recording/Tools/SentryHook.c | 11 +++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09686472e2..ac8c0fc394 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- ref: Disable Async Stacktraces (#1087) + ## 7.0.0-beta.1 ### Features and Fixes diff --git a/Sources/Sentry/SentryCrashIntegration.m b/Sources/Sentry/SentryCrashIntegration.m index 16a8e7176d..fb31e8b32d 100644 --- a/Sources/Sentry/SentryCrashIntegration.m +++ b/Sources/Sentry/SentryCrashIntegration.m @@ -74,7 +74,8 @@ - (void)installWithOptions:(nonnull SentryOptions *)options outOfMemoryLogic:logic]; [self startCrashHandler]; - sentrycrash_install_async_hooks(); + // TODO: enable with feature flag from SentryOptions because this is still experimental + // sentrycrash_install_async_hooks(); [self configureScope]; } diff --git a/Sources/SentryCrash/Recording/Tools/SentryHook.c b/Sources/SentryCrash/Recording/Tools/SentryHook.c index 1c5c14dc59..e841f4a088 100644 --- a/Sources/SentryCrash/Recording/Tools/SentryHook.c +++ b/Sources/SentryCrash/Recording/Tools/SentryHook.c @@ -25,11 +25,14 @@ static pthread_key_t async_caller_key = 0; sentrycrash_async_backtrace_t * sentrycrash_get_async_caller_for_thread(SentryCrashThread thread) { - const pthread_t pthread = pthread_from_mach_thread_np((thread_t)thread); - void **tsd_slots = (void *)((uint8_t *)pthread + TSD_OFFSET); + return NULL; - return (sentrycrash_async_backtrace_t *)__atomic_load_n( - &tsd_slots[async_caller_key], __ATOMIC_SEQ_CST); + // TODO: Disabled because still experimental. + // const pthread_t pthread = pthread_from_mach_thread_np((thread_t)thread); + // void **tsd_slots = (void *)((uint8_t *)pthread + TSD_OFFSET); + // + // return (sentrycrash_async_backtrace_t *)__atomic_load_n( + // &tsd_slots[async_caller_key], __ATOMIC_SEQ_CST); } void