Opened 4 years ago

Closed 3 years ago

#12095 closed defect (fixed)

BACKENDS: ANDROID: Crash when resuming app while playing a game

Reported by: antoniou79 Owned by: AndywinXp
Priority: high Component: Port: Android
Version: Keywords: crash, Android 10, resume
Cc: Game: Monkey Island 3

Description

I got this a bunch of times (three or four) lately, when playing CoMI (first screen puzzles) on my Android 10 device (smartphone Mi Note 9 Pro). I am unsure if the issue is specific to Android 10 device or to the CoMI game.

Putting the device to "sleep" and then, after a while, resuming the app, leads to a crash to the Home screen. Oddly, it does not happen every time, and it seems that some (significant) time must pass with the device being in sleep/suspend mode, before the issue occurs. Maybe after a while in sleep mode, the device releases some resource (or completely shuts down the app?).

As a possibly related bug, I also got a corrupted save game (again in the first screen) but failed to record the issue with it (when trying to load it, it displayed a message but I forgot to store it somehow). I haven't been able to reproduce this one though. This is with disabled Cloud Saving (so it's not a side-effect of that module).

I will be debugging this one, since I am not sure what the cause is as of yet.

This is with the 2.3.0git version (recent daily build).

Change History (4)

comment:1 by antoniou79, 4 years ago

Upon further inspection, it seems that the reason for this (or one of the reasons) is code related to iMuse.

Related side-effect that occurs before crashing is that the music starts playing faster or on top of itself maybe (it sounds kind of garbled), as if trying to catch up with the time the device was pause/suspended).

I've tested with today's code (my own Android build, same toolchain as buildbot) and the issue persists. The crash still does not occur always -- it seems that at the very least needs a few minutes to pass with the app suspended.

