FFImageLoading icon indicating copy to clipboard operation
FFImageLoading copied to clipboard

Rare crash in AddToSavingQueueIfNotExistsAsync

Open patook opened this issue 9 years ago • 7 comments

Stack trace from insights below. Hard to repro, maybe one every 100,000 queries.

System.NullReferenceExceptionObject reference not set to an instance of an object at FFImageLoading.Cache.SimpleDiskCache+<>c__DisplayClass14_0+<b__0>d.MoveNext () [0x0028d] in <1e2479b50414476e858adbc51b4a0b2f>:0

patook avatar Jun 02 '17 18:06 patook

@patook Could you also paste the rest of stack trace? It can be more useful to me.

daniel-luberda avatar Jun 06 '17 00:06 daniel-luberda

Actually this is all that Xamarin Insights shows. We've had it 36 times in the past month. It appears to only impact Android as I didn't see any corresponding iOS crashes.

System.NullReferenceExceptionObject reference not set to an instance of an object Raw null System.NullReferenceExceptionObject reference not set to an instance of an object at FFImageLoading.Cache.SimpleDiskCache+<>c__DisplayClass14_0+<b__0>d.MoveNext () [0x0028d] in <1e2479b50414476e858adbc51b4a0b2f>:0

patook avatar Jun 15 '17 02:06 patook

I think that it means that a continuation, so after an await, tried to access a member on a null instance. So we should look for await usages in SimpleDiskCache and figure where we about null possibilities in continuations.

molinch avatar Jun 15 '17 12:06 molinch

Yes, it is in AddToSavingQueueIfNotExistsAsync:

at FFImageLoading.Cache.SimpleDiskCache+<>c__DisplayClass14_0+<b__0>d.MoveNext () [0x0028d] in <1e2479b50414476e858adbc51b4a0b2f>:0

patook avatar Jun 15 '17 16:06 patook

It looks like github is stripping out part of the stack. Here it is again:

at FFImageLoading.Cache.SimpleDiskCache+c__DisplayClass14_0+AddToSavingQueueIfNotExistsAsync>b__0>d.MoveNext ()

patook avatar Jun 15 '17 16:06 patook

I have a full stack now:

System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.TryRemoveInternal(TKey key, ref TValue value, bool matchValue, TValue oldValue):0 System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.TryRemove(TKey key, ref TValue value):0 at FFImageLoading.Cache.SimpleDiskCache+<>c__DisplayClass14_0+AddToSavingQueueIfNotExistsAsync-b__0>d.MoveNext () [0x0028d] in <1e2479b50414476e858adbc51b4a0b2f>:0

patook avatar Jul 04 '17 16:07 patook

Could you test the newest prerelease? (2.2.10.428) It should be fixed now. Please reopen if it's still a valid issue. Thanks

daniel-luberda avatar Aug 12 '17 18:08 daniel-luberda