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

ax::backend::CommandBufferGL::drawArrays 中的glDrawArrays崩溃BUG #2240

Closed
cxcxiaochuan opened this issue Nov 23, 2024 · 25 comments
Closed

Comments

@cxcxiaochuan
Copy link

cxcxiaochuan commented Nov 23, 2024

崩溃版本:axmol-2.1.2

崩溃堆栈A:
崩溃手机:Infinix Infinix-X6515 (Infinix SMART 7)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:

backtrace:
  #00  pc 0x00000000000f7fb0  /vendor/lib64/egl/libGLESv2_mtk.so
  #01  pc 0x000000000006f9a4  /vendor/lib64/egl/libGLESv2_mtk.so
  #02  pc 0x000000000006f364  /vendor/lib64/egl/libGLESv2_mtk.so
  #03  pc 0x000000000006d6f8  /vendor/lib64/egl/libGLESv2_mtk.so (glDrawArrays+3500)
  #04  pc 0x0000000000919364  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned long, unsigned long, bool)+76) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #05  pc 0x00000000008fb508  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+504) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #06  pc 0x00000000008faad4  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #07  pc 0x00000000008fa818  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+224) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #08  pc 0x00000000008fac98  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+128) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #09  pc 0x00000000008faad4  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #10  pc 0x00000000008fb600  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::render()+84) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #11  pc 0x00000000008a5bec  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+248) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #12  pc 0x0000000000935ec4  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::drawScene()+372) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #13  pc 0x0000000000938248  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::mainLoop()+124) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #14  pc 0x0000000000068ecc  /data/app/~~Id52RRpArY9ErdNEZhL1Rg==/*******==/oat/arm64/base.odex (art_jni_trampoline+108)

崩溃堆栈B:
崩溃手机:OPPO OP4F97 (CPH2269)
崩溃系统:Android 11 (SDK 30)
崩溃堆栈:

backtrace:
  #00  pc 0x0000000000095fac  /vendor/lib64/egl/libGLESv2_mtk.so
  #01  pc 0x00000000000b5244  /vendor/lib64/egl/libGLESv2_mtk.so
  #02  pc 0x00000000000b4c44  /vendor/lib64/egl/libGLESv2_mtk.so
  #03  pc 0x00000000000b32b4  /vendor/lib64/egl/libGLESv2_mtk.so (glDrawArrays+3560)
  #04  pc 0x0000000000087be0  /vendor/lib64/egl/libGLES_meow.so (MEOW::meow_call_ddk_gl_2_glDrawArrays(unsigned int, int, int)+32)
  #05  pc 0x0000000000919364  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned long, unsigned long, bool)+76) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #06  pc 0x00000000008fb508  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+504) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #07  pc 0x00000000008faad4  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #08  pc 0x00000000008fa818  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+224) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #09  pc 0x00000000008fac98  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+128) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #10  pc 0x00000000008faad4  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #11  pc 0x00000000008fb600  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::render()+84) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #12  pc 0x00000000008a5bec  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+248) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #13  pc 0x0000000000935ec4  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::drawScene()+372) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #14  pc 0x0000000000938248  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::mainLoop()+124) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #15  pc 0x0000000000070eb0  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/oat/arm64/base.odex (art_jni_trampoline+144)
  #16  pc 0x00000000001460c0  /data/app/~~BRLZDVGYMl0K3V_Vmx0Ihw==/*******==/oat/arm64/base.odex (org.axmol.lib.AxmolRenderer.onDrawFrame+128)
  #17  pc 0x0000000000682c14  /system/framework/arm64/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+6612)
  #18  pc 0x0000000000683474  /system/framework/arm64/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+436)
  #19  pc 0x0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548)
  #20  pc 0x00000000001a97e8  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
  #21  pc 0x000000000055e57c  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460)
  #22  pc 0x00000000005ad7cc  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308)
  #23  pc 0x00000000000db188  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)
  #24  pc 0x000000000007a9d0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

崩溃堆栈C:
崩溃手机:OPPO OP56F5 (A17k)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:

