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

_TFFC10Kingfisher10ImageCache41cleanExpiredDiskCacheWithCompletionHanderFS0_FGSqFT_T__T_U_FT_T_ #86

Closed
minikin opened this issue Aug 3, 2015 · 12 comments

Comments

@minikin
Copy link

minikin commented Aug 3, 2015

Crashed: com.onevcat.Kingfisher.ImageCache.ioQueue.my_cache
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xd16e38b6

EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xd16e38b6

Thread : Crashed: com.onevcat.Kingfisher.ImageCache.ioQueue.my_cache
0 libswiftCore.dylib 0x009c7ab8 swift_getObjCClassMetadata + 199
1 libswiftCore.dylib 0x009b4125 findDynamicValueAndType(swift::OpaqueValue_, swift::Metadata const_, swift::OpaqueValue_&, swift::Metadata const_&) + 80
2 libswiftCore.dylib 0x009b4125 findDynamicValueAndType(swift::OpaqueValue_, swift::Metadata const_, swift::OpaqueValue_&, swift::Metadata const_&) + 80
3 libswiftCore.dylib 0x009b4883 dynamicCastToExistential(swift::OpaqueValue, swift::OpaqueValue_, swift::Metadata const_, swift::ExistentialTypeMetadata const_, swift::DynamicCastFlags) + 30
4 libswiftCore.dylib 0x009b46ad swift_dynamicCast + 484
5 libswiftCore.dylib 0x008a955c TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q + 208
6 libswiftCore.dylib 0x008da780 TFOSs25_VariantDictionaryStorage8maybeGetUSs8Hashable___fGS_Q_Q0__FQ_GSqQ0_ + 176
7 libswiftCore.dylib 0x008da6c8 TFVSs10Dictionaryg9subscriptFQ_GSqQ0_ + 28
8 Kingfisher 0x00450fc8 TFFC10Kingfisher10ImageCache41cleanExpiredDiskCacheWithCompletionHanderFS0_FGSqFT_T__T_U_FT_T + 2392
9 Kingfisher 0x0044d3f0 TTRXFo__dT__XFdCb__dT_ + 56
10 libdispatch.dylib 0x32da32e3 _dispatch_call_block_and_release + 10
11 libdispatch.dylib 0x32dab729 _dispatch_queue_drain + 1468
12 libdispatch.dylib 0x32da5aad _dispatch_queue_invoke + 84
13 libdispatch.dylib 0x32dacf9f _dispatch_root_queue_drain + 394
14 libdispatch.dylib 0x32dae3c3 _dispatch_worker_thread3 + 94
15 libsystem_pthread.dylib 0x32f0adc1 _pthread_wqthread + 668
16 libsystem_pthread.dylib 0x32f0ab14 start_wqthread + 8

@marcelofabri
Copy link

I'm seeing this issue as well. According to Fabric, it's on:

ImageCache.swift line 389
Kingfisher.ImageCache.(cleanExpiredDiskCacheWithCompletionHander (Kingfisher.ImageCache) -> (Swift.Optional<() -> ()>) -> ()).(closure #1)

@onevcat
Copy link
Owner

onevcat commented Aug 6, 2015

Hi. @minikin @marcelofabri

Thanks for the reporting. I will keep on eye on this.

@marcelofabri And may I get some more detail information on it? Would you please paste the full log, maybe it could tell more. Thanks!

@marcelofabri
Copy link

Thread : Crashed: com.onevcat.Kingfisher.ImageCache.ioQueue.default
0  libswiftCore.dylib             0x00000001017e491c swift_getObjCClassMetadata + 240
1  libswiftCore.dylib             0x00000001017cb0bc findDynamicValueAndType(swift::OpaqueValue*, swift::Metadata const*, swift::OpaqueValue*&, swift::Metadata const*&) + 128
2  libswiftCore.dylib             0x00000001017cb0bc findDynamicValueAndType(swift::OpaqueValue*, swift::Metadata const*, swift::OpaqueValue*&, swift::Metadata const*&) + 128
3  libswiftCore.dylib             0x00000001017cbe20 _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::Metadata const*, swift::ExistentialTypeMetadata const*, swift::DynamicCastFlags) + 72
4  libswiftCore.dylib             0x00000001017cba94 swift_dynamicCast + 612
5  libswiftCore.dylib             0x00000001016d9238 _TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_ + 180
6  libswiftCore.dylib             0x0000000101703ca4 _TFOSs25_VariantDictionaryStorage8maybeGetUSs8Hashable___fGS_Q_Q0__FQ_GSqQ0__ + 244
7  Kingfisher                     0x0000000100dcfa64 Kingfisher.ImageCache.(cleanExpiredDiskCacheWithCompletionHander (Kingfisher.ImageCache) -> (Swift.Optional<() -> ()>) -> ()).(closure #1) (ImageCache.swift:389)
8  Kingfisher                     0x0000000100dccbcc reabstraction thunk helper from @callee_owned () -> (@unowned ()) to @callee_unowned @convention(block) () -> (@unowned ()) (ImageCache.swift)
9  libdispatch.dylib              0x0000000194649994 _dispatch_call_block_and_release
10 libdispatch.dylib              0x0000000194649954 _dispatch_client_callout
11 libdispatch.dylib              0x00000001946540a4 _dispatch_queue_drain
12 libdispatch.dylib              0x000000019464ca5c _dispatch_queue_invoke
13 libdispatch.dylib              0x0000000194656318 _dispatch_root_queue_drain
14 libdispatch.dylib              0x0000000194657c4c _dispatch_worker_thread3
15 libsystem_pthread.dylib        0x000000019482922c _pthread_wqthread + 816
16 libsystem_pthread.dylib        0x0000000194828ef0 start_wqthread + 4

@onevcat
Copy link
Owner

onevcat commented Aug 7, 2015

Thanks for it. I will investigate what I can do with it.

@onevcat
Copy link
Owner

onevcat commented Aug 7, 2015

I believe it should be OK now with ver 1.4.4. But we'd better to keep this issue open for a while, to see if there is new cases happen.

@richardtop
Copy link

Got this bug in v1.4.5, here is the stack trace:

Thread : Crashed: com.onevcat.Kingfisher.ImageCache.ioQueue.default
0  libswiftCore.dylib             0x0000000101bc091c swift_getObjCClassMetadata + 240
1  libswiftCore.dylib             0x0000000101ba70bc findDynamicValueAndType(swift::OpaqueValue*, swift::Metadata const*, swift::OpaqueValue*&, swift::Metadata const*&) + 128
2  libswiftCore.dylib             0x0000000101ba70bc findDynamicValueAndType(swift::OpaqueValue*, swift::Metadata const*, swift::OpaqueValue*&, swift::Metadata const*&) + 128
3  libswiftCore.dylib             0x0000000101ba7e20 _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::Metadata const*, swift::ExistentialTypeMetadata const*, swift::DynamicCastFlags) + 72
4  libswiftCore.dylib             0x0000000101ba7a94 swift_dynamicCast + 612
5  libswiftCore.dylib             0x0000000101ab5238 _TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_ + 180
6  libswiftCore.dylib             0x0000000101adfca4 _TFOSs25_VariantDictionaryStorage8maybeGetUSs8Hashable___fGS_Q_Q0__FQ_GSqQ0__ + 244
7  Kingfisher                     0x00000001010a3668 _TFFC10Kingfisher10ImageCache41cleanExpiredDiskCacheWithCompletionHanderFS0_FGSqFT_T__T_U_FT_T_ + 1872
8  Kingfisher                     0x00000001010a07a4 _TTRXFo__dT__XFdCb__dT__ + 44
9  libdispatch.dylib              0x0000000195f81994 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x0000000195f81954 _dispatch_client_callout + 16
11 libdispatch.dylib              0x0000000195f8c0a4 _dispatch_queue_drain + 1448
12 libdispatch.dylib              0x0000000195f84a5c _dispatch_queue_invoke + 132
13 libdispatch.dylib              0x0000000195f8e318 _dispatch_root_queue_drain + 720
14 libdispatch.dylib              0x0000000195f8fc4c _dispatch_worker_thread3 + 108
15 libsystem_pthread.dylib        0x000000019616122c _pthread_wqthread + 816
16 libsystem_pthread.dylib        0x0000000196160ef0 start_wqthread + 4

@onevcat
Copy link
Owner

onevcat commented Sep 4, 2015

For reference
A similar issue is reported in SwiftyJSON/SwiftyJSON#261
I would just keep trying to dig what happened with subscript + type casting.

@onevcat
Copy link
Owner

onevcat commented Mar 8, 2016

It seems that this issue does not appear in current version of Kingfisher (2.0.4) and Swift (2.1). So I am closing it. If there is any further report on it, please leave a comment and I will reopen it.

@onevcat onevcat closed this as completed Mar 8, 2016
@AvdLee
Copy link

AvdLee commented May 19, 2016

I'm currently investigating this, but I am seeing this again. Especially when opening and closing my app very fast multiple times. It seems to be related to the backgroundTask running cleanExpiredDiskCacheWithCompletionHander. I'll dive into this right now

@AvdLee
Copy link

AvdLee commented May 19, 2016

Update:

Nevermind, this commit fixed it: ae2789f#diff-7cdf8106380eb2d5b68719cb46ac25cf

I was on version 2.3.1, 2.4.1 doesn't have this issue anymore.

@onevcat
Copy link
Owner

onevcat commented May 20, 2016

@AvdLee Yes, it was an unrelated issue from this one.

@Starsky89
Copy link

Starsky89 commented May 29, 2020

I have Kingfisher v5.13.3 and I got this same crash in Firebase Crashlytics.
Here is the log from Crashlytics:

Crashed: com.onevcat.Kingfisher.ImageCache.ioQueue.DE773507-5415-432D-98FE-738E2AA6812F
0  ???                            0x20202018 (Missing)
1  Foundation                     0x1fb2eb954 -[NSConcreteData dealloc] + 72
2  libswiftFoundation.dylib       0x2284a190c specialized __DataStorage.withInteriorPointerReference<A>(_:_:) + 220
3  libswiftFoundation.dylib       0x2284a7b5c specialized Data._Representation.withInteriorPointerReference<A>(_:) + 352
4  libswiftFoundation.dylib       0x2284a99c4 Data.write(to:options:) + 84
5  Kingfisher                     0x101b472b8 $s10Kingfisher11DiskStorageO7BackendC5store5value6forKey10expirationyx_SSAA0C10ExpirationOSgtKF10Foundation4DataV_Tg5Tf4nxnn_n + 1120
6  Kingfisher                     0x101b59200 $s10Kingfisher10ImageCacheC15syncStoreToDisk33_1D90DE22DCEED43EC102CBF15F85A36ELL_6forKey19processorIdentifier13callbackQueue10expiration17completionHandlery10Foundation4DataV_S2SAA08CallbackT0OAA17StorageExpirationOSgyAA0cE6ResultVcSgtFTf4nxxnnnn_n + 448
7  Kingfisher                     0x101b51c04 $s10Kingfisher10ImageCacheC5store_8original6forKey7options6toDisk17completionHandlerySo7UIImageC_10Foundation4DataVSgSSAA0A17ParsedOptionsInfoVSbyAA0C11StoreResultVcSgtFyycfU0_ + 844
8  Kingfisher                     0x101b5efcc $s10Kingfisher10ImageCacheC5store_8original6forKey7options6toDisk17completionHandlerySo7UIImageC_10Foundation4DataVSgSSAA0A17ParsedOptionsInfoVSbyAA0C11StoreResultVcSgtFyycfU0_TA + 48
9  Kingfisher                     0x101b24ca8 $sIeg_IeyB_TR + 28
10 libdispatch.dylib              0x1fa3c8a38 _dispatch_call_block_and_release + 24
11 libdispatch.dylib              0x1fa3c97d4 _dispatch_client_callout + 16
12 libdispatch.dylib              0x1fa372324 _dispatch_lane_serial_drain$VARIANT$mp + 592
13 libdispatch.dylib              0x1fa372e40 _dispatch_lane_invoke$VARIANT$mp + 428
14 libdispatch.dylib              0x1fa37b4ac _dispatch_workloop_worker_thread + 596
15 libsystem_pthread.dylib        0x1fa5aa114 _pthread_wqthread + 304
16 libsystem_pthread.dylib        0x1fa5accd4 start_wqthread + 4

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

6 participants