ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

Crash during previews generation #131

Closed kirillt closed 2 years ago

kirillt commented 2 years ago

Attached image causes crash on Huawei P10 device. Works fine with Samsung Note10+.

D/previews: Generating preview for 1811523032 (/storage/9C33-6BBD/Pictures/Screenshots/Screenshot_20211108_114046_com.alexanderkondrashov.slovari.pro.jpg)
D/previews: Generating preview for 2342215843 (/storage/9C33-6BBD/Pictures/Screenshots/Screenshot_20211108_134239_com.google.android.gm.jpg)
D/previews: Generating preview for 3062072782 (/storage/9C33-6BBD/Pictures/Screenshots/lenovo-fedora-20211108-211740-973675687.png)
W/glide-source-th: type=1400 audit(0.0:12071067): avc: granted { read open } for path="/mnt/media_rw/9C33-6BBD/Pictures/Screenshots/lenovo-fedora-20211108-211740-973675687.png" dev="mmcblk1p1" ino=38625507 scontext=u:r:untrusted_app:s0:c141,c257,c512,c768 tcontext=u:object_r:exfat:s0 tclass=file
D/skia: --- Failed to create image decoder with message 'unimplemented'
D/skia: --- Failed to create image decoder with message 'unimplemented'
D/skia: --- Failed to create image decoder with message 'unimplemented'
D/skia: --- Failed to create image decoder with message 'unimplemented'
V/BitmapFactoryEx: nativeDecodeFileDescriptorEx
D/skia: --- Failed to create image decoder with message 'unimplemented'
V/BitmapFactoryEx: nativeDecodeFileDescriptorEx
D/skia: --- Failed to create image decoder with message 'unimplemented'
W/Glide: Load failed for /storage/9C33-6BBD/Pictures/Screenshots/lenovo-fedora-20211108-211740-973675687.png with size [72x128]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 2 causes:
    java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Bitmap->Bitmap}, LOCAL
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Bitmap}
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000
      Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Bitmap->Bitmap}, LOCAL
        Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Bitmap}
      Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Bitmap->Bitmap}, LOCAL
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Bitmap}
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
I/Glide: Root cause (1 of 2)
    java.io.IOException: java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:185)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92)
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70)
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59)
        at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76)
        at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57)
        at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:524)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:488)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:474)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148)
        at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76)
        at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310)
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279)
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:784)
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
     Caused by: java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000
        at android.media.MediaMetadataRetriever._setDataSource(Native Method)
        at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:211)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ByteBufferInitializer.initialize(VideoDecoder.java:316)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ByteBufferInitializer.initialize(VideoDecoder.java:310)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:173)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92) 
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70) 
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59) 
        at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76) 
        at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57) 
        at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:524) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:488) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:474) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426) 
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390) 
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148) 
        at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76) 
        at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:70) 
        at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) 
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) 
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310) 
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279) 
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234) 
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:784) 
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393) 
I/Glide: Root cause (2 of 2)
    java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:185)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92)
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70)
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59)
        at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76)
        at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57)
        at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:524)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:488)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:474)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148)
        at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76)
        at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:79)
        at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:434)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148)
        at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76)
        at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:79)
        at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:434)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148)
        at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76)
        at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310)
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279)
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:784)
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
     Caused by: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
        at android.media.MediaMetadataRetriever.setDataSource(Native Method)
        at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:143)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ParcelFileDescriptorInitializer.initialize(VideoDecoder.java:306)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ParcelFileDescriptorInitializer.initialize(VideoDecoder.java:301)
I/Glide:     at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:173)
            ... 39 more
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: space.taran.arknavigator, PID: 5071
    java.util.concurrent.ExecutionException: com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 2 causes:
    java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
        at com.bumptech.glide.request.RequestFutureTarget.doGet(RequestFutureTarget.java:217)
        at com.bumptech.glide.request.RequestFutureTarget.get(RequestFutureTarget.java:130)
        at space.taran.arknavigator.mvp.model.repo.preview.PreviewGenerators.resizeToThumbnail(PreviewGenerators.kt:81)
        at space.taran.arknavigator.mvp.model.repo.preview.PreviewGenerators.resizePreviewToThumbnail(PreviewGenerators.kt:70)
        at space.taran.arknavigator.mvp.model.repo.preview.PreviewGenerators.generate(PreviewGenerators.kt:32)
        at space.taran.arknavigator.mvp.model.repo.preview.PreviewAndThumbnail$Companion.generate(PreviewAndThumbnail.kt:67)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex$persistResources$2.invokeSuspend(PlainResourcesIndex.kt:154)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex$persistResources$2.invoke(Unknown Source:8)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex$persistResources$2.invoke(Unknown Source:4)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex.persistResources$app_debug(PlainResourcesIndex.kt:145)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex$reindexRoot$2.invokeSuspend(PlainResourcesIndex.kt:120)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex$reindexRoot$2.invoke(Unknown Source:8)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex$reindexRoot$2.invoke(Unknown Source:4)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
        at space.taran.arknavigator.mvp.model.repo.index.PlainResourcesIndex.reindexRoot$app_debug(PlainResourcesIndex.kt:89)
        at space.taran.arknavigator.mvp.model.repo.index.ResourcesIndexFactory$loadFromDatabase$2.invokeSuspend(ResourcesIndexFactory.kt:27)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
     Caused by: com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 2 causes:
    java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail

lenovo-fedora-20211108-211740-973675687

cnzqa commented 2 years ago

Didn't reproduce on my devices. Tried on bigger folder, 1188 files, 300MB size

kirillt commented 2 years ago

I suspect this can be due to exceeded available memory.

kirillt commented 2 years ago

Not sure what to do with this issue, let's re-open if it occurs again.