Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANR] Slow IO operation #2057

Open
1 task
yoobi opened this issue Jan 20, 2025 · 0 comments
Open
1 task

[ANR] Slow IO operation #2057

yoobi opened this issue Jan 20, 2025 · 0 comments

Comments

@yoobi
Copy link
Contributor

yoobi commented Jan 20, 2025

Version

Media3 1.4.1

More version details

Hi,
Some of my user are getting ANR after MediaHTTPConnection.disconnect is called

          binder:19968_2 (native):tid=10 systid=19978 
#00 pc 0xab704 libc.so (read + 4) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#01 pc 0xb86fc libc.so (__sread + 44) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#02 pc 0xb85ec libc.so (__srefill + 268) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#03 pc 0xbcc28 libc.so (fread_unlocked + 200) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#04 pc 0xbcb18 libc.so (fread + 72) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#05 pc 0x6f388 libc.so (android_getaddrinfo_proxy + 344) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#06 pc 0x6f000 libc.so (android_getaddrinfofornetcontext + 1568) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#07 pc 0x6e9b8 libc.so (android_getaddrinfofornet + 56) (BuildId: 465a4e4f3474259498fde6338e6bc02a)
#08 pc 0x24684 libjavacore.so (Linux_android_getaddrinfo + 336) (BuildId: 8d85311607fdef69ea901998b2a938b1)
       at libcore.io.Linux.android_getaddrinfo(Native method)
       at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
       at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:222)
       at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
       at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
       at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
       at java.net.InetAddress.getAllByName(InetAddress.java:1152)
       at com.android.okhttp.Dns$1.lookup(Dns.java:41)
       at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
       at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
       at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
       at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
       at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
       at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
       at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
       at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
       at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
       at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
       at android.media.MediaHTTPConnection.seekTo(MediaHTTPConnection.java:285)
       at android.media.MediaHTTPConnection.getMIMEType(MediaHTTPConnection.java:460)
       at android.media.IMediaHTTPConnection$Stub.onTransact(IMediaHTTPConnection.java:162)
       at android.os.Binder.execTransactInternal(Binder.java:1286)
       at android.os.Binder.execTransact(Binder.java:1244)
          main (blocked):tid=1 systid=19968 | waiting to lock <0x089eabe4> (android.media.MediaHTTPConnection) held by thread 10
       at android.media.MediaHTTPConnection.disconnect(MediaHTTPConnection.java:172)
       at android.media.IMediaHTTPConnection$Stub.onTransact(IMediaHTTPConnection.java:137)
       at android.os.Binder.execTransactInternal(Binder.java:1286)
       at android.os.Binder.execTransact(Binder.java:1244)
       at android.media.MediaPlayer._reset(Native method)
       at android.media.MediaPlayer.reset(MediaPlayer.java:2226)
       at android.widget.VideoView.release(VideoView.java:712)
       at android.widget.VideoView.-$$Nest$mrelease(unavailable)
       at android.widget.VideoView$7.surfaceDestroyed(VideoView.java:702)
       at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1808)
       at android.view.SurfaceView.updateSurface(SurfaceView.java:988)
       at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:309)
       at android.view.View.dispatchDetachedFromWindow(View.java:21401)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4028)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4028)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4028)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5662)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5633)
       at android.view.ViewGroup.removeView(ViewGroup.java:5564)
       at androidx.fragment.app.FragmentContainerView.removeView(FragmentContainerView.kt:285)
       at androidx.fragment.app.SpecialEffectsController$Operation$State.applyState(SpecialEffectsController.java:516)
       at androidx.fragment.app.SpecialEffectsController.applyContainerChangesToOperation$fragment_release(SpecialEffectsController.java:305)
       at androidx.fragment.app.SpecialEffectsController.commitEffects$fragment_release(SpecialEffectsController.java:405)
       at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:282)
       at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2177)
       at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2065)
       at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
       at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:702)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:8061)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)

Devices that reproduce the issue

  • Vivo Z1 Pro, Vivo Y16
  • Xiaomi Redmi Note 13

It ranges from Android 11 to Android 13

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

I'm not sure about the steps but it looks like releasing the videoview / player is the root cause

Expected result

No ANR

Actual result

ANR

Media

Not applicable

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant