The app crashes due to a NoSuchElementException.
- Dominant language
- Java
- Stars
- 35k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 8
Description
Glide Version:4.12.0
Integration libraries:okhttp3-integration:4.12.0
Device/Android Version: Xiaomi 2410DPN6CC/Android 13
Issue details / Repro steps / Use case background: The app crashes when handling the OnTrimMemory callback.
Stack trace / LogCat:
`java.util.NoSuchElementException:
java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:762)
java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:792)
java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:790)
com.bumptech.glide.util.LruCache.void trimToSize(long)(LruCache.java:184)
com.bumptech.glide.load.engine.cache.LruResourceCache.void trimMemory(int)(LruResourceCache.java:56)
com.bumptech.glide.Glide.void trimMemory(int)(Glide.java:717)
com.bumptech.glide.Glide.void onTrimMemory(int)(Glide.java:925)
android.content.ComponentCallbacksController.lambda$dispatchTrimMemory$1(ComponentCallbacksController.java:109)
android.content.ComponentCallbacksController$$ExternalSyntheticLambda1.accept(Unknown Source:4)
android.content.ComponentCallbacksController.forAllComponentCallbacks(ComponentCallbacksController.java:124)
android.content.ComponentCallbacksController.dispatchTrimMemory(ComponentCallbacksController.java:107)
android.app.Application.onTrimMemory(Application.java:289)
Contributor guide
Research direction
Start with com.bumptech.glide.util.LruCache.trimToSize at LruCache.java:184, then follow the OnTrimMemory path through LruResourceCache.trimMemory and Glide.onTrimMemory. Use the provided Android 13 stack trace and callback scenario to investigate the crash. Done means the callback no longer produces NoSuchElementException, with regression coverage if an existing test location is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100