hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
10.86k stars 651 forks source link

cmd/ebitenmobile: an application does not gracefully shutdown when a context lost happens #3097

Closed hajimehoshi closed 2 weeks ago

hajimehoshi commented 2 weeks ago

Ebitengine Version

v2.8.0-alpha.7

Operating System

Go Version (go version)

go version go1.22.6 darwin/arm64

What steps will reproduce the problem?

  1. Create an Android application (without setting RunGameOptions.StrictContextRestoration)
  2. Run it on a desktop emulator
  3. Change the size several times

What is the expected result?

The application is shut down gracefully

What happens instead?

The application crashes

 backtrace:
#00 pc 000000000004c300  /vendor/lib64/libGLESv2_enc.so (GL2Encoder::calcIndexRange(void const*, unsigned int, int, int*, int*)+648) (BuildId: c30caff2bc19628894a5d733c30f11c8)
#01 pc 0000000000032464  /vendor/lib64/libGLESv2_enc.so (GL2Encoder::s_glDrawElements(void*, unsigned int, int, unsigned int, void const*)+764) (BuildId: c30caff2bc19628894a5d733c30f11c8)
#02 pc 0000000000929bc8  /data/app/~~ahlPCRp7gcHeRgBXBbvssQ==/com.rpgsnack.snowman-qaZlRn0KhhXbpWjv7LsNdA==/base.apk

Anything else you feel useful to add?

No response

hajimehoshi commented 2 weeks ago

If this works well, it might be better to cherry-pick the fix to 2.7.