backtrace:
  #00  pc 0x0000000000095040  /vendor/lib64/egl/libGLESv2_mtk.so
  #01  pc 0x00000000000b3f84  /vendor/lib64/egl/libGLESv2_mtk.so
  #02  pc 0x00000000000b3934  /vendor/lib64/egl/libGLESv2_mtk.so
  #03  pc 0x00000000000b1f3c  /vendor/lib64/egl/libGLESv2_mtk.so (glDrawArrays+2880)
  #04  pc 0x0000000000919364  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned long, unsigned long, bool)+76) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #05  pc 0x00000000008fb508  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+504) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #06  pc 0x00000000008faad4  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #07  pc 0x00000000008fa818  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+224) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #08  pc 0x00000000008fac98  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+128) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #09  pc 0x00000000008faad4  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #10  pc 0x00000000008fb600  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::render()+84) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #11  pc 0x00000000008a5bec  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+248) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #12  pc 0x0000000000935ec4  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::drawScene()+372) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #13  pc 0x0000000000938248  /data/app/~~gH2YlQHMXgJRO0xm5TTQlw==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::mainLoop()+124) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #14  pc 0x00000000003a8b5c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+108)

崩溃堆栈D:
崩溃手机:Itel itel-A667L (itel A50)
崩溃系统:Android 14 (SDK 34)
崩溃堆栈:

backtrace:
  #00  pc 0x00000000000b6cd2  /vendor/lib/egl/libGLESv2_powervr.so
  #01  pc 0x000000000005608d  /vendor/lib/egl/libGLESv2_powervr.so
  #02  pc 0x0000000000055409  /vendor/lib/egl/libGLESv2_powervr.so (glDrawArrays+1024)
  #03  pc 0x000000000064f477  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned int, unsigned int, bool)+46) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #04  pc 0x0000000000639821  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+360) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #05  pc 0x000000000063904d  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+270) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #06  pc 0x0000000000638e5f  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+158) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #07  pc 0x0000000000639183  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+62) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #08  pc 0x000000000063904d  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+270) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #09  pc 0x00000000006398bf  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::render()+56) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #10  pc 0x00000000005fadd7  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+266) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #11  pc 0x0000000000664035  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Director::drawScene()+380) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #12  pc 0x0000000000665b0b  /data/app/~~d2k45pSXHHfL6H1qCO7IJA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Director::mainLoop()+74) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #13  pc 0x0000000000309181  /data/misc/apexdata/com.android.art/dalvik-cache/arm/boot.oat (art_jni_trampoline+64)
  #14  pc 0x0000000002009bd9  /memfd:jit-cache (org.axmol.lib.AxmolRenderer.onDrawFrame+136)
  #15  pc 0x00000000000a0c68  /apex/com.android.art/lib/libart.so (nterp_helper+5464)
  #16  pc 0x00000000004e86ae  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.guardedRun+1066)
  #17  pc 0x00000000000a0200  /apex/com.android.art/lib/libart.so (nterp_helper+2800)
  #18  pc 0x00000000004e8ca4  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.run+52)
  #19  pc 0x00000000000a4575  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
  #20  pc 0x00000000005ace41  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+248)
  #21  pc 0x0000000000208c25  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+120)
  #22  pc 0x0000000000517e9b  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1106)
  #23  pc 0x0000000000517a3f  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+2)
  #24  pc 0x00000000000ad33b  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #25  pc 0x0000000000063da7  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

崩溃堆栈E:
崩溃手机:samsung a10s (Galaxy A10s)
崩溃系统:Android 11 (SDK 30)
崩溃堆栈:

backtrace:
  #00  pc 0x000000000007018e  /vendor/lib/egl/libGLESv2_mtk.so
  #01  pc 0x0000000000089c81  /vendor/lib/egl/libGLESv2_mtk.so
  #02  pc 0x00000000000888b9  /vendor/lib/egl/libGLESv2_mtk.so (glDrawArrays+2592)
  #03  pc 0x000000000002d549  /vendor/lib/egl/libGLES_meow.so (MEOW::meow_call_ddk_gl_2_glDrawArrays(unsigned int, int, int)+20)
  #04  pc 0x000000000064f477  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned int, unsigned int, bool)+46) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #05  pc 0x0000000000639821  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+360) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #06  pc 0x000000000063904d  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+270) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #07  pc 0x0000000000638e5f  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+158) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #08  pc 0x0000000000639183  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+62) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #09  pc 0x000000000063904d  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+270) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #10  pc 0x00000000006398bf  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Renderer::render()+56) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #11  pc 0x00000000005fadd7  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+266) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #12  pc 0x0000000000664035  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Director::drawScene()+380) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #13  pc 0x0000000000665b0b  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/split_config.armeabi_v7a.apk!libGame.so (ax::Director::mainLoop()+74) (BuildId: bd26b3b83d492ac2e02c800327ef6334fb6dbd99)
  #14  pc 0x000000000006e9a7  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/oat/arm/base.odex (art_jni_trampoline+94)
  #15  pc 0x0000000000127d27  /data/app/~~QgCFi8VFp5Xad2x-r0M8GA==/*******==/oat/arm/base.odex (org.axmol.lib.AxmolRenderer.onDrawFrame+150)
  #16  pc 0x00000000005955d1  /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+3592)
  #17  pc 0x0000000000595d09  /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+184)
  #18  pc 0x00000000000d47d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
  #19  pc 0x00000000004f2427  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+282)
  #20  pc 0x000000000012cb2d  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+148)
  #21  pc 0x00000000003ff4df  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+374)
  #22  pc 0x00000000003ff5ef  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42)
  #23  pc 0x0000000000440b35  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1056)
  #24  pc 0x00000000000aad13  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #25  pc 0x0000000000064193  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

