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

Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6f276510 in tid 14600 (SentryAsyncConn) #3367

Open
lemon-li opened this issue Apr 17, 2024 · 10 comments
Assignees
Labels
Platform: Java Type: Bug Something isn't working

Comments

@lemon-li
Copy link

lemon-li commented Apr 17, 2024

Version

sentry-java: 6.10.0
sentry-unity: 1.8.0

Here are some relevant details:

  • Environment: Unity 2021.3.34
  • SDK Version: Upgraded from 6.10.0 to 7.1.0
  • Devices: Xiaomi and Huawei phones
  • OS: Android 10 and 11
  • Crash condition: During offline startup

I have encountered a problem in my Unity (version 2021.3.34) project that is causing Sentry to crash. The crash mostly occurs on Android 10 and 11, specifically on Xiaomi and Huawei phones during offline startup.

Although I have integrated the Unity SDK in my project, I am not making full use of Unity's own aar. Instead, I have assembled it at the native layer.

In an attempt to resolve this issue, I upgraded the Android SDK from 6.10.0 to 7.1.0. Unfortunately, the problem still persists after the upgrade.

Unity Sentry Options

public override void Configure(SentryUnityOptions options)
{
#if UNITY_EDITOR
        options.Enabled = false;
        return;
#else
        var parameters = Native.GetParameters<Parameters>();
#if UNITY_ANDROID
        options.AndroidNativeSupportEnabled = true;
        options.NdkIntegrationEnabled = true;
        options.NdkScopeSyncEnabled = true;
#elif UNITY_IOS
        options.IosNativeSupportEnabled = true;
#elif UNITY_STANDALONE
        options.WindowsNativeSupportEnabled = true;
#endif

        if (string.IsNullOrEmpty(parameters.dsn))
        {
        Log.E("The sentry dsn must be is not empty!");
        return;
        }
        options.Enabled = true;
        options.AttachScreenshot = false;
        options.AttachStacktrace = true;
        options.SendDefaultPii = true;
        options.Dsn = parameters.dsn;
        options.DisableUnityApplicationLoggingIntegration();
        options.DisableAnrIntegration();

#endif
}

Java Sentry Options

sentryAndroid.init(context, sentryLogger) { options ->
	......
	options.isEnableScopeSync = true

	options.isDebug = SentryConfiguration.debug
	options.cacheDirPath = context.cacheDir.absolutePath
	options.isSendDefaultPii = GlobalParameters.getSentryAndroidSendDefaultPiiEnabled()
}

Steps to Reproduce:

  1. Disconnect the device from the internet.
  2. Initialize Sentry in Android's Application.onCreate method.
  3. Start the application.

Expected Result

no crash

Actual Result

The application crashes during startup when the device is offline and Sentry is initialized in Android's Application.onCreate method. However, if the initialization of Sentry is performed after Unity Sentry starts, the application seems to work fine. Moreover, if the device is connected to the internet, the application starts normally regardless of when Sentry is initialized.

some logs

2535 14532 14600 F libc    : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6f276510 in tid 14600 (SentryAsyncConn), pid 14532 (tssoup.bilibili)
04-16 17:58:58.425  1000  1496  1663 I StatusBarDisable: setFlags what=0 which=1 pkg=Window{78bcf4b u0 com.kgame.catssoup.bilibili/com.seayoo.sdk.ComboSDKMainActivity}
04-16 17:58:58.515 12535 14720 14720 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-16 17:58:58.515 12535 14720 14720 F DEBUG   : Build fingerprint: 'HONOR/COR-AL00/HWCOR:9/HUAWEICOR-AL00/9.1.0.346C00:user/release-keys'
04-16 17:58:58.515 12535 14720 14720 F DEBUG   : Revision: '0'
04-16 17:58:58.515 12535 14720 14720 F DEBUG   : ABI: 'arm64'
04-16 17:58:58.516 12535 14720 14720 F DEBUG   : Happend: 'Tue Apr 16 17:58:58 2024
04-16 17:58:58.516 12535 14720 14720 F DEBUG   : '
04-16 17:58:58.516 12535 14720 14720 F DEBUG   : SYSVMTYPE: Maple
04-16 17:58:58.516 12535 14720 14720 F DEBUG   : APPVMTYPE: Art
04-16 17:58:58.516 12535 14720 14720 F DEBUG   : pid: 14532, tid: 14600, name: SentryAsyncConn  >>> com.kgame.catssoup.bilibili <<<
04-16 17:58:58.516 12535 14720 14720 F DEBUG   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6f276510
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x0  200000006f2da850  x1  0000000014471720  x2  0000000000000000  x3  0000000000000002
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x4  0000000000000002  x5  000000791d48cd02  x6  0000000000000000  x7  0000000000000000
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x8  000000000000000c  x9  000000009c5a1e40  x10 000000791d48cd05  x11 000000793d9fc430
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x12 000000793d9fc478  x13 000000793d9fc4c0  x14 000000793d9fc520  x15 0000000000000000
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x16 0000000000000000  x17 0000000000000000  x18 0000000000000000  x19 0000007933df2800
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x20 0000000000000001  x21 00000000148c9f88  x22 0000000000000002  x23 00000000148c9f70
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x24 0000000014471720  x25 0000000000000000  x26 0000000000000002  x27 0000000000000000
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     x28 0000000013bbf380  x29 00000000148c9f70
04-16 17:58:58.516 12535 14720 14720 F DEBUG   :     sp  0000007914c6e330  lr  000000009c5a569c  pc  000000006f276510








