When using FFIL with the bunch of images we often get heap corruption crash.
Any idea how can we avoid this?
[ReuseBitmapDrawableCache] Cache hit
[ReuseBitmapDrawableCache] Cache hit
[ReuseBitmapDrawableCache] Cache hit from reuse pool
[ReuseBitmapDrawableCache] Cache hit from reuse pool
[SelfDisposingBitmapDrawable] OnFreeResources
[ReuseBitmapDrawableCache] Cache hit from reuse pool
[SelfDisposingBitmapDrawable] OnFreeResources
[ReuseBitmapDrawableCache] Cache hit from reuse pool
[SelfDisposingBitmapDrawable] OnFreeResources
[libc] heap corruption detected by dlmalloc_real
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 19541
I/DEBUG ( 122): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG ( 122): Abort message: 'heap corruption detected by dlmalloc_real'
I/DEBUG ( 122): r0 00000000 r1 00004c55 r2 00000006 r3 00000000
I/DEBUG ( 122): r4 40090e38 r5 00000006 r6 0000000b r7 0000010c
I/DEBUG ( 122): r8 00000000 r9 41dcf600 sl 00000006 fp 00000006
I/DEBUG ( 122): ip 00004c55 sp be9d5798 lr 401a4c81 pc 401cac04 cpsr 600f0010
I/DEBUG ( 122):
I/DEBUG ( 122): backtrace:
I/DEBUG ( 122): #00 pc 0003cc04 /system/lib/libc.so (tgkill+12)
I/DEBUG ( 122): #01 pc 00016c7d /system/lib/libc.so (pthread_kill+52)
I/DEBUG ( 122): #02 pc 0001789b /system/lib/libc.so (raise+10)
I/DEBUG ( 122): #03 pc 00014029 /system/lib/libc.so
I/DEBUG ( 122): #04 pc 000124f0 /system/lib/libc.so (abort+4)
I/DEBUG ( 122): #05 pc 00015367 /system/lib/libc.so
I/DEBUG ( 122): #06 pc 00029ab1 /system/lib/libc.so
I/DEBUG ( 122): #07 pc 0002b2c9 /system/lib/libc.so
I/DEBUG ( 122): #08 pc 00012287 /system/lib/libc.so (malloc+10)
I/DEBUG ( 122): #09 pc 00000c41 /system/lib/libstdc++.so (operator new(unsigned int)+4)
I/DEBUG ( 122): #10 pc 00035421 /system/lib/libhwui.so (android::uirenderer::RenderProperties::updateMatrix()+24)
I/DEBUG ( 122): #11 pc 0007f0cb /system/lib/libandroid_runtime.so
I/DEBUG ( 122): #12 pc 000b3ac3 /data/dalvik-cache/arm/system@[email protected]
We solved the issue by uncommenting the OnDetachedFromWindow method from ManagedImageView, because it looks the only place where NoLongerDisplayed event could be raised.
We need to fix that. I'll reopen the issue. Thanks for the info!
@SemyonL Could you test this https://github.com/molinch/FFImageLoading/commit/b23dad1ab790536365788826d78cd55a67f32a44?
@SemyonL That fix is included in 2.0.7-rc1 released, it would be really nice if you could give some feedback about the issue.
@daniel-luberda Just tested the latest source and no luck, still getting heap corruption. Dispose doesn't seem to work properly.
@SemyonL does it happen on a particular Android version or any?
Also I would suggest running your app with git sources, in debug, instead of using nuget packages.
If you could do so then valuable debug information should be in console output and crashlog.
@molinch It easily reproduced on nexus 7 with 5.1. However, on another 4.3 device from asus it doesn't crash after 5 minutes.
Thanks I'll try with 5.1
So I tried on a simulated Nexus 4 and couldn't reproduce it.
I guess I will need a real device.
If you manage to run against git sources I'm pretty sure you will get valuable info.
@SemyonL Do you reproduce this issue in Lollipop simulators as well?
@SemyonL if we don't get more feedback we cannot solve this. Could you help us?
@SemyonL I'll close this one. If you'll have any more details about it, feel fry to reopen it. I cannot reproduce it. Thanks.
Well, it happens here, too. Details? Use a lot of images in your app and your app will likely crash after some usage.
@bspinner I have some image heavy apps and can't reproduce it. I'll need some help with it.
It would be awesome to have a sample that fails. Could you deliver one?
Well, problem went away after not setting MaxCacheSize. Maybe it should be renamed to MaxMemoryCacheSize... ... ...
@bspinner You are right, this name makes more sense. Changed https://github.com/luberda-molinet/FFImageLoading/commit/4beb8cf251140a038269325f08e22ac69b846d3a
When I use LoadingPlaceholder, application crashes with fatal signal 6
Without LoadingPlaceholder it works fine
Here is an example: http://www.filedropper.com/testffimageloading
Hi @molinch.
ImageService.Instance.LoadUrl(url, TimeSpan.FromDays(1000))
//.ErrorPlaceholder(placeHolder, ImageSource.CompiledResource)
//.LoadingPlaceholder(placeHolder, ImageSource.CompiledResource)
.DownSample(UIUtils.DpToPx(context, 42))
.Transform(new CircleTransformation())
.Into(imageView);
When I commented ErrorPlaceholder and LoadingPlaceholder methods, application works fine. Instead app crashes during fast scrolling in recycler view.
Device: lenovo A5000 (Android 5.0.2)
P.S. It's the same issue https://github.com/luberda-molinet/FFImageLoading/issues/207
on another device - samsung GT-i9100 (Android 4.1.2).
@djanri Well, that might be the reason our app is crashing, too.. :+1: