Closed Filazapovich closed 4 years ago
Hm, looks like a deadlock on the engine thread by the event mutex we have there.
Thanks for the suggestions as well regarding the event loop. It's definitely something we should look into in the future :)
Do you have more complete logs?
I have but i can't download them from Google Play Console. I can prepare this information manually but it requires some time.
Do you have a window callback in any scripts? (i.e window.set_listener(window_callback))
Yep. But i don't see any criminal activity here for focus lost:
if event == window.WINDOW_EVENT_FOCUS_LOST then
focus_lost_time = socket.gettime()
end
What engine version is this running?
1.2.161 (but we have the same ANR reports for 1.2.159, 1.2.157, 1.2.156, 1.2.155 and lower)
We got more ANR's, and the big part of them with trace:
> Main Thread
#00 pc 000000000007ac48 /system/lib64/libc.so (__epoll_pwait+8)
#01 pc 0000000000014d48 /system/lib64/libutils.so (android::Looper::pollInner(int)+148)
#02 pc 0000000000014c18 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+60)
#03 pc 0000000000127dbc /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
..
> Engine Thread
#00 pc 000000000001f46c /system/lib64/libc.so (syscall+28)
#01 pc 00000000000226a4 /system/lib64/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
#02 pc 000000000008f86c /system/lib64/libc.so (pthread_cond_wait+60)
#03 pc 0000000000018920 /system/lib64/libwilhelm.so (android::CallbackProtector::requestCbExitAndWait()+72)
#04 pc 0000000000013df8 /system/lib64/libwilhelm.so (android_audioPlayer_preDestroy(CAudioPlayer_struct*)+136)
#05 pc 0000000000022738 /system/lib64/libwilhelm.so (CAudioPlayer_PreDestroy(void*)+8)
#06 pc 000000000002a1d0 /system/lib64/libwilhelm.so (IObject_Destroy(SLObjectItf_ const* const*)+72)
#07 pc 0000000000475f28 /data/app/com.MelsoftGames.FamilyIslandFarm-nUewdM87acHpvKjqUjdU2Q==/lib/arm64/libFamilyIsland.so (dmDeviceOpenSL::DeviceOpenSLClose(void*)+164)
#08 pc 0000000000464890 /data/app/com.MelsoftGames.FamilyIslandFarm-nUewdM87acHpvKjqUjdU2Q==/lib/arm64/libFamilyIsland.so (dmSound::Finalize()+256)
#09 pc 00000000001125d8 /data/app/com.MelsoftGames.FamilyIslandFarm-nUewdM87acHpvKjqUjdU2Q==/lib/arm64/libFamilyIsland.so (dmEngine::Delete(dmEngine::Engine*)+204)
#10 pc 00000000001152cc /data/app/com.MelsoftGames.FamilyIslandFarm-nUewdM87acHpvKjqUjdU2Q==/lib/arm64/libFamilyIsland.so (_ZN8dmEngine6LaunchEiPPcPFvPNS_6EngineEPvES6_S4_+112)
...
Looks like deadlock?
As we asked before, may it be something wrong with dmDeviceOpenSL::DeviceOpenSLClose
?
Should we make another issue on sound ANR's?
We have several ANR traces with some categorization in attachments, it may help you? Separate zip file with only sound ANR's.
We again above of ANR threshold, so we want to investigate in this problems. Ping @britzl @jhonnyking
We still using defold 1.2.161
. Reboot game via
timer.delay(0, false, function()
msg.post("@system:", "reboot")
end)
We have a loop during shutdown that waits for sound buffers to close. I will investigate a better solution.
This has been fixed and will be released in 1.2.165
Too many ANRs (~60%) look like:
ANR with the same call stack:
Things about that:
reboot
message to reset local state of lua modules in cases with unrecoverable errors related to client-server. User can tap screen while reboot in progress. But this input events is not ignored and cannot be processed.ALooper_poll...
? Input events should be pushed from main thread to engine thread instead of polling them in engine thread.dmDeviceOpenSL::DeviceOpenSLClose
?And please add the name to engine thread for better analysis of ANRs: Thread-13586 (or other thread id as number that is generated by OS is not a good solution)