2021-02-21 15:01:31.687 28901-30391/? A/ScummVM: Assertion failure: '0 <= index && index < _numFiles' in engines/scumm/imuse_digi/dimuse_bndmgr.cpp:267 (int32 Scumm::BundleMgr::decompressSampleByIndex(int32, int32, int32, byte **, int, bool, bool &))
2021-02-21 15:01:31.688 28901-30391/? A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 30391 (Thread-7), pid 28901 (scummvm.scummvm)
2021-02-21 15:01:31.758 4614-6085/? W/MiuiPerfServiceClient: interceptAndQueuing:2364|com.android.systemui|832|360|unknown|null|StatusBar|18547166255839|Slow main thread|6
2021-02-21 15:01:31.932 691-1394/? I/miuiFirewall: mPackageInfoMap is empty! pid: 3013 , uid: 10194
2021-02-21 15:01:31.933 691-1394/? I/miuiFirewall: mPackageInfoMap is empty! pid: 3013 , uid: 10194
2021-02-21 15:01:31.936 31036-31036/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2021-02-21 15:01:31.939 1292-1292/? I//system/bin/tombstoned: received crash request for pid 30391
2021-02-21 15:01:31.940 31036-31036/? I/crash_dump64: performing dump of process 28901 (target tid = 30391)
2021-02-21 15:01:31.954 31036-31036/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-02-21 15:01:31.955 31036-31036/? A/DEBUG: Build fingerprint: 'Redmi/joyeuse_eea/joyeuse:10/QKQ1.191215.002/V12.0.2.0.QJZEUXM:user/release-keys'
2021-02-21 15:01:31.955 31036-31036/? A/DEBUG: Revision: '0'
2021-02-21 15:01:31.955 31036-31036/? A/DEBUG: ABI: 'arm64'
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG: Timestamp: 2021-02-21 15:01:31+0200
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG: pid: 28901, tid: 30391, name: Thread-7  >>> org.scummvm.scummvm <<<
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG: uid: 10257
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG: Abort message: 'Assertion failure: '0 <= index && index < _numFiles' in engines/scumm/imuse_digi/dimuse_bndmgr.cpp:267 (int32 Scumm::BundleMgr::decompressSampleByIndex(int32, int32, int32, byte **, int, bool, bool &))'
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x0  0000000000000000  x1  00000000000076b7  x2  0000000000000006  x3  00000075014fb370
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x4  feff034cff4c556c  x5  feff034cff4c556c  x6  feff034cff4c556c  x7  7f7f7f7f7f7f7f7f
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x8  00000000000000f0  x9  881352c85a19785d  x10 0000000000000001  x11 0000000000000000
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x12 fffffff0fffffbdf  x13 ffffffffffffffff  x14 0000000000000004  x15 ffffffffffffffff
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x16 00000075948a68c0  x17 0000007594882a50  x18 000000749f4e8000  x19 00000000000070e5
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x20 00000000000076b7  x21 00000000ffffffff  x22 0000000000000003  x23 00000074a8d7a950
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x24 000000000000044e  x25 0000000000000001  x26 0000000000000000  x27 000000749ea41800
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     x28 0000000000000007  x29 00000075014fb410
2021-02-21 15:01:31.956 31036-31036/? A/DEBUG:     sp  00000075014fb350  lr  00000075948340c4  pc  00000075948340f0
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG: backtrace:
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #00 pc 00000000000830f0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: 1eb18e444251dc07dff5ebd93fce105c)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #01 pc 0000000000008a14  /system/lib64/liblog.so (__android_log_assert+328) (BuildId: b0a676d291f62cc3b051ab65d26fb52d)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #02 pc 000000000163dbe4  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (__assert2+40) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #03 pc 0000000001759960  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (Scumm::BundleMgr::decompressSampleByIndex(int, int, int, unsigned char**, int, bool, bool&)+864) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #04 pc 000000000167f740  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (Scumm::ImuseDigiSndMgr::openSound(int, char const*, int, int, int)+616) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #05 pc 0000000001681c84  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (Scumm::IMuseDigital::startSound(int, char const*, int, int, Audio::AudioStream*, int, int, int, Scumm::Track*)+500) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #06 pc 0000000001680ff8  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (Scumm::IMuseDigital::startMusicWithOtherPos(char const*, int, int, int, Scumm::Track*)+120) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #07 pc 000000000167c7ec  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (Scumm::IMuseDigital::runScheduledCrossfades()+128) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #08 pc 000000000167a5b8  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (Scumm::IMuseDigital::callback()+60) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #09 pc 000000000316ba4c  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (DefaultTimerManager::handler()+204) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #10 pc 000000000163e48c  /data/app/org.scummvm.scummvm-kHLHG54nuPS9H4xao-5FoQ==/lib/arm64/libscummvm.so (OSystem_Android::timerThreadFunc(void*)+196) (BuildId: 0898b453d17c5bd9b11173c7770bb1654f43b852)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #11 pc 00000000000e69e0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 1eb18e444251dc07dff5ebd93fce105c)
2021-02-21 15:01:31.991 31036-31036/? A/DEBUG:       #12 pc 0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 1eb18e444251dc07dff5ebd93fce105c)
2021-02-21 15:01:32.336 790-911/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: suspend_playback=false
2021-02-21 15:01:32.336 790-911/? D/audio_hw_extn: audio_extn_fm_set_parameters: Enter
2021-02-21 15:01:32.336 790-911/? D/audio_hw_hfp: hfp_set_parameters: enter
2021-02-21 15:01:32.379 790-911/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: suspend_playback=true
2021-02-21 15:01:32.379 790-911/? D/audio_hw_extn: audio_extn_fm_set_parameters: Enter
2021-02-21 15:01:32.379 790-911/? D/audio_hw_hfp: hfp_set_parameters: enter
2021-02-21 15:01:32.533 31036-31036/? E/crash_dump64: cannot open libmiuindbg.so: No such file or directory
2021-02-21 15:01:32.534 1292-1292/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_02
2021-02-21 15:01:32.536 1781-31040/? I/DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
2021-02-21 15:01:32.537 1781-31039/? W/ActivityTaskManager:   Force finishing activity org.scummvm.scummvm/.ScummVMActivity

At one time I got multiple identical warnings instead of the crash.

W/ScummVM: WARNING: IMuseDigital::startSound() Can't start sound - no free slots!

comment:2 by antoniou79, 4 years ago

Further observations on the issue.

It seems that the crash does not occur (after a day's testing) on the 2.2.1pre stable Android port version.
The music may become garbled, like tracks playing on top of one another, after suspending the device and resuming a few times --allowing for sufficient time (like more than 15 minutes) to pass between suspend and resume. But it won't crash in that version.

comment:3 by sev-, 3 years ago

Priority: blockerhigh

This would be nice to fix before the release.

comment:4 by antoniou79, 3 years ago

Owner: set to AndywinXp
Resolution: fixed
Status: newclosed

The crash reported in this ticket is fixed with the merged PR by AndywinXp:
https://github.com/scummvm/scummvm/pull/3203

More work is needed for the pause/resume code in Android but that is out of scope for this report.

I'm closing it as fixed.

Note: See TracTickets for help on using tickets.