崩溃堆栈F:
崩溃手机:OPPO OP56F5 (A17k)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:

backtrace:
  #00  pc 0x0000000000095040  /vendor/lib64/egl/libGLESv2_mtk.so
  #01  pc 0x00000000000b3f84  /vendor/lib64/egl/libGLESv2_mtk.so
  #02  pc 0x00000000000b3934  /vendor/lib64/egl/libGLESv2_mtk.so
  #03  pc 0x00000000000b1f3c  /vendor/lib64/egl/libGLESv2_mtk.so (glDrawArrays+2880)
  #04  pc 0x0000000000919364  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned long, unsigned long, bool)+76) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #05  pc 0x00000000008fb508  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+504) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #06  pc 0x00000000008faad4  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #07  pc 0x00000000008fa818  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+224) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #08  pc 0x00000000008fac98  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+128) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #09  pc 0x00000000008faad4  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #10  pc 0x00000000008fb600  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::render()+84) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #11  pc 0x00000000008a5bec  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+248) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #12  pc 0x0000000000935ec4  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::drawScene()+372) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #13  pc 0x0000000000938248  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::mainLoop()+124) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #14  pc 0x000000000005cf50  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/oat/arm64/base.odex (art_jni_trampoline+112)

崩溃版本:axmol-2.1.2
崩溃手机:OPPO OP56F5 (A17k)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:

backtrace:
  #00  pc 0x0000000000095040  /vendor/lib64/egl/libGLESv2_mtk.so
  #01  pc 0x00000000000b3f84  /vendor/lib64/egl/libGLESv2_mtk.so
  #02  pc 0x00000000000b3934  /vendor/lib64/egl/libGLESv2_mtk.so
  #03  pc 0x00000000000b1f3c  /vendor/lib64/egl/libGLESv2_mtk.so (glDrawArrays+2880)
  #04  pc 0x0000000000919364  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::backend::CommandBufferGL::drawArrays(ax::backend::PrimitiveType, unsigned long, unsigned long, bool)+76) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #05  pc 0x00000000008fb508  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+504) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #06  pc 0x00000000008faad4  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #07  pc 0x00000000008fa818  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processGroupCommand(ax::GroupCommand*)+224) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #08  pc 0x00000000008fac98  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::processRenderCommand(ax::RenderCommand*)+128) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #09  pc 0x00000000008faad4  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #10  pc 0x00000000008fb600  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Renderer::render()+84) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #11  pc 0x00000000008a5bec  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Scene::render(ax::Renderer*, ax::Mat4 const&, ax::Mat4 const*)+248) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #12  pc 0x0000000000935ec4  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::drawScene()+372) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #13  pc 0x0000000000938248  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/split_config.arm64_v8a.apk!libGame.so (ax::Director::mainLoop()+124) (BuildId: 5498f62da2355a571210a636d6989be2873c7f2a)
  #14  pc 0x000000000005cf50  /data/app/~~b-zjfqOn6IWrb3kdYPr1Gg==/*******==/oat/arm64/base.odex (art_jni_trampoline+112)
@cxcxiaochuan cxcxiaochuan changed the title ax::backend::CommandBufferGL::drawArrays 崩溃BUG ax::backend::CommandBufferGL::drawArrays 中的glDrawArrays崩溃BUG Nov 23, 2024
@rh101
Copy link
Contributor

rh101 commented Nov 23, 2024

@cxcxiaochuan Edited your post to add the code tags to format the logs so that they are easier to read. Please do not forget to add the tags when you post code or logs.

@cxcxiaochuan
Copy link
Author

void CommandBufferGL::drawArrays(PrimitiveType primitiveType, std::size_t start, std::size_t count, bool wireframe)
{
prepareDrawing();
#if !AX_GLES_PROFILE // glPolygonMode is only supported in Desktop OpenGL
if (wireframe)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
#else
if (wireframe)
primitiveType = PrimitiveType::LINE;
#endif
glDrawArrays(UtilsGL::toGLPrimitiveType(primitiveType), start, count);//崩溃在这句代码中了
#if !AX_GLES_PROFILE // glPolygonMode is only supported in Desktop OpenGL
if (wireframe)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
#endif
cleanResources();
}

@rh101
Copy link
Contributor

rh101 commented Nov 23, 2024

glDrawArrays(UtilsGL::toGLPrimitiveType(primitiveType), start, count);//崩溃在这句代码中了

It's clear from the logs that the crash is happening when that method is called, but that doesn't necessarily mean it is the cause of the crash. It is most likely something else that is causing this crash, and perhaps even the crashes in the other issues you posted today.

If you have a test project that reproduces the issue, then please post it.

@cxcxiaochuan
Copy link
Author

I can't reproduce this error now, but I have collected a lot of this error through the Google Store. We are also analyzing the source code, but have not solved this problem.

@rh101
Copy link
Contributor

rh101 commented Nov 23, 2024

Please check issue #1211

It seems similar, so check if anything in there helps.

@cxcxiaochuan
Copy link
Author

Is there any way to prevent glDrawArrays from crashing when there is an error? For example, can I use try *** catch *** to catch the error, catch the exception and handle it, so as to avoid the program crashing?

@rh101
Copy link
Contributor

rh101 commented Nov 23, 2024

Is there any way to prevent glDrawArrays from crashing when there is an error? For example, can I use try *** catch *** to catch the error, catch the exception and handle it, so as to avoid the program crashing?

No. It doesn't throw an exception, so try/catch won't work.

You need to find the source of the error.

I can't reproduce this error now, but I have collected a lot of this error through the Google Store. We are also analyzing the source code, but have not solved this problem.

In AxmolActivity.java, change this line:

this.mGLSurfaceView.setPreserveEGLContextOnPause(true);

to

this.mGLSurfaceView.setPreserveEGLContextOnPause(false);

See if this change helps to reproduce the crash. Also, please test it by putting the app into the background, load up other apps, then bring it back to the foreground etc..

@cxcxiaochuan
Copy link
Author

cxcxiaochuan commented Nov 24, 2024

We found that frequent calls to the onEditorAction function in the TextInputWrapper.java function may cause CommandBufferGL::drawElements to crash when calling glDrawElements. Our tests found that the following code will call the loop exponentially. The more text is entered, the more calls will be made as long as the number of changes is made. Frequent calls may cause program problems.

