Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Native code crash when closing Activity. #663

Closed
binaryfoundry opened this issue Nov 5, 2019 · 7 comments
Closed

Native code crash when closing Activity. #663

binaryfoundry opened this issue Nov 5, 2019 · 7 comments

Comments

@binaryfoundry
Copy link

binaryfoundry commented Nov 5, 2019

SPECIFIC ISSUE ENCOUNTERED

Native code crash when trying to close application.


Version '2019.3.0b4 (3271e9fc5036)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Revision: '0'
ABI: 'arm64'
pid: 28937, tid: 28967, name: UnityMain
uid: 10245
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30
Cause: null pointer dereference
x0 0000000000000000 x1 00000079a8e458c8 x2 000000000000001c x3 0000000000000008
x4 0000000000000163 x5 0000000000000000 x6 00000079a1598460 x7 00000079a15984c0
x8 0000000000001dc5 x9 00000000ffffffff x10 0000000000001de4 x11 0000000000000001
x12 0000000000007109 x13 00000079a1598520 x14 0000000000000000 x15 000000000000000a
x16 00000079a9c35988 x17 0000007a4498656c x18 00000079b3f166d0 x19 000000000000001c
x20 00000079a7b4e020 x21 00000079a87fcf50 x22 00000079a85467a0 x23 00000079ab511195
x24 0000000000000004 x25 00000079a8548588 x26 00000079b55518a0 x27 0000000000000001
x28 00000079a85464d0 x29 00000079a85464d0
sp 00000079a8546340 lr 00000079a8e49918 pc 00000079a8e2304c
backtrace:
#00 pc 000000000089204c /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (DrawImmediate::Invalidate()+4) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#1 pc 00000000008b8914 /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (GfxDevice::InsertCustomMarkerCallback(void ()(int), int)+28) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#2 pc 000000000026be70 /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (ARCore::ARCoreManager::~ARCoreManager()+60) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#3 pc 000000000026c758 /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (RuntimeStatic<ARCore::ARCoreManager, false>::Destroy()+28) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#4 pc 0000000000518fe0 /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (RegisterRuntimeInitializeAndCleanup::ExecuteCleanup()+224) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#5 pc 00000000004437d4 /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (RuntimeCleanup()+44) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#6 pc 00000000006855b8 /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (UnityFinalDeinitApplication()+12) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#7 pc 00000000006aec1c /data/app/xxx.android.shell-49bqvCyL6JwacwYkz89iuQ==/lib/arm64/libunity.so (nativeDone(_JNIEnv
, _jobject*)+120) (BuildId: c1f3822e9c1d0af2c5a527274c2042defe3e9b86)
#8 pc 0000000000565de0 /system/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#9 pc 000000000055cd88 /system/lib64/libart.so (art_quick_invoke_stub+584) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#10 pc 00000000000d0720 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#11 pc 0000000000280d90 /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#12 pc 000000000027ada4 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#13 pc 000000000052d970 /system/lib64/libart.so (MterpInvokeDirect+296) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#14 pc 000000000054f494 /system/lib64/libart.so (ExecuteMterpImpl+14484) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)
#15 pc 0000000000254aa8 /system/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) [clone .llvm.223931584]+488) (BuildId: f21bf7f3efd32af594697aa3549e3b2e)

VERSIONS USED

  • Unity: 2019.3.0b4
  • ARCore SDK for Unity: 1.11 and tried 1.12
  • Device manufacturer, model, and O/S: Google Pixel 3
  • ARCore: 1.13.191007106
  • Output of adb shell getprop ro.build.fingerprint: PKQ1.180729.001/V11.0.3.0.PEECNXM:user/release-keys

STEPS TO REPRODUCE THE ISSUE

  1. Use Application.Quit() on Android back button detection.
@binaryfoundry
Copy link
Author

We were leaving the activity before Unity library unloading was complete, make sure to use the callback. Closing issue.

@Ishfaq149
Copy link

hi . im having the same problem. and i even could not understand your answer. plz will you explain that a bit . here is my crash issue .

java.lang.Error: * * * * * * * * * * * * * * * *
Version '2019.3.0f6 (27ab2135bccf)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'HUAWEI/JKM-LX1/HWJKM-H:9/HUAWEIJKM-LX1/9.1.0.256C185:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2020-03-07 14:26:21+0300
pid: 25855, tid: 26310, name: Thread-50 >>> com.thg.counter.terrorist.strike.action.shooting.games <<<
uid: 10190
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4a
Cause: null pointer dereference
x0 0000000000000000 x1 0000000000000000 x2 000000788cb42670 x3 000000788cb427a0
x4 0000000000000000 x5 0000000000000004 x6 00000079134b17f0 x7 000000791346f520
x8 0000007911ecee18 x9 000000000000000a x10 0000000000004001 x11 0000000000000000
x12 000000791319b000 x13 0000000000000001 x14 000000000000006c x15 00000078aa80c868
x16 0000007916e1e1e0 x17 00000079b6a212b0 x18 00000079131a3000 x19 000000788cb427a0
x20 0000000000000000 x21 0000000000000000 x22 000000788cb42670 x23 0000000000000003
x24 0000000000000000 x25 000000788cb44588 x26 00000078aa8ea0a0 x27 0000000000000004
x28 0000000000000000 x29 000000788cb428c8
sp 000000788cb425e0 lr 00000079160b2dcc pc 0000007911eff29c
backtrace:
at .
at .
at .
at .
at .
at libil2cpp.0x57029c (Native Method)
at libunity.0x31fdc8 (Native Method)
at libunity.0x32c3ec (Native Method)
at libunity.0x1809ec (Native Method)
at base.0x35b40 (Native Method)

Please help. Thanks a lot.

@binaryfoundry
Copy link
Author

binaryfoundry commented Mar 12, 2020 via email

@Ishfaq149
Copy link

and how did you get that you are having problem on that particular point . . how can i find out that where is the problem. even there is no red error in console in my whole game

@Ishfaq149
Copy link

what you think about my crash report , what should i do . my mind is totally stuck here . im afraid , soon my mind will stop working . because of this . . plz read it and tell me the possibilities . .

@binaryfoundry
Copy link
Author

binaryfoundry commented Mar 12, 2020 via email

@binaryfoundry
Copy link
Author

Here the example has a button to press which unloads the library safely
before the view is finished.

    private fun addControlsToUnityFrame() {
        val layout = mUnityPlayer
        val screenView =
LayoutInflater.from(baseContext).inflate(R.layout.unity_overlay, layout,
true)

        screenView.button_unload.setOnClickListener { unloadUnityPlayer() }
        screenView.button_finish.setOnClickListener { finish() }
    }

    private fun unloadUnityPlayer() {
        Log.w(TAG, "Sending unload message")
        mUnityPlayer.unload()
    }

    override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            mUnityPlayer.unload()
            return true
        }
        return super.onKeyDown(keyCode, event)
    }

    override fun onUnityPlayerUnloaded() {
        finish()
    }

    override fun onUnityPlayerQuitted() {
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants