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

Deadlock inside RequestManager #5458

Open
aperfilyev opened this issue Oct 17, 2024 · 0 comments
Open

Deadlock inside RequestManager #5458

aperfilyev opened this issue Oct 17, 2024 · 0 comments

Comments

@aperfilyev
Copy link

Glide Version:4.16.0

Integration libraries:

Device/Android Version:

Issue details / Repro steps / Use case background:
I noticed some ANR issues in Firebase that relate to this problem.

Stack trace / LogCat:

main (blocked):tid=1 systid=14340 | waiting to lock <0x0178642c> (java.lang.Object) held by thread 170
       at com.bumptech.glide.request.SingleRequest.isComplete(SingleRequest.java:367)
       at com.bumptech.glide.RequestManager.resumeRequests(RequestManager.java)
       at com.bumptech.glide.RequestManager.onStart(RequestManager.java)
       at com.bumptech.glide.manager.ApplicationLifecycle.addListener(ApplicationLifecycle.java:15)
       at com.bumptech.glide.RequestManager$1.run(RequestManager.java:84)
       at android.os.Handler.handleCallback(Handler.java:966)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loopOnce(Looper.java:205)
       at android.os.Looper.loop(Looper.java:293)
       at android.app.ActivityThread.main(ActivityThread.java:9697)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:586)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1211)

glide-source-thread-3 (blocked):tid=170 systid=14784 | waiting to lock <0x04d03ef5> (com.bumptech.glide.l) held by thread 1
       at com.bumptech.glide.RequestBuilder.<init>(RequestBuilder.java:95)
       at com.bumptech.glide.RequestManager.as(RequestManager.java:611)
       at com.bumptech.glide.RequestManager.asBitmap(RequestManager.java:407)
       at com.example.app.defaults.StoriesImageLoaderDefault.loadBitmap(StoriesImageLoaderDefault.kt)
       at com.example.app.common.StoriesImageLoaderInternalImpl.awaitLoadBitmapUnsafe(StoriesImageLoaderInternal.kt)
       at com.example.app.common.StoriesImageLoaderInternalImpl.awaitLoadBitmap(StoriesImageLoaderInternal.kt)
       at com.example.app.common.StoriesImageLoaderInternalImpl.awaitLoadBitmapOrThrow(StoriesImageLoaderInternal.kt)
       at com.example.app.common.StoriesImageLoaderInternalImpl$awaitLoadBitmapOrNull$2.invokeSuspend(StoriesImageLoaderInternal.kt)
       at com.example.app.common.StoriesImageLoaderInternalImpl$awaitLoadBitmapOrNull$2.invoke(StoriesImageLoaderInternal.kt)
       at com.example.app.common.StoriesErrorListenerKt.catchingSuspend(StoriesErrorListener.kt)
       at com.example.app.common.StoriesImageLoaderInternalImpl.awaitLoadBitmapOrNull(StoriesImageLoaderInternal.kt)
       at com.example.app.common.StoriesImageLoaderInternal$DefaultImpls.awaitLoadBitmapOrNull$default(StoriesImageLoaderInternal.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt.buildImageLayer-7WxChyE(DomainStoryCookieToUiConverter.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt.buildRegularLayers-3jy_d7E(DomainStoryCookieToUiConverter.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt.access$buildDefault-5E_8A90(DomainStoryCookieToUiConverter.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt$toUi$2$1.invokeSuspend(DomainStoryCookieToUiConverter.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt$toUi$2$1.invoke(DomainStoryCookieToUiConverter.kt)
       at com.example.app.common.StoriesErrorListenerKt.catchingStoriesException(StoriesErrorListener.kt)
       at com.example.app.common.StoriesErrorListenerKt.catchingStoriesException$default(StoriesErrorListener.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt.catchCookiesConvert(DomainStoryCookieToUiConverter.kt)
       at com.example.app.ui.cookies.model.converter.DomainStoryCookieToUiConverterKt.toUi-3jy_d7E(DomainStoryCookieToUiConverter.kt)
       at com.example.app.ui.cookies.presentation.converter.CookiesConverter$convert$2$1$1.invokeSuspend(CookiesConverter.kt)
       at com.example.app.ui.cookies.presentation.converter.CookiesConverter$convert$2$1$1.invoke(CookiesConverter.kt)
       at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:147)
       at kotlinx.coroutines.BuildersKt.withContext(Builders.kt:1)
       at com.example.app.ui.cookies.presentation.converter.CookiesConverter$convert$2$1.invokeSuspend(CookiesConverter.kt)
       at com.example.app.ui.cookies.presentation.converter.CookiesConverter$convert$2$1.invoke(CookiesConverter.kt)
       at com.example.app.common.StoriesErrorListenerKt.catchingSuspend(StoriesErrorListener.kt)
       at com.example.app.ui.cookies.presentation.converter.CookiesConverter$convert$2.invokeSuspend(CookiesConverter.kt)
       at com.example.app.ui.cookies.presentation.converter.CookiesConverter$convert$2.invoke(CookiesConverter.kt)
       at com.example.app.core.components.utils.coroutines.AsyncsKt$asyncMap$2$1$1.invokeSuspend(Asyncs.kt)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:81)
       at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:63)
       at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:180)
       at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:150)
       at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:464)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:489)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:489)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:364)
       at com.example.app.common.StoriesImageLoaderKt$loadBitmapAsync$2$disposable$1.invoke(StoriesImageLoader.kt:74)
       at com.example.app.defaults.StoriesImageLoaderDefault$loadBitmap$task$2.onResourceReady(StoriesImageLoaderDefault.kt:52)
       at com.bumptech.glide.request.SingleRequest.onResourceReady(SingleRequest.java:620)
       at com.bumptech.glide.request.SingleRequest.onResourceReady(SingleRequest.java:544)
       at com.bumptech.glide.load.engine.EngineJob$CallResourceReady.run(EngineJob.java:423)
       at com.bumptech.glide.util.Executors$2.execute(Executors.java:26)
       at com.bumptech.glide.load.engine.DecodeJob.notifyComplete(DecodeJob.java:338)
       at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:421)
       at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387)
       at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:239)
       at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:100)
       at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:61)
       at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:49)
       at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:52)
       at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:306)
       at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:273)
       at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:229)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:419)
       at java.lang.Thread.run(Thread.java:930)
       at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultPriorityThreadFactory$1.run(GlideExecutor.java)
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