ANR when release media session in main thread
@marcbaechinger is already working on this.
Since Oct 26, 2023.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.1.1
More version details
This is reported for 1.2.0-beta01.
Devices that reproduce the issue
Android 11, Haier TV, Changhong TV.
Application is in background.
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
The Firebase Crashlytics reports this ANR:
main (native):tid=1 systid=6234
#00 pc 0x5ddec libc.so (syscall + 28)
#01 pc 0x130dd9 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 88)
#02 pc 0x4d8c33 libart.so (art::GoToRunnable(art::Thread*) + 342)
#03 pc 0x4d8ab5 libart.so (art::JniMethodEnd(unsigned int, art::Thread*) + 8)
at android.os.BinderProxy.transactNative(Native method)
at android.os.BinderProxy.transact(BinderProxy.java:540)
at android.media.session.ISession$Stub$Proxy.destroySession(ISession.java:547)
at android.media.session.MediaSession.release(MediaSession.java:408)
at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21.release(MediaSessionCompat.java:4037)
at android.support.v4.media.session.MediaSessionCompat.release(MediaSessionCompat.java:773)
at androidx.media3.session.MediaSessionLegacyStub.release(MediaSessionLegacyStub.java:279)
at androidx.media3.session.MediaSessionImpl.release(MediaSessionImpl.java:314)
at androidx.media3.session.MediaSession.release(MediaSession.java:722)
at com.yuriy.openradio.shared.service.OpenRadioService.onDestroy(OpenRadioService.kt:254)
at android.app.ActivityThread.handleStopService(ActivityThread.java:4355)
at android.app.ActivityThread.access$1900(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1956)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
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:947)
Expected result
I am not sure whether or not session should be release on main thread. Please correct the documentation if necessary.
Actual result
ANR when media session release.
Media
No specific media.
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.