@Override
public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) {
    if (this.mGLSurfaceView.getEditText() == pTextView && this.isFullScreenEdit()) {
        // user press the action button, delete all old text and insert new text
        if (null != mOriginText) {
            for (int i = this.mOriginText.length(); i > 0; i--) {
                this.mGLSurfaceView.deleteBackward();---The test found that calling the deleteBackward function here is unreasonable. The number of loops depends on the size of mOriginText.length(). If mOriginText.length() is particularly large, frequent calls will easily cause program problems.
            }
        }
        
        String text = pTextView.getText().toString();

It is recommended to change for (int i = this.mOriginText.length(); i > 0; i--) {
this.mGLSurfaceView.deleteBackward();
}
to a function that clears the text content. Call the function that clears the text content once every time a change is made. Do not call the deleteBackward function in a loop to delete characters one by one.

@rh101
Copy link
Contributor

rh101 commented Nov 25, 2024

@cxcxiaochuan Could you please show how you are using the TextFieldTTF?

More specifically, have you implemented onTextFieldDeleteBackward, and if you have, what does it do?

It is recommended to change for (int i = this.mOriginText.length(); i > 0; i--) {
this.mGLSurfaceView.deleteBackward();
}
to a function that clears the text content. Call the function that clears the text content once every time a change is made. Do not call the deleteBackward function in a loop to delete characters one by one

I wasn't aware of the call to deleteBackward(), or what its purpose was, until now. It seems to exist to allow per character actions, such as animations. If you check cpp-tests, 49:Node: Text Input, 2:text input test, then you will see what I mean. There are per character effects on text input and text deletion.

If the functionality is changed to what you are suggesting, then it would not be possible to trigger an effect on each character.

One thing I did notice is that if the "Select All" functionality of the virtual keyboard is used, and then the delete button is pressed on it, the this.mGLSurfaceView.deleteBackward() is called once per character, so if there are 100 characters selected, it will be called 100 times. Perhaps this should just pass the total number of characters to be deleted, rather than call it for each and every character.

This will not stop the problem of someone tapping the backspace button very quickly to delete the content, and I'm not actually sure if anything can be done about that specific scenario.

@cxcxiaochuan
Copy link
Author

cxcxiaochuan commented Nov 26, 2024

Below is the code for our application using text input. Our application does not override the onTextFieldDeleteBackward method.

class UICCTextInputFieldSunl: public UICCTextField
{
public:
    static UICCTextInputFieldSunl* create();

public:
    virtual bool onTextFieldInsertText(TextFieldTTF* pSender, const char* text, size_t nLen) override;
};

//Text input object box
class TextInputFieldSunl: public TextField
{
public:
    static TextInputFieldSunl* create(std::string_view placeholder, std::string_view fontName, int fontSize);

protected:
    virtual void initRenderer() override;
};

#define INPUT_SHOW_CHAR_MAX_LEN   (2048 - 1)        //Defines the maximum length of text input

UICCTextInputFieldSunl* UICCTextInputFieldSunl::create()
{
    UICCTextInputFieldSunl* ret = new UICCTextInputFieldSunl();
    ret->autorelease();
    return ret;
}

bool UICCTextInputFieldSunl::onTextFieldInsertText(TextFieldTTF* pSender, const char* text, size_t nLen)
{
    bool bBaseCheck = UICCTextField::onTextFieldInsertText(pSender, text, nLen);
    if (!bBaseCheck)
    {
        if (getString().length() >= INPUT_SHOW_CHAR_MAX_LEN)
        {
            return true;
        }
    }
    return bBaseCheck;
}

TextInputFieldSunl* TextInputFieldSunl::create(std::string_view placeholder, std::string_view fontName, int fontSize)
{
    TextInputFieldSunl* widget = new TextInputFieldSunl();
    if (widget->init())
    {
        widget->setFontName(fontName);
        widget->setFontSize(fontSize);
        widget->setPlaceHolder(placeholder);
        widget->autorelease();
        return widget;
    }
    AX_SAFE_DELETE(widget);
    return nullptr;
}

void TextInputFieldSunl::initRenderer()
{
    _textFieldRenderer = UICCTextInputFieldSunl::create();
    addProtectedChild(_textFieldRenderer, -1, -1);
}


IputChartLayer::IputChartLayer()
{
    m_pInputShowText = nullptr;
}

IputChartLayer::~IputChartLayer()
{

}

void IputChartLayer::onEnter()
{
    Widget::onEnter();
    
    setTouchEnabled(true);
    
    //Creating a text input box
    bool bInputNotify = FileUtils::getInstance()->isPopupNotify();
    FileUtils::getInstance()->setPopupNotify(false);//Disable LOG and warning pop-up boxes, because TextField::create uses Arial font, which will trigger warnings and log records
    m_pInputShowText = TextInputFieldSunl::create("nothing", "Arial", 36);
    FileUtils::getInstance()->setPopupNotify(bInputNotify);//Restore the original LOG and warning pop-up box settings
    pSprSetNameLeftBg->addChild(m_pInputShowText);
    m_pInputShowText->setColor(Color3B(255, 255, 255));
    m_pInputShowText->setMaxLengthEnabled(true);
    m_pInputShowText->setMaxLength(INPUT_SHOW_CHAR_MAX_LEN);
    m_pInputShowText->setTouchAreaEnabled(true);
    m_pInputShowText->setTouchSize(Vec2(540-40, 66));
    m_pInputShowText->setTextColor(Color4B(255, 255, 255, 255));
    m_pInputShowText->setPlaceHolderColor(Color3B(255, 255, 255));
    m_pInputShowText->setCursorEnabled(true);
    TextFieldTTF *pLabTransGetInput = dynamic_cast<TextFieldTTF *>(m_pInputShowText->getVirtualRenderer());
    if (nullptr != pLabTransGetInput)
    {
		      //Set the input text display area. Only after setting the text area, setting the text to the left or right will be effective
		      pLabTransGetInput->setDimensions(m_pInputShowText->getTouchSize().width, m_pInputShowText->getTouchSize().height);
    }
    m_pInputShowText->setTextHorizontalAlignment(TextHAlignment::LEFT);
    m_pInputShowText->setTextVerticalAlignment(TextVAlignment::CENTER);
    m_pInputShowText->setPosition(Point(pSprSetNameLeftBg->getContentSize().width, pSprSetNameLeftBg->getContentSize().height / 2));
    m_pInputShowText->addEventListener(AX_CALLBACK_2(IputChartLayer::TextNameFieldEvent, this));
}

void IputChartLayer::onExit()
{
		Widget::onExit();

		setTouchEnabled(false);

    m_pInputShowText = nullptr;
}

void IputChartLayer::TextNameFieldEvent(Ref* pObj, TextField::EventType iType)
{
    /*
#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32)
    CCLOG("IputChartLayer::TextNameFieldEvent iType = %d", iType);
#endif
    */
}

//Get text content
std::string IputChartLayer::GetInputStringContent()
{
    if (nullptr == m_pInputShowText)
    {
        return "";
    }

	  std::string strGetText(m_pInputShowText->getString());
	  return strGetText;
}

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

Please use the backtick code tags to format your code, otherwise it is very hard to read, for example:

image

It will then look like this:

void myFunction()
{
}

I'll edit your post manually now to add the tags, but once again, please add code tags around any code you post.

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

@cxcxiaochuan Is the crash happening when tapping backspace manually, deleting one character at a time, or when using select-all text and then backspace (which deletes all text)?

@cxcxiaochuan
Copy link
Author

We tested and there were two crashes. The input text was too much, and repeated addition and deletion of characters triggered the crash. One time, the Khmer language was selected. In addition, we also found that the character content displayed in the Khmer TTF text was incorrect. The Khmer TTF text content was displayed very strangely, and the character pattern displayed by the program did not match the original text pattern of the input TTF.

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

We tested and there were two crashes. The input text was too much, and repeated addition and deletion of characters triggered the crash. One time, the Khmer language was selected.

Thanks for the clarification.

In addition, we also found that the character content displayed in the Khmer TTF text was incorrect. The Khmer TTF text content was displayed very strangely, and the character pattern displayed by the program did not match the original text pattern of the input TTF.

That is unrelated to the current issue, and if you are certain that it may be a problem in Axmol, then it is best to log a separate issue for this.

@cxcxiaochuan
Copy link
Author

We are also confused and don't know how to fix this problem. According to logical reasoning, it is obviously unreasonable that adding or deleting a character will call the deleteBackward function exponentially. It is very annoying to copy a page of text content at one time and then add or change the text content. In this way, deleteBackward will be called a large number of times for each change, which will also cause the program to freeze for a short time, because the call of JNI function consumes a lot of performance and will cause the interface to freeze.

@cxcxiaochuan
Copy link
Author

We tested and there were two crashes. The input text was too much, and repeated addition and deletion of characters triggered the crash. One time, the Khmer language was selected.

Thanks for the clarification.

In addition, we also found that the character content displayed in the Khmer TTF text was incorrect. The Khmer TTF text content was displayed very strangely, and the character pattern displayed by the program did not match the original text pattern of the input TTF.

That is an unrelated to the current issue, and if you are certain that it may be a problem in Axmol, then it is best to log a separate issue for this.

ok

@cxcxiaochuan
Copy link
Author

cxcxiaochuan commented Nov 26, 2024

Here are two BUG examples collected by our program through the Google Store. These two programs crashed after calling org.axmol.lib.AxmolRenderer.nativeDeleteBackward. I don’t know if it can help you analyze the problem.

``
崩溃版本:axmol-2.1.2
崩溃手机:HUAWEI HWAMN-M (HUAWEI Y5 2019)
崩溃系统:Android 9 (SDK 28)
崩溃堆栈:
backtrace:
#00 pc 0x000000000001e41e /vendor/lib/egl/libGLESv2_mtk.so
#1 pc 0x000000000001afb1 /vendor/lib/egl/libGLESv2_mtk.so
#2 pc 0x000000000001a8f3 /vendor/lib/egl/libGLESv2_mtk.so (glDrawElements+90)
#3 pc 0x000000000000a1bd /system/lib/libGameGraphicsOpt.so (hw_glDrawElementsHookV1+4)
#4 pc 0x000000000064f673 /data/app/==/split_config.armeabi_v7a.apk (ax::backend::CommandBufferGL::drawElements(ax::backend::PrimitiveType, ax::backend::IndexFormat, unsigned int, unsigned int, bool)+102)
#5 pc 0x00000000006397c1 /data/app/
==/split_config.armeabi_v7a.apk (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+264)
#6 pc 0x000000000063904d /data/app/==/split_config.armeabi_v7a.apk (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+270)
#7 pc 0x00000000006398bf /data/app/
==/split_config.armeabi_v7a.apk (ax::Renderer::render()+56)
#8 pc 0x00000000005fadd7 /data/app/==/split_config.armeabi_v7a.apk (ax::Scene::render(ax::Renderer, ax::Mat4 const&, ax::Mat4 const)+266)
#9 pc 0x0000000000664035 /data/app/
==/split_config.armeabi_v7a.apk (ax::Director::drawScene()+380)
#10 pc 0x0000000000665b0b /data/app/
==/split_config.armeabi_v7a.apk (ax::Director::mainLoop()+74)
#11 pc 0x0000000000094a67 /data/app/
==/oat/arm/base.odex (org.axmol.lib.AxmolRenderer.nativeDeleteBackward [DEDUPED]+94)
#12 pc 0x0000000000137887 /data/app/
==/oat/arm/base.odex (org.axmol.lib.AxmolRenderer.onDrawFrame+150)
#13 pc 0x00000000009d8249 /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+3040)
#14 pc 0x00000000009d908d /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+180)
#15 pc 0x0000000000420f75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
#16 pc 0x00000000003fa349 /system/lib/libart.so (art_quick_invoke_stub+224)
#17 pc 0x00000000000a4709 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread
, unsigned int
, unsigned int, art::JValue
, char const
)+136)
#18 pc 0x0000000000357e9d /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
#19 pc 0x0000000000358bf5 /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+320)
#20 pc 0x000000000037a123 /system/lib/libart.so (art::Thread::CreateCallback(void*)+866)
#21 pc 0x0000000000064975 /system/lib/libc.so (__pthread_start(void*)+22)
#22 pc 0x000000000001e875 /system/lib/libc.so (__start_thread+24)

