Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io.sentry.android.replay.screenshotrecorder.close android SIGSEGV crash #4228

Open
leesoyeon93 opened this issue Mar 5, 2025 · 5 comments
Open

Comments

@leesoyeon93
Copy link

leesoyeon93 commented Mar 5, 2025

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:

  1. sentry install
yarn add @sentry/react-native
  1. 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

Image

Image

[base.apk] io.sentry.android.replay.ScreenshotRecorder.close (SIGSEGV)

i cant slove this issue.

@markushi
Copy link
Member

markushi commented Mar 5, 2025

@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?

@leesoyeon93
Copy link
Author

leesoyeon93 commented Mar 5, 2025

@markushi
It seems to be occurring from Android OS 12 and above.

The following errors are reported in Firebase Crashlytics

Image

          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)

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Mar 5, 2025
@kahest kahest moved this from Needs Discussion to In Investigation in Mobile & Cross Platform SDK Mar 5, 2025
@kahest kahest self-assigned this Mar 5, 2025
@kahest
Copy link
Member

kahest commented Mar 5, 2025

@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 [email protected]

Internal note: I didn't find matches in our internal monitoring tooling.

@kahest kahest removed their assignment Mar 5, 2025
@leesoyeon93
Copy link
Author

leesoyeon93 commented Mar 6, 2025 via email

@kahest
Copy link
Member

kahest commented Mar 6, 2025

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: In Investigation
Development

No branches or pull requests

3 participants