effekseer / Effekseer

MIT License
1.49k stars 219 forks source link

Crash - Android - OpenGL #906

Open daldegam opened 2 years ago

daldegam commented 2 years ago

I have some crashes happening on some Android devices. I can't reproduce the crash, but I have hundreds of reports in Firebase Crashlytics.

The details I have are:

Version I'm using: 161c

Location: [EffekseerRenderer.StandardRenderer.h:918]

backtrace:

  #00  pc 0x00000000000706d8  /apex/com.android.runtime/lib64/bionic/libc.so (memcpy+280)
  #01  pc 0x000000000012ee50  /vendor/lib64/egl/libGLESv2_adreno.so (!!!0000!77df12deb6a622478efa8fb9929034!8c08135!+968)
  #02  pc 0x0000000000759a60  [...].so (EffekseerRenderer::StandardRenderer<EffekseerRendererGL::RendererImplemented, EffekseerRendererGL::Shader>::Rendering_(Effekseer::SIMD::Mat44f const&, Effekseer::SIMD::Mat44f const&, int, int, int, int, EffekseerRenderer::StandardRendererState const&)+918)
  #03  pc 0x00000000007586bc  [...].so (EffekseerRenderer::StandardRenderer<EffekseerRendererGL::RendererImplemented, EffekseerRendererGL::Shader>::Rendering()+503)
  #04  pc 0x00000000007568bc  [...].so (EffekseerRendererGL::RendererImplemented::EndRendering()+422)

The crash happens on devices with different versions of android, from 5 to 12.

I know I'm using a slightly old version, I'll update to 1.70 to see if that fixes it.

But anyway, I thought I'd better report it to see if it's something still unknown.

If you have anything I can provide to clarify what it could be, let me know.

Thanks

durswd commented 2 years ago

It seems that the error occurs with glDrawElements. I need more detail or an environment where I reproduce the error.

durswd commented 2 years ago

What the maximum number of sprite do you set?

https://github.com/effekseer/Effekseer/blob/master/Dev/Cpp/EffekseerRendererGL/EffekseerRendererGL.h#L642 squareMaxCount

durswd commented 2 years ago

I checked release notes and I didn't find a log to fix this bug. But OpenGL renderer was changed in current master branch. It is possible that the bug has been fixed.

daldegam commented 4 months ago

Hello! A long time has passed. I did some tests with effekseer in production. I'm using version 1.70e, and the crash still persists.

Regarding the squareMaxCount number, I am using 4000.

I initialize the renderer like this: auto renderer = ::EffekseerRendererGL::Renderer::Create(4000, EffekseerRendererGL::OpenGLDeviceType::OpenGLES3);

When the device uses OpenGL2 I do not initialize Effekseer.

A new stacktrace:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 32311

backtrace:
  #00  pc 0x0000000000089214  /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+36)
  #01  pc 0x000000000016ec58  /vendor/lib64/egl/libGLESv2_adreno.so (!!!0000!77df12deb6a622478efa8fb9929034!43fc279f3a!+1200)
  #02  pc 0x00000000007d5ad8  [...].so (EffekseerRenderer::StandardRenderer<EffekseerRendererGL::RendererImplemented, EffekseerRendererGL::Shader>::Rendering_(Effekseer::SIMD::Mat44f const&, Effekseer::SIMD::Mat44f const&, int, int, int, int, EffekseerRenderer::StandardRendererState const&)+4844) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #03  pc 0x00000000007d46d4  [...].so (EffekseerRenderer::StandardRenderer<EffekseerRendererGL::RendererImplemented, EffekseerRendererGL::Shader>::Rendering()+688) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #04  pc 0x00000000007d0820  [...].so (EffekseerRendererGL::RendererImplemented::EndRendering()+20) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #05  pc 0x000000000035728c  [...].so (EffectEngine::Render(int, int)) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #06  pc 0x00000000006db320  [...].so (RenderMainScene()) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #07  pc 0x00000000006dbaf4  [...].so (MainScene()) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #08  pc 0x00000000006dc6c8  [...].so (Scene()) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #09  pc 0x00000000002cc114  [...].so (NativeEngine::DrawScene()) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #10  pc 0x00000000002ce514  [...].so (Java_com_game_RendererWrapper_on_1draw_1frame+36) (BuildId: fa7f79f30d3cae2403d85a751f0341884d95c65f)
  #11  pc 0x0000000000351e30  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
  #12  pc 0x00000000020015a8  /memfd:jit-cache (com.game.RendererWrapper.onDrawFrame+72)
  #13  pc 0x00000000005ba720  /apex/com.android.art/lib64/libart.so (nterp_helper+7712)
  #14  pc 0x00000000004c6326  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.guardedRun+1126)
  #15  pc 0x00000000005b9854  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #16  pc 0x00000000004c6988  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.run+52)
  #17  pc 0x000000000033b3a4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
  #18  pc 0x000000000023a5d0  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144)
  #19  pc 0x0000000000539a7c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1600)
  #20  pc 0x00000000000f57c8  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
  #21  pc 0x000000000008f1bc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68)

Sorry for the long delay. I will respond in time now.

Thanks.