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: com.bumptech.glide.request.BaseRequestOptions.clone #5445

Open
Theonik opened this issue Sep 6, 2024 · 0 comments
Open

ANR: com.bumptech.glide.request.BaseRequestOptions.clone #5445

Theonik opened this issue Sep 6, 2024 · 0 comments

Comments

@Theonik
Copy link

Theonik commented Sep 6, 2024

Glide Version:
4.16.0

Integration libraries:
N/A

Device/Android Version:
Android TV/Android 12

Issue details / Repro steps / Use case background:
No direct reproduction but reported by PlayStore vitals. It appears to be a lock contention issue in com.bumptech.glide.RequestManager.onStart where com.bumptech.glide.RequestManager.<init> is still holding a lock. This causes an ANR to occur as RequestManager.onStart() runs on the main thread.

Glide load line / GlideModule (if any) / list Adapter code (if any):

        Glide.with(this) // this is a LinearLayout/LifecycleObserver
            .asGif()
            .load(R.drawable.loadingboxlooptt)
            .into(findViewById(R.id.loadingDots))
            .clearOnDetach()

Layout XML:

<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:parentTag="android.widget.LinearLayout">

    <ImageView
        android:id="@+id/loadingDots"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/loading_dots_height"
        android:layout_marginTop="@dimen/loading_inter_spacing"
        android:contentDescription="@string/loading_text"
        android:src="@drawable/loadingboxlooptt"/>
</merge>

Stack trace / LogCat:

"main" tid=1 Blocked
  at com.bumptech.glide.RequestManager.onStart (RequestManager.java)
  at com.bumptech.glide.manager.ApplicationLifecycle.addListener (ApplicationLifecycle.java)
  at com.bumptech.glide.load.engine.ActiveResources$2.run (ActiveResources.java)
  at android.os.Handler.handleCallback (Handler.java:938)
  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:7839)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1006)

"glide-source-thread-0" tid=58 Runnable
  at androidx.collection.ArraySet$1.colGetSize (ArraySet.java)
  at androidx.collection.MapCollections$MapIterator.<init> (MapCollections.java)
  at androidx.collection.MapCollections$KeySet.iterator (MapCollections.java)
  at androidx.collection.ArrayMap.putAll (ArrayMap.java)
  at com.bumptech.glide.request.BaseRequestOptions.clone (BaseRequestOptions.java)
  at com.bumptech.glide.RequestManager.<init> (RequestManager.java)
  at com.bumptech.glide.manager.RequestManagerRetriever.get (RequestManagerRetriever.java)
  at com.bumptech.glide.load.resource.gif.GifFrameLoader.<init> (GifFrameLoader.java)
  at com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.decode (ByteBufferGifDecoder.java)
  at com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.decode (ByteBufferGifDecoder.java)
  at com.bumptech.glide.load.resource.gif.StreamGifDecoder.decode (StreamGifDecoder.java)
  at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList (DecodePath.java)
  at com.bumptech.glide.load.engine.DecodePath.decode (DecodePath.java)
  at com.bumptech.glide.load.engine.LoadPath.load (LoadPath.java)
  at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher (DecodeJob.java)
  at com.bumptech.glide.load.engine.DecodeJob.decodeFromData (DecodeJob.java)
  at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData (DecodeJob.java)
  at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady (DecodeJob.java)
  at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady (SourceGenerator.java)
  at com.bumptech.glide.load.model.DirectResourceLoader$ResourceDataFetcher.loadData (DirectResourceLoader.java)
  at com.bumptech.glide.load.engine.SourceGenerator.startNext (SourceGenerator.java)
  at com.bumptech.glide.load.engine.DecodeJob.runGenerators (DecodeJob.java)
  at com.bumptech.glide.load.engine.DecodeJob.runWrapped (DecodeJob.java)
  at com.bumptech.glide.load.engine.DecodeJob.run (DecodeJob.java)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:920)
  at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultPriorityThreadFactory$1.run (GlideExecutor.java)

Screenshot 2024-09-06 at 01 27 23

@Theonik Theonik changed the title [ANR] com.bumptech.glide.request.BaseRequestOptions.clone ANR: com.bumptech.glide.request.BaseRequestOptions.clone Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant