[SR] io.sentry.android.replay.screenshotrecorder.close android SIGSEGV crash
Closed this issue · 6 comments
Integration
sentry-android
Build System
Gradle
AGP Version
8.0.1
Proguard
Enabled
Version
6.5.0
Steps to Reproduce
I introduced Sentry into my React Native project by setting up the following steps:
- sentry install
yarn add @sentry/react-native
- sentry init
import * as Sentry from '@sentry/react-native';
import { DEPLOY_MODE, SENTRY_DSN } from '~/config/constants';
useEffect(() => {
if (DEPLOY_MODE === 'prod' && SENTRY_DSN && sentryConfig.enableSentry) {
Sentry.init({
dsn: SENTRY_DSN,
tracesSampleRate: sentryConfig.tracesSampleRate ?? 0.1,
profilesSampleRate: sentryConfig.profilesSampleRate ?? 0.0,
replaysSessionSampleRate: sentryConfig.replaysSessionSampleRate ?? 0.0,
replaysOnErrorSampleRate: sentryConfig.replaysOnErrorSampleRate ?? 1.0,
enableAutoSessionTracking: sentryConfig.enableAutoSessionTracking ?? true,
sessionTrackingIntervalMillis:
sentryConfig.sessionTrackingIntervalMillis ?? 30000,
enableAutoPerformanceTracing: sentryConfig.enableAutoPerformanceTracing ?? true,
maxBreadcrumbs: sentryConfig.maxBreadcrumbs ?? 100,
integrations: [
Sentry.hermesProfilingIntegration({
platformProfilers: sentryConfig.platformProfilers ?? true,
}),
Sentry.mobileReplayIntegration({
maskAllImages: sentryConfig.maskAllImages ?? false,
maskAllText: sentryConfig.maskAllText ?? false,
maskAllVectors: sentryConfig.maskAllVectors ?? false,
}),
],
});
Sentry.setUser({
id: auth.user.id ?? '',
email: auth.user.email ?? '',
username: auth.user.nickname ?? '',
});
}
}, [sentryConfig, auth.user]);
sentryConfig is a JSON that manages individual values for Sentry settings.
That's it is is very simple process.
The message explains that increasing the ratio for Sentry's session replay functionality causes SIGSEGV errors on Android devices.
Initially, I set it as:
replaysSessionSampleRate: sentryConfig.replaysSessionSampleRate ?? 0.0,
replaysOnErrorSampleRate: sentryConfig.replaysOnErrorSampleRate ?? 1.0,
I set the replaysOnErrorSampleRate ratio to 1.0.
After that, abnormal terminations occurred on Android.
So I lowered the replaysOnErrorSampleRate ratio to 0.1, which significantly reduced the proportion of abnormal terminations, but errors are still being reported in the Google Play Console.
Expected Result
Increasing the replaysSessionSampleRate ratio on Android should not cause errors.
Actual Result
[base.apk] io.sentry.android.replay.ScreenshotRecorder.close (SIGSEGV)
i cant slove this issue.
@leesoyeon93 thanks for reporting! Could you share details about the SIGSEV you're seeing? Do you have a detailed stacktrace / do you know on which Android OS versions this is happening?
@markushi
It seems to be occurring from Android OS 12 and above.
The following errors are reported in Firebase Crashlytics
null pointer dereference: SIGSEGV 0x0000000000000060
#00 pc 0x5ffce4 libhwui.so (BuildId: 9b14ac9feac213e2887d23481dd16f03)
#01 pc 0x4d3aa4 libhwui.so (BuildId: 9b14ac9feac213e2887d23481dd16f03)
#02 pc 0x4d3aa4 libhwui.so (BuildId: 9b14ac9feac213e2887d23481dd16f03)
#03 pc 0x70e88adc
All show similar error reports of this type.
In the Google Play Console, the stack trace for Android app crashes and ANR is reported as follows
[base.apk] io.sentry.android.replay.ScreenshotRecorder.close
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 20736 >>> app.ttmikstories.android <<<
backtrace:
#00 pc 0x00000000005dd6ec /system/lib64/libhwui.so (SkColorInfo::operator=(SkColorInfo const&)+32)
#01 pc 0x00000000004b21c4 /system/lib64/libhwui.so (Bitmap_recycle(_JNIEnv*, _jobject*, long) (.__uniq.22137780384205925829283086506072032936)+28)
#02 pc 0x0000000000331adc /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+108)
#03 pc 0x00000000007da6cc /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.graphics.Bitmap.recycle+60)
#04 pc 0x0000000000781020 /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
#05 pc 0x00000000001c5bfc /data/app/~~v4S3L5rN6RdqL_Y1TtVWBw==/app.ttmikstories.android-iyz1ivWHW6hElblYOqUQmA==/base.apk (io.sentry.android.replay.ScreenshotRecorder.close+48)
#06 pc 0x0000000000780fc4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
#07 pc 0x00000000001c67d2 /data/app/~~v4S3L5rN6RdqL_Y1TtVWBw==/app.ttmikstories.android-iyz1ivWHW6hElblYOqUQmA==/base.apk (io.sentry.android.replay.WindowRecorder.stop+98)
#08 pc 0x0000000000781de4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
#09 pc 0x00000000001c4150 /data/app/~~v4S3L5rN6RdqL_Y1TtVWBw==/app.ttmikstories.android-iyz1ivWHW6hElblYOqUQmA==/base.apk (io.sentry.android.replay.ReplayIntegration.stop+48)
#10 pc 0x0000000000781de4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
#11 pc 0x00000000001b3dce /data/app/~~v4S3L5rN6RdqL_Y1TtVWBw==/app.ttmikstories.android-iyz1ivWHW6hElblYOqUQmA==/base.apk (io.sentry.android.core.LifecycleWatcher$1.run+62)
#12 pc 0x00000000004e09a0 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.util.TimerThread.mainLoop+624)
#13 pc 0x00000000004e0a50 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.util.TimerThread.run+48)
#14 pc 0x0000000000368774 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#15 pc 0x0000000000353f04 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+132)
#16 pc 0x0000000000947a48 /apex/com.android.art/lib64/libart.so (art::detail::ShortyTraits<(char)86>::Type art::ArtMethod::InvokeInstance<(char)86>(art::Thread*, art::ObjPtr<art::mirror::Object>, art::detail::ShortyTraits<>::Type...)+60)
#17 pc 0x000000000061afcc /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1344)
#18 pc 0x000000000061aa7c /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8)
#19 pc 0x00000000000f85d8 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
#20 pc 0x00000000000950f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
@leesoyeon93 which version of React Native are you using? Also do you use sentry.io and do you see the crashes and ANRs there? If yes, please provide a link here or via email to karl.struggl@sentry.io
Internal note: I didn't find matches in our internal monitoring tooling.
@leesoyeon93 thank you for the link - we understand the problem and are looking into it.
for our investigation: event data indicates RN version 0.72.14
hi @leesoyeon93 version 6.10.0 of the RN SDK has been released which includes this fix. Could you try it out and let us know if you're still seeing an increase in crashes on Google Play? Thanks!