崩溃版本:axmol-2.1.2
崩溃手机:Realme RMX1941 (realme C2)
崩溃系统:Android 9 (SDK 28)
崩溃堆栈:
backtrace:
#00 pc 0x000000000002a090 /vendor/lib64/egl/libGLESv2_mtk.so
#1 pc 0x0000000000026078 /vendor/lib64/egl/libGLESv2_mtk.so
#2 pc 0x0000000000025824 /vendor/lib64/egl/libGLESv2_mtk.so (glDrawElements+140)
#3 pc 0x0000000000919624 /data/app/==/split_config.arm64_v8a.apk (ax::backend::CommandBufferGL::drawElements(ax::backend::PrimitiveType, ax::backend::IndexFormat, unsigned long, unsigned long, bool)+176)
#4 pc 0x00000000008fb484 /data/app/
==/split_config.arm64_v8a.apk (ax::Renderer::drawCustomCommand(ax::RenderCommand*)+372)
#5 pc 0x00000000008faad4 /data/app/==/split_config.arm64_v8a.apk (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368)
#6 pc 0x00000000008fa818 /data/app/
==/split_config.arm64_v8a.apk (ax::Renderer::processGroupCommand(ax::GroupCommand*)+224)
#7 pc 0x00000000008fac98 /data/app/==/split_config.arm64_v8a.apk (ax::Renderer::processRenderCommand(ax::RenderCommand)+128)
#8 pc 0x00000000008faad4 /data/app/
==/split_config.arm64_v8a.apk (ax::Renderer::visitRenderQueue(ax::RenderQueue&)+368)
#9 pc 0x00000000008fb600 /data/app/
==/split_config.arm64_v8a.apk (ax::Renderer::render()+84)
#10 pc 0x00000000008a5bec /data/app/
==/split_config.arm64_v8a.apk (ax::Scene::render(ax::Renderer, ax::Mat4 const&, ax::Mat4 const*)+248)
#11 pc 0x0000000000935ec4 /data/app/==/split_config.arm64_v8a.apk (ax::Director::drawScene()+372)
#12 pc 0x0000000000938248 /data/app/
==/split_config.arm64_v8a.apk (ax::Director::mainLoop()+124)
#13 pc 0x0000000000059f70 /data/app/==/oat/arm64/base.odex (org.axmol.lib.AxmolRenderer.nativeDeleteBackward [DEDUPED]+144)
#14 pc 0x00000000000afcd0 /data/app/
==/oat/arm64/base.odex (org.axmol.lib.AxmolRenderer.onDrawFrame+128)
#15 pc 0x0000000000a8e950 /system/framework/arm64/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+4000)
#16 pc 0x0000000000a8fa10 /system/framework/arm64/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+224)
#17 pc 0x0000000000562f88 /system/lib64/libart.so (art_quick_invoke_stub+584)
#18 pc 0x00000000000d0340 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#19 pc 0x00000000004668e0 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#20 pc 0x00000000004679a8 /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
#21 pc 0x0000000000494a38 /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1120)
#22 pc 0x0000000000084bd4 /system/lib64/libc.so (__pthread_start(void*)+36)
#23 pc 0x000000000002344c /system/lib64/libc.so (__start_thread+68)

