libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.71k stars 1.8k forks source link

Android: crash SDL_LockJoysticks() #7811

Closed 1bsyl closed 1 year ago

1bsyl commented 1 year ago

I've seen this rare crash log:

FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xe00edeb8)

backtrace:
  #00  pc 0x000000000005ec56  /apex/com.android.runtime/lib/bionic/libc.so (abort+166)
  #01  pc 0x00000000000a72dd  /apex/com.android.runtime/lib/bionic/libc.so (__fortify_fatal(char const*, ...)+32)
  #02  pc 0x00000000000a6ae5  /apex/com.android.runtime/lib/bionic/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+20)
  #03  pc 0x00000000000a69d3  /apex/com.android.runtime/lib/bionic/libc.so (pthread_mutex_lock+138)
  #04  pc 0x00000000002290df  (SDL_LockMutex+4096)
  #05  pc 0x000000000021ef13  (SDL_LockJoysticks+4096)
  #06  pc 0x0000000000221835  (Android_OnPadUp+4096)
  #07  pc 0x000000000002f63f  (art_jni_trampoline+102)
  #08  pc 0x0000000000042715  (org.libsdl.app.SDLActivity.handleKeyEvent+276)
  #09  pc 0x0000000000045f3b  (org.libsdl.app.SDLSurface.onKey+58)

