godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.35k stars 21.06k forks source link

[Android- 3.2.4beta1] The game crashes when I try to change the scene in android phones #43314

Closed himaghnam closed 3 years ago

himaghnam commented 3 years ago

Godot version: 3.2.4beta1

OS/device including version: Android GLES2 and GLES3

Issue description: The game crashes when I try to change the scene. Might be some GL related error

11-04 23:56:05.821 31053 31053 F DEBUG   : pid: 30599, tid: 30669, name: GLThread 14002  >>> org.godotengine.Nikitas_Adventure <<<
11-04 23:56:05.821 31053 31053 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
11-04 23:56:05.821 31053 31053 F DEBUG   : Cause: null pointer dereference
11-04 23:56:05.821 31053 31053 F DEBUG   :     x0  00000007fa3e0000  x1  0000000000000008  x2  000000000005b210  x3  00000007fa3e0000
11-04 23:56:05.821 31053 31053 F DEBUG   :     x4  000000000005b218  x5  00000007fa43b210  x6  0000000000000002  x7  0000000000100900
11-04 23:56:05.821 31053 31053 F DEBUG   :     x8  0000000000000004  x9  0000000000000000  x10 0000000000000014  x11 0000000000000000
11-04 23:56:05.821 31053 31053 F DEBUG   :     x12 000000009d03800a  x13 0000000000000000  x14 00000000000048e8  x15 0000007ab45b6200
11-04 23:56:05.821 31053 31053 F DEBUG   :     x16 0000007aafc70840  x17 0000007b3fabfeb0  x18 00000007fa3e0000  x19 0000007aa055d780
11-04 23:56:05.821 31053 31053 F DEBUG   :     x20 0000000000000000  x21 0000000000000000  x22 0000007aa0562c68  x23 0000007a8162ad4c
11-04 23:56:05.821 31053 31053 F DEBUG   :     x24 000000000000002c  x25 000000000005b210  x26 0000000000000008  x27 0000000000000007
11-04 23:56:05.821 31053 31053 F DEBUG   :     x28 0000000000000000  x29 0000007aa242e5b0
11-04 23:56:05.821 31053 31053 F DEBUG   :     sp  0000007aa242e4f0  lr  0000007aaf9b5d68  pc  0000007b3fabff98
11-04 23:56:05.906 31053 31053 F DEBUG   :
11-04 23:56:05.906 31053 31053 F DEBUG   : backtrace:
11-04 23:56:05.906 31053 31053 F DEBUG   :     #00 pc 000000000001df98  /system/lib64/libc.so (memcpy+232)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #01 pc 00000000001d0d64  /vendor/lib64/egl/libGLESv2_adreno.so (EsxVertexArrayObject::UpdateInternalVbos(EsxDrawDescriptor const*, unsigned int, EsxAttributeDesc const*)+1644)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #02 pc 00000000003374f4  /vendor/lib64/egl/libGLESv2_adreno.so (A5xVertexArrayObject::CalcVfdRegs(EsxDrawDescriptor const*, A5xVfdRegs*, int)+892)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #03 pc 000000000034ff54  /vendor/lib64/egl/libGLESv2_adreno.so (A5xContext::ValidateState(EsxDrawDescriptor const*)+1212)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #04 pc 000000000033c820  /vendor/lib64/egl/libGLESv2_adreno.so (A5xContext::HwValidateGfxState(EsxDrawDescriptor const*)+16)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #05 pc 0000000000115178  /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::ValidateGfxState(EsxDrawDescriptor const*)+1968)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #06 pc 000000000010c664  /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::DrawElementsInstanced(EsxPrimType, unsigned int, EsxPixType, void const*, unsigned int, int)+972)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #07 pc 000000000070f630  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #08 pc 0000000000713998  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #09 pc 00000000007112a0  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #10 pc 00000000007107e8  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #11 pc 000000000071065c  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #12 pc 000000000119a720  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #13 pc 00000000011109dc  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #14 pc 00000000011111fc  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #15 pc 00000000010eccf8  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #16 pc 00000000001a7d84  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so
11-04 23:56:05.906 31053 31053 F DEBUG   :     #17 pc 0000000000178b90  /data/app/org.godotengine.Nikitas_Adventure-gABb4HZIJ0Sby2fpGK0gxA==/lib/arm64/libgodot_android.so (Java_org_godotengine_godot_GodotLib_step+184)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #18 pc 000000000055e1e0  /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #19 pc 000000000003c268  /dev/ashmem/dalvik-jit-code-cache (deleted) (org.godotengine.godot.GodotRenderer.onDrawFrame+88)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #20 pc 0000000000555188  /system/lib64/libart.so (art_quick_invoke_stub+584)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #21 pc 00000000000cf6c8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #22 pc 000000000027f2b8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #23 pc 00000000002792c0  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #24 pc 0000000000525740  /system/lib64/libart.so (MterpInvokeInterface+1392)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #25 pc 0000000000547994  /system/lib64/libart.so (ExecuteMterpImpl+14740)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #26 pc 0000000000af21b8  /system/framework/boot-framework.vdex (android.opengl.GLSurfaceView$GLThread.guardedRun+1102)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #27 pc 0000000000252fc4  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1212041784+488)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #28 pc 0000000000258ab8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #29 pc 00000000002792a4  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #30 pc 0000000000525b04  /system/lib64/libart.so (MterpInvokeDirect+296)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #31 pc 0000000000547894  /system/lib64/libart.so (ExecuteMterpImpl+14484)
11-04 23:56:05.906 31053 31053 F DEBUG   :     #32 pc 0000000000af26a8  /system/framework/boot-framework.vdex (android.opengl.GLSurfaceView$GLThread.run+48)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #33 pc 0000000000252fc4  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1212041784+488)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #34 pc 0000000000515058  /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #35 pc 000000000055e2fc  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #36 pc 0000000000555188  /system/lib64/libart.so (art_quick_invoke_stub+584)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #37 pc 00000000000cf6c8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #38 pc 000000000045c8f4  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #39 pc 000000000045d9b0  /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #40 pc 000000000048884c  /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1120)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #41 pc 0000000000091fac  /system/lib64/libc.so (__pthread_start(void*)+36)
11-04 23:56:05.907 31053 31053 F DEBUG   :     #42 pc 0000000000023968  /system/lib64/libc.so (__start_thread+68)

Steps to reproduce: It happens when I change the scene also sometimes it gives black boxes instead of game assets at some place

Minimal Project Android_bug.zip

Calinou commented 3 years ago

@gamergamesz Please upload a minimal reproduction project to make this easier to troubleshoot.

Also, does it crash on any other platforms?

himaghnam commented 3 years ago

I have updated it with the minimal project though it does not crash as my project. It crashes when I close the Interstitial ad screen, I have updated the demo project, this one gives black boxes and I guess if there is more draws then it will crash. I guess it has something to do with layout, might be plugin side. Note: This crash can be avoided just change the scene(paused) before showing the ad and when the ad closes(signal) unpause the game

himaghnam commented 3 years ago

@Calinou It's a custom build and the manifest file is in android folder

lawnjelly commented 3 years ago

Unfortunately at present this seems very difficult to investigate with the info given. The call stack is providing no info (myself I don't recognise any of the functions), I know nothing about admob, what it does and how it works (maybe the author could help?), and it could be a race condition caused by the scene changing.

In addition you would probably need to do builds with previous versions of Godot to determine whether this is a regression, and possibly with different options.

You would need to pin this down further to get any more action on this I suspect, there is just too much going on in your minimum reproduction project.

Just for reference I found this link, which suggests this is common and contacting the author might be wise: https://godotengine.org/qa/79227/android-game-crashes-after-using-admob

himaghnam commented 3 years ago

Well the workaround is working fine. This was fine in 3.2.2 and 3.2.3. This minimal project only shows black box after the scene change only in mobile, but with the increase in draws it will crash and will show the error too.

Calinou commented 3 years ago

Closing, as this appears to be related to the use of an AdMob plugin rather than Godot itself. Please report the issue on the AdMob plugin repository after searching for duplicates there.