``

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

We are also confused and don't know how to fix this problem. According to logical reasoning, it is obviously unreasonable that adding or deleting a character will call the deleteBackward function exponentially. It is very annoying to copy a page of text content at one time and then add or change the text content. In this way, deleteBackward will be called a large number of times for each change, which will also cause the program to freeze for a short time, because the call of JNI function consumes a lot of performance and will cause the interface to freeze.

When you state "copy a page of text content", do you mean that the user is not just typing one character at a time, but copying and pasting large amounts of text into a text field? If that is the case, then on average, how much text would be copied into the text field?

@cxcxiaochuan
Copy link
Author

cxcxiaochuan commented Nov 26, 2024

We are also confused and don't know how to fix this problem. According to logical reasoning, it is obviously unreasonable that adding or deleting a character will call the deleteBackward function exponentially. It is very annoying to copy a page of text content at one time and then add or change the text content. In this way, deleteBackward will be called a large number of times for each change, which will also cause the program to freeze for a short time, because the call of JNI function consumes a lot of performance and will cause the interface to freeze.

When you state "copy a page of text content", do you mean that the user is not just typing one character at a time, but copying and pasting large amounts of text into a text field? If that is the case, then on average, how much text would be copied into the text field?

What I mean is that users can copy a lot of text content, paste it into the text box, and then modify it. The amount of content copied depends on the user, and we can't measure it. Whether the user enters characters one by one depends on the user's needs, and we can't judge it. But for example, when entering special characters such as emoji, sometimes it is difficult to input on the phone, so copying the special characters on the web page and using them is also a way.

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