DEBUG   : 
04-16 17:58:58.665 12535 14720 14720 F DEBUG   : backtrace:
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #00 pc 0000000000066510  /data/dalvik-cache/arm64/system@framework@boot.art
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #01 pc 0000000000032698  /dev/ashmem/dalvik-jit-code-cache (deleted) (java.io.StringWriter.write+88)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #02 pc 000000000002ef8c  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.sentry.vendor.gson.stream.JsonWriter.string+332)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #03 pc 0000000000580588  /system/lib64/libart.so (art_quick_invoke_stub+584)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #04 pc 00000000000d8608  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #05 pc 000000000028cef8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #06 pc 0000000000286f00  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #07 pc 0000000000548ec8  /system/lib64/libart.so (MterpInvokeDirect+296)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #08 pc 0000000000572d14  /system/lib64/libart.so (ExecuteMterpImpl+14484)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #09 pc 0000000000511ab6  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.vendor.gson.stream.JsonWriter.value+26)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #10 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #11 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #12 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #13 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #14 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #15 pc 00000000004cba58  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value+4)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #16 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #17 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #18 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #19 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #20 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #21 pc 00000000004cbbc0  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #22 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #23 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #24 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #25 pc 0000000000548940  /system/lib64/libart.so (MterpInvokeInterface+944)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #26 pc 0000000000572e14  /system/lib64/libart.so (ExecuteMterpImpl+14740)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #27 pc 0000000000500676  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.protocol.Gpu.serialize+90)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #28 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #29 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #30 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #31 pc 0000000000548940  /system/lib64/libart.so (MterpInvokeInterface+944)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #32 pc 0000000000572e14  /system/lib64/libart.so (ExecuteMterpImpl+14740)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #33 pc 00000000004cb634  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectSerializer.serialize+196)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #34 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #35 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #36 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #37 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #38 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #39 pc 00000000004cba04  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value+4)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #40 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #41 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #42 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #43 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #44 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #45 pc 00000000004cbb6c  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #46 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #47 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #48 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #49 pc 0000000000548940  /system/lib64/libart.so (MterpInvokeInterface+944)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #50 pc 0000000000572e14  /system/lib64/libart.so (ExecuteMterpImpl+14740)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #51 pc 00000000004fd244  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.protocol.Contexts.serialize+80)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #52 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #53 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #54 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #55 pc 0000000000548940  /system/lib64/libart.so (MterpInvokeInterface+944)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #56 pc 0000000000572e14  /system/lib64/libart.so (ExecuteMterpImpl+14740)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #57 pc 00000000004cb634  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectSerializer.serialize+196)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #58 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #59 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #60 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #61 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #62 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #63 pc 00000000004cba04  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value+4)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #64 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #65 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #66 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #67 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #68 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #69 pc 00000000004cbb6c  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #70 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #71 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #72 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #73 pc 0000000000548940  /system/lib64/libart.so (MterpInvokeInterface+944)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #74 pc 0000000000572e14  /system/lib64/libart.so (ExecuteMterpImpl+14740)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #75 pc 00000000004d3f42  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.SentryBaseEvent$Serializer.serialize+58)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #76 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #77 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #78 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #79 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #80 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #81 pc 00000000004d88ee  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.SentryEvent.serialize+374)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #82 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #83 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #84 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #85 pc 0000000000548940  /system/lib64/libart.so (MterpInvokeInterface+944)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #86 pc 0000000000572e14  /system/lib64/libart.so (ExecuteMterpImpl+14740)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #87 pc 00000000004cb634  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectSerializer.serialize+196)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #88 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #89 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #90 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #91 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #92 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #93 pc 00000000004cba04  /dev/ashmem/dalvik-classes9.dex extracted in memory from /data/app/com.kgame.catssoup.bilibili-PYsVruy3d-9Qf0MlzCTdyA==/base.apk!classes9.dex (deleted) (io.sentry.JsonObjectWriter.value+4)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #94 pc 0000000000260c04  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4077428924+488)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #95 pc 00000000002666f8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #96 pc 0000000000286ee4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
04-16 17:58:58.665 12535 14720 14720 F DEBUG   :     #97 pc 0000000000547b84  /system/lib64/libart.so (MterpInvokeVirtual+588)
04-16 17:58:58.666 12535 14720 14720 F DEBUG   :     #98 pc 0000000000572c14  /system/lib64/libart.so (ExecuteMterpImpl+14228)
@kahest
Copy link
Member

kahest commented Apr 17, 2024

@bitsandfoxes is this related to what you're investigating? fyi @supervacuus

@kahest
Copy link
Member

kahest commented Apr 17, 2024

@lemon-li this issue looks similar to one we fixed recently - could you try a newer version of the SDK (>=2.0.1) and see if it still occurs?

@lemon-li
Copy link
Author

this issue looks similar to one we fixed recently - could you try a newer version of the SDK (>=2.0.1) and see if it still occurs?

thanks,I'll try the new version 😄

@lemon-li
Copy link
Author

lemon-li commented Apr 17, 2024

@kahest Can you tell me the root cause of the problem and reproduce? Because I tried with other Unity projects and couldn't reproduce the issue, it only happens in 1-2 of my game projects.
I created a new Unity empty project and same version, and the problem doesn't occur there.

@kahest
Copy link
Member

kahest commented Apr 17, 2024

@bitsandfoxes pls chime in if you have more details

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Apr 17, 2024

Looking through the logs this seems unrelated to the scope-observer fix.
And since it's happening on Android 10 and 11 it also seems unrelated to the issue we see on old Android devices with limited memory.

Your Sentry initialization surprises me. I see you're setting the android options within the Configure callback but you're initializing the Java SDK yourself? The Unity SDK should make sure this happens automatically. I wonder if there is some double-init happening here.

@lemon-li
Copy link
Author

lemon-li commented Apr 18, 2024

Looking through the logs this seems unrelated to the scope-observer fix. And since it's happening on Android 10 and 11 it also seems unrelated to the issue we see on old Android devices with limited memory.

Your Sentry initialization surprises me. I see you're setting the android options within the Configure callback but you're initializing the Java SDK yourself? The Unity SDK should make sure this happens automatically. I wonder if there is some double-init happening here.

@bitsandfoxes I have made some modifications to the Unity SDK (version 1.8.0). Specifically, I removed both the Editor and Plugins/Android because I do not use Unity's postbuild process to assemble the native layer

As for the Android SDK (6.10.0), I modified the AndroidManifest to disable the auto-init feature.

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Apr 19, 2024

With the setup you've got going the crashes seem to be fairly reproducible. Could you try disabling/removing the Unity SDK and see if the crashes persist so we can rule out where the issue is originating from? That way we can also rule out something funky going on with cross-SDK communication.

@lemon-li
Copy link
Author

lemon-li commented Apr 20, 2024

With the setup you've got going the crashes seem to be fairly reproducible. Could you try disabling/removing the Unity SDK and see if the crashes persist so we can rule out where the issue is originating from? That way we can also rule out something funky going on with cross-SDK communication.

@bitsandfoxes @kahest work fine when disable unity sdk.

I can reproduce it exactly.

create a empty unity project and integrate unity sdk.
unity version: 2021.3.33
unity sdk: 1.8.0

C# Layer

public class Initializer : MonoBehaviour
{
    // notes: It works fine when replacing `BeforeSceneLoad` with `AfterAssembliesLoaded`
    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    public static void SetupByBeforeSceneLoad()
    {
        // Call Java Layer (MainActivity.Setup)
        NativeAndroid.Setup();
    }
}
public class NativeAndroid : MonoBehaviour
{
    private const string ANDROID_BRIDGE_OBJ = "AndroidBridge";
    private static readonly AndroidJavaClass jBridge = new AndroidJavaClass(
        "com.seayoo.test.MainActivity"
    );

    [RuntimeInitializeOnLoadMethod]
    private static void GameOnLoad()
    {
        GameObject existingObject = GameObject.Find(ANDROID_BRIDGE_OBJ);
        if (existingObject == null)
        {
            var jBridgeObj = new GameObject(ANDROID_BRIDGE_OBJ, typeof(NativeAndroid));
            DontDestroyOnLoad(jBridgeObj);
        }
    }

    public static void Setup()
    {
        jBridge.CallStatic("Setup");
    }
}

Java

package com.seayoo.test;
public class MainActivity extends UnityPlayerActivity {
	  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    // From Unity
    public static void Setup() {
        Sentry.captureMessage("whoami");
    }
};

@bitsandfoxes
Copy link
Contributor

Thank you so much for the minimal repro. I'll give this a try and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Java Type: Bug Something isn't working
Projects
Status: No status
Status: Needs Investigation
Development

No branches or pull requests

3 participants