This seems to happen on tv / set-top box. Possible scenario: user press a key to exit, things get terminated on key PadDown(). But the key PadUp() is also sent right after and tries to lock the joystick mutex. The un-initialization process from PadDown event unlocks and destroys the mutex (https://github.com/libsdl-org/SDL/blob/main/src/joystick/SDL_joystick.c#L155), which triggers the 'pthread_mutex_lock called on a destroyed mutex" while sending the PadUp()

1bsyl commented 1 year ago

@AntTheAlchemist are you also seeing this one ?

1bsyl commented 1 year ago

not to destroy the mutex, seems the easiest fix! other solution, we would to double protect SDL_JoystickLock() and Unlock(), with also locking Android_ActivityMutex ...

slouken commented 1 year ago

We should be protected against the case where the mutex is currently being held. It's supposed to destroy itself on the last unlock. Please back out your last change and let's figure out why this is happening?

1bsyl commented 1 year ago

yes, maybe:

void SDL_LockJoysticks(void)
{
    SDL_LockMutex(SDL_joystick_lock);
    ++SDL_joysticks_locked;

should be

void SDL_LockJoysticks(void)
{
    ++SDL_joysticks_locked;
    SDL_LockMutex(SDL_joystick_lock);

and also for Unlock

void SDL_UnlockJoysticks(void)
{
    SDL_UnlockMutex(SDL_joystick_lock);
  --SDL_joysticks_locked;

but there still could be a lock done just before SDL_DestroyMutex() ... so don't know

slouken commented 1 year ago

Yeah, there's a huge set of race conditions here. Hmm...

slouken commented 1 year ago

Okay, I have a fix that should work. It's not 100% perfect, but it minimizes the window where it could happen to a task switch between exactly two instructions.

AntTheAlchemist commented 1 year ago

@1bsyl As a crash, no. I've had 1 Joystick related crash in the last 60 days, on a phone: [split_config.arm64_v8a.apk!libSDL3.so] HIDAPI_JoystickClose. My app will exit on PadUp(), though. All actions happen on a button release.

I am getting hundreds of SDL_LockMutex ANRs though, did you mean ANRs or crashes? There are many variations. Here's a few samples of this type of ANR which is specifically happening on TV devices (interesting to note that Google Play Console reports most of these happening with background visibility):

[split_config.armeabi_v7a.apk!libSDL3.so] SDL_LockMutex

TCL G07 (G07_4K_GB_NF) Android 11 (SDK 30) ``` "Signal Catcher" tid=3 Runnable #00 pc 0x000000000037ada1 /apex/com.android.art/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+76) #01 pc 0x000000000044c0a1 /apex/com.android.art/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream >&, bool, BacktraceMap*, bool) const+388) #02 pc 0x00000000004477e7 /apex/com.android.art/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream >&, bool, BacktraceMap*, bool) const+34) #03 pc 0x0000000000464c8d /apex/com.android.art/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+688) #04 pc 0x000000000046014f /apex/com.android.art/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+354) #05 pc 0x000000000045f647 /apex/com.android.art/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream >&, bool)+1514) #06 pc 0x000000000045ed07 /apex/com.android.art/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream >&)+638) #07 pc 0x0000000000416803 /apex/com.android.art/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream >&)+130) #08 pc 0x00000000004269e9 /apex/com.android.art/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1028) #09 pc 0x0000000000425d7f /apex/com.android.art/lib/libart.so (art::SignalCatcher::Run(void*)+250) #10 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #11 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "SDLActivity" tid=1 Native #00 pc 0x000000000003419c /apex/com.android.runtime/lib/bionic/libc.so (syscall+28) #01 pc 0x00000000000392ff /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+94) #02 pc 0x0000000000081d43 /apex/com.android.runtime/lib/bionic/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+414) #03 pc 0x00000000000648ab /data/app/~~h7iDB2qdkZXvt-ALPhXA0Q==/uk.co.***.***-H4d1m0UeM-xuvty5zruZsg==/split_config.armeabi_v7a.apk!libSDL3.so (SDL_LockMutex+6) #04 pc 0x000000000004764b /data/app/~~h7iDB2qdkZXvt-ALPhXA0Q==/uk.co.***.***-H4d1m0UeM-xuvty5zruZsg==/split_config.armeabi_v7a.apk!libSDL3.so (SDL_LockJoysticks+10) #05 pc 0x000000000004a441 /data/app/~~h7iDB2qdkZXvt-ALPhXA0Q==/uk.co.***.***-H4d1m0UeM-xuvty5zruZsg==/split_config.armeabi_v7a.apk!libSDL3.so at org.libsdl.app.SDLControllerManager.onNativePadUp (SDLControllerManager.java) at org.libsdl.app.SDLActivity.b (SDLActivity.java:47) at org.libsdl.app.SDLSurface.onKey (SDLSurface.java) at android.view.View.dispatchKeyEvent (View.java:14249) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1959) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1959) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1959) at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:476) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1861) at android.app.Activity.dispatchKeyEvent (Activity.java:4085) at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java) at com.android.internal.policy.DecorView.dispatchKeyEvent (DecorView.java:390) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent (ViewRootImpl.java:6165) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:6014) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5480) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5537) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5503) at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5678) at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5511) at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5735) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5484) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5537) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5503) at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5511) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5484) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5537) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5503) at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5711) at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent (ViewRootImpl.java:5869) at android.view.inputmethod.InputMethodManager$PendingEvent.run (InputMethodManager.java:3179) at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback (InputMethodManager.java:2721) at android.view.inputmethod.InputMethodManager.finishedInputEvent (InputMethodManager.java:2712) at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished (InputMethodManager.java:3156) at android.view.InputEventSender.dispatchInputEventFinished (InputEventSender.java:143) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.app.ActivityThread.main (ActivityThread.java:7848) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1070) "FinalizerDaemon" tid=7 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:190) at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:211) at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:273) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923) "Jit thread pool worker thread 0" tid=8 Native #00 pc 0x000000000003419c /apex/com.android.runtime/lib/bionic/libc.so (syscall+28) #01 pc 0x0000000000131005 /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88) #02 pc 0x000000000046619f /apex/com.android.art/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+54) #03 pc 0x00000000004658b9 /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Run()+76) #04 pc 0x000000000046550b /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+114) #05 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #06 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "HeapTaskDaemon" tid=9 Waiting #00 pc 0x00000000000341a0 /apex/com.android.runtime/lib/bionic/libc.so (syscall+32) #01 pc 0x00000000001312d9 /apex/com.android.art/lib/libart.so (art::ConditionVariable::TimedWait(art::Thread*, long long, int)+116) #02 pc 0x000000000021a00b /apex/com.android.art/lib/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+314) #03 pc 0x000000000021a72d /apex/com.android.art/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+48) at dalvik.system.VMRuntime.runHeapTasks (Native method) at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:531) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923) "ReferenceQueueDaemon" tid=10 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.Object.wait (Object.java:568) at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:217) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923) "FinalizerWatchdogDaemon" tid=11 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.Object.wait (Object.java:568) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:341) at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:321) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923) "Binder:1170_1" tid=12 Native #00 pc 0x0000000000071258 /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8) #01 pc 0x000000000003f2cb /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26) #02 pc 0x0000000000039c1b /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238) #03 pc 0x0000000000039d75 /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8) #04 pc 0x000000000003a45b /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38) #05 pc 0x0000000000053ffd /system/lib/libbinder.so (android::PoolThread::threadLoop()+12) #06 pc 0x000000000000ed4b /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170) #07 pc 0x000000000006d497 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86) #08 pc 0x000000000000e889 /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264) #09 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #10 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "Binder:1170_2" tid=13 Native #00 pc 0x0000000000071258 /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8) #01 pc 0x000000000003f2cb /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26) #02 pc 0x0000000000039c1b /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238) #03 pc 0x0000000000039d75 /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8) #04 pc 0x000000000003a45b /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38) #05 pc 0x0000000000053ffd /system/lib/libbinder.so (android::PoolThread::threadLoop()+12) #06 pc 0x000000000000ed4b /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170) #07 pc 0x000000000006d497 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86) #08 pc 0x000000000000e889 /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264) #09 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #10 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "Binder:1170_3" tid=14 Native #00 pc 0x0000000000071258 /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8) #01 pc 0x000000000003f2cb /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26) #02 pc 0x0000000000039c1b /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238) #03 pc 0x0000000000039d75 /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8) #04 pc 0x000000000003a45b /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38) #05 pc 0x0000000000053ffd /system/lib/libbinder.so (android::PoolThread::threadLoop()+12) #06 pc 0x000000000000ed4b /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170) #07 pc 0x000000000006d497 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86) #08 pc 0x000000000000e889 /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264) #09 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #10 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "Profile Saver" tid=15 Native #00 pc 0x000000000003419c /apex/com.android.runtime/lib/bionic/libc.so (syscall+28) #01 pc 0x0000000000131005 /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88) #02 pc 0x000000000026e1f7 /apex/com.android.art/lib/libart.so (art::ProfileSaver::Run()+494) #03 pc 0x0000000000271bd3 /apex/com.android.art/lib/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+106) #04 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #05 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "WM.task-1" tid=16 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "bm" tid=17 Native #00 pc 0x0000000000072334 /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20) #01 pc 0x0000000000043d7d /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16) #02 pc 0x0000000000011bb1 /system/lib/libutils.so (android::Looper::pollInner(int)+128) #03 pc 0x0000000000011ad7 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) #04 pc 0x00000000000bb005 /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.os.HandlerThread.run (HandlerThread.java:67) "bc" tid=18 Native #00 pc 0x000000000003419c /apex/com.android.runtime/lib/bionic/libc.so (syscall+28) #01 pc 0x0000000000131005 /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88) #02 pc 0x00000000004d91e3 /apex/com.android.art/lib/libart.so (art::GoToRunnable(art::Thread*)+342) #03 pc 0x00000000004d9065 /apex/com.android.art/lib/libart.so (art::JniMethodEnd(unsigned int, art::Thread*)+8) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.os.HandlerThread.run (HandlerThread.java:67) "RenderThread" tid=19 Native #00 pc 0x0000000000072334 /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20) #01 pc 0x0000000000043d7d /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16) #02 pc 0x0000000000011bb1 /system/lib/libutils.so (android::Looper::pollInner(int)+128) #03 pc 0x0000000000011ad7 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) #04 pc 0x00000000001431af /system/lib/libhwui.so (android::uirenderer::ThreadBase::waitForWork()+86) #05 pc 0x000000000015ac8d /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+52) #06 pc 0x000000000000ed4b /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170) #07 pc 0x000000000000e889 /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264) #08 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #09 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "WM.task-2" tid=21 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "hwuiTask0" tid=22 Native #00 pc 0x000000000003419c /apex/com.android.runtime/lib/bionic/libc.so (syscall+28) #01 pc 0x00000000000392ff /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+94) #02 pc 0x00000000000807a3 /apex/com.android.runtime/lib/bionic/libc.so (pthread_cond_wait+32) #03 pc 0x000000000003d2f1 /system/lib/libc++.so (std::__1::condition_variable::wait(std::__1::unique_lock&)+8) #04 pc 0x000000000015d273 /system/lib/libhwui.so (android::uirenderer::CommonPool::workerLoop()+70) #05 pc 0x000000000015d3f1 /system/lib/libhwui.so (void* std::__1::__thread_proxy >, android::uirenderer::CommonPool::CommonPool()::$_0> >(void*)+88) #06 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #07 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "hwuiTask1" tid=23 Native #00 pc 0x000000000003419c /apex/com.android.runtime/lib/bionic/libc.so (syscall+28) #01 pc 0x00000000000392ff /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+94) #02 pc 0x00000000000807a3 /apex/com.android.runtime/lib/bionic/libc.so (pthread_cond_wait+32) #03 pc 0x000000000003d2f1 /system/lib/libc++.so (std::__1::condition_variable::wait(std::__1::unique_lock&)+8) #04 pc 0x000000000015d273 /system/lib/libhwui.so (android::uirenderer::CommonPool::workerLoop()+70) #05 pc 0x000000000015d3f1 /system/lib/libhwui.so (void* std::__1::__thread_proxy >, android::uirenderer::CommonPool::CommonPool()::$_0> >(void*)+88) #06 pc 0x000000000008115f /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #07 pc 0x0000000000039f5d /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) "PlayBillingLibrary-1" tid=24 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "PlayBillingLibrary-2" tid=25 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "PlayBillingLibrary-3" tid=26 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "GmsDynamite" tid=29 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.Object.wait (Object.java:568) at com.google.android.gms.dynamite.zza.run (zza.java) "ConnectivityThread" tid=32 Native #00 pc 0x0000000000072334 /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20) #01 pc 0x0000000000043d7d /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16) #02 pc 0x0000000000011bb1 /system/lib/libutils.so (android::Looper::pollInner(int)+128) #03 pc 0x0000000000011ad7 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) #04 pc 0x00000000000bb005 /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.os.HandlerThread.run (HandlerThread.java:67) "GoogleApiHandler" tid=34 Native #00 pc 0x0000000000072334 /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20) #01 pc 0x0000000000043d7d /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16) #02 pc 0x0000000000011bb1 /system/lib/libutils.so (android::Looper::pollInner(int)+128) #03 pc 0x0000000000011ad7 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) #04 pc 0x00000000000bb005 /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.os.HandlerThread.run (HandlerThread.java:67) "queued-work-looper" tid=35 Native #00 pc 0x0000000000072334 /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20) #01 pc 0x0000000000043d7d /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16) #02 pc 0x0000000000011bb1 /system/lib/libutils.so (android::Looper::pollInner(int)+128) #03 pc 0x0000000000011ad7 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) #04 pc 0x00000000000bb005 /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.os.HandlerThread.run (HandlerThread.java:67) "AdWorker(NG) #1" tid=38 Timed Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:1132) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:849) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "pool-6-thread-1" tid=39 Timed Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:1132) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:849) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) "Chrome_ProcessLauncherThread" tid=41 Native #00 pc 0x0000000000072334 /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20) #01 pc 0x0000000000043d7d /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16) #02 pc 0x0000000000011bb1 /system/lib/libutils.so (android::Looper::pollInner(int)+128) #03 pc 0x0000000000011ad7 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) #04 pc 0x00000000000bb005 /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:200) at android.os.HandlerThread.run (HandlerThread.java:67) "GoogleApiHandler" tid=43 Native ```
Metz shinagawa (METZ 2K TV) Android 9 (SDK 28) ``` "Signal Catcher" tid=3 Runnable #00 pc 0x00000000002e0297 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+134) #01 pc 0x0000000000377d3f /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream>&, bool, BacktraceMap*, bool) const+210) #02 pc 0x000000000037435b /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream>&, bool, BacktraceMap*, bool) const+34) #03 pc 0x000000000038d673 /system/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+674) #04 pc 0x0000000000387879 /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+320) #05 pc 0x0000000000386f59 /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream>&, bool)+792) #06 pc 0x0000000000386b6d /system/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream>&)+652) #07 pc 0x0000000000360265 /system/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream>&)+120) #08 pc 0x000000000036971d /system/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1036) #09 pc 0x0000000000368893 /system/lib/libart.so (art::SignalCatcher::Run(void*)+250) #10 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #11 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "SDLActivity" tid=1 Native #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x000000000001d125 /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88) #02 pc 0x0000000000064675 /system/lib/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+436) #03 pc 0x00000000000648ab /data/app/uk.co.***.***-fXKws6J4TnySo0goaKAYZw==/split_config.armeabi_v7a.apk (SDL_LockMutex+6) #04 pc 0x000000000004764b /data/app/uk.co.***.***-fXKws6J4TnySo0goaKAYZw==/split_config.armeabi_v7a.apk (SDL_LockJoysticks+10) #05 pc 0x000000000004a301 /data/app/uk.co.***.***-fXKws6J4TnySo0goaKAYZw==/split_config.armeabi_v7a.apk at org.libsdl.app.SDLControllerManager.onNativePadDown (SDLControllerManager.java) at org.libsdl.app.SDLActivity.b (SDLActivity.java:34) at org.libsdl.app.SDLSurface.onKey (SDLSurface.java) at android.view.View.dispatchKeyEvent (View.java:12446) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1896) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1896) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1896) at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:428) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1820) at android.app.Activity.dispatchKeyEvent (Activity.java:3361) at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java) at com.android.internal.policy.DecorView.dispatchKeyEvent (DecorView.java:342) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent (ViewRootImpl.java:5042) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:4910) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4431) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4484) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4450) at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:4590) at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4458) at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:4647) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4431) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4484) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4450) at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4458) at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4431) at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4484) at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4450) at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:4623) at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent (ViewRootImpl.java:4784) at android.view.inputmethod.InputMethodManager$PendingEvent.run (InputMethodManager.java:2571) at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback (InputMethodManager.java:2081) at android.view.inputmethod.InputMethodManager.finishedInputEvent (InputMethodManager.java:2072) at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished (InputMethodManager.java:2548) at android.view.InputEventSender.dispatchInputEventFinished (InputEventSender.java:141) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:326) at android.os.Looper.loop (Looper.java:160) at android.app.ActivityThread.main (ActivityThread.java:6718) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858) "Jit thread pool worker thread 0" tid=2 Native #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x00000000000a6c63 /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+86) #02 pc 0x000000000038e85b /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+170) #03 pc 0x000000000038e10f /system/lib/libart.so (art::ThreadPoolWorker::Run()+62) #04 pc 0x000000000038dd45 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+92) #05 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #06 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "ReferenceQueueDaemon" tid=4 Waiting at java.lang.Object.wait (Native method) at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:178) at java.lang.Daemons$Daemon.run (Daemons.java:103) at java.lang.Thread.run (Thread.java:764) "FinalizerDaemon" tid=5 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:422) at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:188) at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:209) at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:232) at java.lang.Daemons$Daemon.run (Daemons.java:103) at java.lang.Thread.run (Thread.java:764) "FinalizerWatchdogDaemon" tid=6 Waiting at java.lang.Object.wait (Native method) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:297) at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:277) at java.lang.Daemons$Daemon.run (Daemons.java:103) at java.lang.Thread.run (Thread.java:764) "HeapTaskDaemon" tid=7 Waiting #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x00000000000a6c63 /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+86) #02 pc 0x00000000001ac181 /system/lib/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+304) #03 pc 0x00000000001ac7d5 /system/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+48) at dalvik.system.VMRuntime.runHeapTasks (Native method) at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:475) at java.lang.Daemons$Daemon.run (Daemons.java:103) at java.lang.Thread.run (Thread.java:764) "Binder:424_1" tid=8 Native #00 pc 0x0000000000053d50 /system/lib/libc.so (__ioctl+8) #01 pc 0x0000000000021b29 /system/lib/libc.so (ioctl+36) #02 pc 0x000000000003d57f /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206) #03 pc 0x000000000003d6cb /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10) #04 pc 0x000000000003dc53 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38) #05 pc 0x000000000005475d /system/lib/libbinder.so (android::PoolThread::threadLoop()+12) #06 pc 0x000000000000c117 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166) #07 pc 0x000000000006f153 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82) #08 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #09 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "Binder:424_2" tid=9 Native #00 pc 0x0000000000053d50 /system/lib/libc.so (__ioctl+8) #01 pc 0x0000000000021b29 /system/lib/libc.so (ioctl+36) #02 pc 0x000000000003d57f /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206) #03 pc 0x000000000003d6cb /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10) #04 pc 0x000000000003dc53 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38) #05 pc 0x000000000005475d /system/lib/libbinder.so (android::PoolThread::threadLoop()+12) #06 pc 0x000000000000c117 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166) #07 pc 0x000000000006f153 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82) #08 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #09 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "Binder:424_3" tid=10 Native #00 pc 0x0000000000053d50 /system/lib/libc.so (__ioctl+8) #01 pc 0x0000000000021b29 /system/lib/libc.so (ioctl+36) #02 pc 0x000000000003d57f /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206) #03 pc 0x000000000003d6cb /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10) #04 pc 0x000000000003dc53 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38) #05 pc 0x000000000005475d /system/lib/libbinder.so (android::PoolThread::threadLoop()+12) #06 pc 0x000000000000c117 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166) #07 pc 0x000000000006f153 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82) #08 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #09 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "Profile Saver" tid=11 Native #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x00000000000a6c63 /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+86) #02 pc 0x00000000002609e3 /system/lib/libart.so (art::ProfileSaver::Run()+362) #03 pc 0x00000000002632d5 /system/lib/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+52) #04 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #05 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "WM.task-1" tid=12 Waiting at java.lang.Object.wait (Native method) at java.lang.Thread.parkFor$ (Thread.java:2137) at sun.misc.Unsafe.park (Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:764) "WM.task-2" tid=13 Waiting at java.lang.Object.wait (Native method) at java.lang.Thread.parkFor$ (Thread.java:2137) at sun.misc.Unsafe.park (Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:764) "RenderThread" tid=14 Native #00 pc 0x0000000000053c14 /system/lib/libc.so (__epoll_pwait+20) #01 pc 0x0000000000026059 /system/lib/libc.so (epoll_wait+16) #02 pc 0x000000000000f121 /system/lib/libutils.so (android::Looper::pollInner(int)+116) #03 pc 0x000000000000f02b /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+26) #04 pc 0x00000000000a39e3 /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+166) #05 pc 0x000000000000c117 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166) #06 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #07 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "SDLThread" tid=15 Native #00 pc 0x0000000000053d50 /system/lib/libc.so (__ioctl+8) #01 pc 0x0000000000021b29 /system/lib/libc.so (ioctl+36) #02 pc 0x000000000003d57f /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206) #03 pc 0x000000000003df83 /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+26) #04 pc 0x00000000000371d5 /system/lib/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+36) #05 pc 0x00000000000c3e4f /system/lib/libandroid_runtime.so (android_os_BinderProxy_transact(_JNIEnv*, _jobject*, int, _jobject*, _jobject*, int)+82) at android.os.BinderProxy.transactNative (Native method) at android.os.BinderProxy.transact (Binder.java:1129) at android.hardware.usb.IUsbManager$Stub$Proxy.getDeviceList (IUsbManager.java:460) at android.hardware.usb.UsbManager.getDeviceList (UsbManager.java:387) at org.libsdl.app.HIDDeviceManager.initializeUSB (HIDDeviceManager.java:45) at org.libsdl.app.HIDDeviceManager.initialize (HIDDeviceManager.java:45) at org.libsdl.app.SDLActivity.nativeRunMain (SDLActivity.java) at org.libsdl.app.SDLMain.run (SDLMain.java:96) at java.lang.Thread.run (Thread.java:764) "hwuiTask1" tid=16 Native #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x000000000001d125 /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88) #02 pc 0x0000000000063183 /system/lib/libc.so (pthread_cond_wait+32) #03 pc 0x00000000003440eb /system/lib/libhwui.so (android::uirenderer::TaskManager::WorkerThread::threadLoop()+222) #04 pc 0x000000000000c18f /system/lib/libutils.so (android::Thread::_threadLoop(void*)+286) #05 pc 0x000000000006f153 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82) #06 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #07 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "PlayBillingLibrary-1" tid=17 Waiting at java.lang.Object.wait (Native method) at java.lang.Thread.parkFor$ (Thread.java:2137) at sun.misc.Unsafe.park (Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:764) "PlayBillingLibrary-3" tid=18 Waiting at java.lang.Object.wait (Native method) at java.lang.Thread.parkFor$ (Thread.java:2137) at sun.misc.Unsafe.park (Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:764) "PlayBillingLibrary-2" tid=19 Waiting at java.lang.Object.wait (Native method) at java.lang.Thread.parkFor$ (Thread.java:2137) at sun.misc.Unsafe.park (Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:764) "queued-work-looper" tid=20 Native #00 pc 0x0000000000053c14 /system/lib/libc.so (__epoll_pwait+20) #01 pc 0x0000000000026059 /system/lib/libc.so (epoll_wait+16) #02 pc 0x000000000000f121 /system/lib/libutils.so (android::Looper::pollInner(int)+116) #03 pc 0x000000000000f02b /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+26) #04 pc 0x00000000000b893d /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26) at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:326) at android.os.Looper.loop (Looper.java:160) at android.os.HandlerThread.run (HandlerThread.java:65) "RenderThread" tid=459 Unknown #00 pc 0x0000000000053d50 /system/lib/libc.so (__ioctl+8) #01 pc 0x0000000000021b29 /system/lib/libc.so (ioctl+36) #02 pc 0x0000000000080530 /vendor/lib/egl/libGLES_mali.so (_mali_uku_wait_for_notification+44) #03 pc 0x00000000000834d0 /vendor/lib/egl/libGLES_mali.so (arch_worker_thread+300) #04 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #05 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "POSIX timer 0" tid=460 Unknown #00 pc 0x0000000000053f44 /system/lib/libc.so (__rt_sigtimedwait+12) #01 pc 0x00000000000239e9 /system/lib/libc.so (__timer_thread_start(void*)+120) #02 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #03 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "SDLThread" tid=463 Unknown #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x000000000001d125 /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88) #02 pc 0x0000000000063183 /system/lib/libc.so (pthread_cond_wait+32) #03 pc 0x000000000007fdec /vendor/lib/egl/libGLES_mali.so (_mali_osu_lock_wait+96) #04 pc 0x0000000000077f88 /vendor/lib/egl/libGLES_mali.so (_mali_base_worker_thread+180) #05 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #06 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) "RenderThread" tid=695 Unknown #00 pc 0x0000000000019d54 /system/lib/libc.so (syscall+28) #01 pc 0x000000000001d125 /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88) #02 pc 0x0000000000063183 /system/lib/libc.so (pthread_cond_wait+32) #03 pc 0x000000000007fdec /vendor/lib/egl/libGLES_mali.so (_mali_osu_lock_wait+96) #04 pc 0x0000000000077f88 /vendor/lib/egl/libGLES_mali.so (_mali_base_worker_thread+180) #05 pc 0x00000000000639e5 /system/lib/libc.so (__pthread_start(void*)+22) #06 pc 0x000000000001df75 /system/lib/libc.so (__start_thread+22) ```
AntTheAlchemist commented 1 year ago

The collapsible blocks didn't come out at all well, sorry. I added backticks and it made it worse, how can I add summery text with code content?

slouken commented 1 year ago

@AntTheAlchemist, can you create a new issue for these, so they don't get lost in the closed bug report?

madebr commented 1 year ago

The collapsible blocks didn't come out at all well, sorry. I added backticks and it made it worse, how can I add summery text with code content?

You need to add an empty line after </summary> and before the final </details>. It's a quirk of GitHub's markdown parser, I guess.

AntTheAlchemist commented 1 year ago

You need to add an empty line after </summary> and before the final </details>.

@madebr thank-you, that's good to know. Thanks for fixing my post.

@AntTheAlchemist, can you create a new issue for these, so they don't get lost in the closed bug report?

@slouken Yes, absolutely. Let me fist try out the very latest SDL3 source in a live test to see how well the recent fixes work, so I can come back with a fresh report. @1bsyl is waiting on some fresh logs as well. I won't forget. I have a bunch of other ANRs and Crashes I'll report in new issues soon - just want to make sure I can make them as useful as possible first.

1bsyl commented 1 year ago

first log: 1/ SDLActivity seems to be waiting for the JoystickLock (in OnPadUp) Since it's waiting for the lock, it must have been created first. So SDLThread was existing. But there are no SDLThread. So did it exit without releasing the JoystickLock() ? Eg C main() quits without calling SDL_JoystickUnlock() ? check you code to see you have all the necessary SDL_JoystickUnlock() in all situations ?

second log: This crash looks strange. because there should be only 1 SDLThread. but there are tid=15 and tid=463.

SDLActivity is also waiting for the JoystickLock but in OnPadDown().

SDLThread tid=15 is waiting in UsbManager.getDeviceList() called at org.libsdl.app.HIDDeviceManager.initializeUSB (HIDDeviceManager.java:45) at org.libsdl.app.HIDDeviceManager.initialize (HIDDeviceManager.java:45)

This sounds something done at start of the app. Probably it has taken the JoystickLock somewhere for initialization, so this sounds fine that SDLActivity is waiting. But maybe UsbManager.getDeviceList() just hangs, eg android bug (IPCThreadState::talkWithDriver && waitForResponse) ? or is waiting for a permission ? So the SDLThread blocks directly at starts and then blocks the Activity.

SDLThread tid=463 no idea what it is doing :/ stack trace doesn't look like SDL. (--> I suggested to temporary append a timestamp to the SDLThread string name, just to see if we get 2 different names) Who's created it ? SDLActivity before being blocked ? can have it been re-created because SDLThread=15 was hanged ? could be a warm start, and we re-create the SDLThread, but then, why, don't we have the normal SDL stack trace starting from java.lang.Thread.run ?