What I mean is that users can copy a lot of text content, paste it into the text box, and then modify it. The amount of copied content depends on the user and we have no way to measure it.

I understand.

Now, we need to clarify the cases that cause the crash, so please indicate which of the following scenarios is causing a crash for you:

1 - Typing one character at a time
2 - Deleting one character at a time
3 - Inserting a block of text into the text field (copy & paste)
4 - Deleting a large amount of text by selecting text then deleting (such as Select All then Delete via the virtual keyboard)

Cases 1 and 2 should not cause any crashes at all, but there is a possibility that case 4 would. I'm not sure about case 3.

@cxcxiaochuan
Copy link
Author

What I mean is that users can copy a lot of text content, paste it into the text box, and then modify it. The amount of copied content depends on the user and we have no way to measure it.

I understand.

Now, we need to clarify the cases that cause the crash, so please indicate which of the following scenarios is causing a crash for you:

1 - Typing one character at a time 2 - Deleting one character at a time 3 - Inserting a block of text into the text field (copy & paste) 4 - Deleting a large amount of text by selecting text then deleting (such as Select All then Delete via the virtual keyboard)

Cases 1 and 2 should not cause any crashes at all, but there is a possibility that case 4 would. I'm not sure about case 3.

We can't judge it either. We don't have such detailed records of the problem points. Sorry, we can't give detailed suggestions.

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

We can't judge it either. We don't have such detailed records of the problem points. Sorry, we can't give detailed suggestions.

I'm going to submit a PR with a possible solution to case 3, so selecting a large amount of text, then deleting it, will no longer cause multiple calls to deleteBackward. I've tested this on Android by using select al, then backspace, and it only calls it once.

@cxcxiaochuan
Copy link
Author

Thanks for the optimization. Hope this fixes the problem.

@rh101
Copy link
Contributor

rh101 commented Nov 26, 2024

Please try the changes in #2248 to see if it fixes the issue

@rh101
Copy link
Contributor

rh101 commented Nov 27, 2024

@cxcxiaochuan Does #2248 solve the problem for you?

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

No branches or pull requests

2 participants