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

Crash on YPLibraryVC.swift line 471 #637

Closed
majid701 opened this issue Feb 15, 2021 · 16 comments
Closed

Crash on YPLibraryVC.swift line 471 #637

majid701 opened this issue Feb 15, 2021 · 16 comments
Labels
Crash The picker crashes ! Often asked The questions/bug/features, that are often asked.

Comments

@majid701
Copy link

I have not been able to reproduce this one. Not that common but happens sometimes:
100% iphone devices
100% iOS 14

Stacktrace:

Crashed: com.apple.root.user-initiated-qos
EXC_BREAKPOINT 0x00000001887d5fb0

Crashed: com.apple.root.user-initiated-qos
0 libswiftCore.dylib 0x1887d5fb0 assertionFailure(:_:file:line🎏) + 488
1 YPImagePicker 0x1047b27bc closure #1 in YPLibraryVC.selectedMedia(photoCallback:videoCallback:multipleItemsCallback:) + 471 (YPLibraryVC.swift:471)
2 YPImagePicker 0x1047d7010 thunk for @escaping @callee_guaranteed () -> () + 4404916240 (:4404916240)
3 libdispatch.dylib 0x184a21298 _dispatch_call_block_and_release + 24
4 libdispatch.dylib 0x184a22280 _dispatch_client_callout + 16
5 libdispatch.dylib 0x1849d4254 _dispatch_root_queue_drain + 688
6 libdispatch.dylib 0x1849d48e4 _dispatch_worker_thread2 + 124
7 libsystem_pthread.dylib 0x1cab57568 _pthread_wqthread + 212
8 libsystem_pthread.dylib 0x1cab5a874 start_wqthread + 8

@338drive
Copy link

338drive commented Mar 30, 2021

I have same issue. Can't reproduce but some of users have this problem
iOS: 14.4.1
Device: iPhone 6s Plus

Crashed: com.apple.root.user-initiated-qos
0 libswiftCore.dylib 0x18e556aa8 assertionFailure(:_:file:line🎏) + 488
1 YPImagePicker 0x104c1a7bc closure #1 in YPLibraryVC.selectedMedia(photoCallback:videoCallback:multipleItemsCallback:) + 471 (YPLibraryVC.swift:471)
2 YPImagePicker 0x104c3f010 thunk for @escaping @callee_guaranteed () -> () + 4410912784 (:4410912784)
3 libdispatch.dylib 0x18a769298 _dispatch_call_block_and_release + 24
4 libdispatch.dylib 0x18a76a280 _dispatch_client_callout + 16
5 libdispatch.dylib 0x18a71c074 _dispatch_root_queue_drain + 688
6 libdispatch.dylib 0x18a71c704 _dispatch_worker_thread2 + 124
7 libsystem_pthread.dylib 0x1d3319568 _pthread_wqthread + 212
8 libsystem_pthread.dylib 0x1d331c874 start_wqthread + 8

@hansemannn
Copy link

Same here (multiple crashes, all iOS 14, iPhone 7 + X):

Crashed: com.apple.root.user-initiated-qos
0  libswiftCore.dylib             0x19319aaa8 _assertionFailure(_:_:file:line:flags:) + 488
1  YPImagePicker                  0x10625cb90 $s13YPImagePicker11YPLibraryVCC13selectedMedia13photoCallback05videoH0013multipleItemsH0yyAA12YPMediaPhotoCc_yAA0L5VideoCcySayAA0L4ItemOGctFyycfU_ + 4484
2  YPImagePicker                  0x10623dbd0 $sIeg_IeyB_TR + 20
3  libdispatch.dylib              0x18f3ad298 _dispatch_call_block_and_release + 24
4  libdispatch.dylib              0x18f3ae280 _dispatch_client_callout + 16
5  libdispatch.dylib              0x18f360074 _dispatch_root_queue_drain + 688
6  libdispatch.dylib              0x18f360704 _dispatch_worker_thread2 + 124
7  libsystem_pthread.dylib        0x1d7f99568 _pthread_wqthread + 212
8  libsystem_pthread.dylib        0x1d7f9c874 start_wqthread + 8

@AndriiHanets
Copy link

Same random crashes

0  libswiftCore.dylib             0x1a2b57a18 _assertionFailure(_:_:file:line:flags:) + 492
1  YPImagePicker                  0x106055994 closure #1 in YPLibraryVC.selectedMedia(photoCallback:videoCallback:multipleItemsCallback:) + 478 (YPLibraryVC.swift:478)
2  YPImagePicker                  0x10607aefc thunk for @escaping @callee_guaranteed () -> () + 4438585084 (<compiler-generated>:4438585084)
3  libdispatch.dylib              0x19eb2024c _dispatch_call_block_and_release + 32
4  libdispatch.dylib              0x19eb21db0 _dispatch_client_callout + 20
5  libdispatch.dylib              0x19eb32a68 _dispatch_root_queue_drain + 656
6  libdispatch.dylib              0x19eb33120 _dispatch_worker_thread2 + 116
7  libsystem_pthread.dylib        0x1ea9dd7d8 _pthread_wqthread + 216
8  libsystem_pthread.dylib        0x1ea9e476c start_wqthread + 8

@chenium
Copy link
Contributor

chenium commented Jul 27, 2021

Has there been any progress regarding this crash? We're also receiving crash reports related to this and unable to reproduce the crash locally. My suspicion is that self.selection, a mutable container is being access through multiple threads raising a potential race condition. Any thoughts?

@NikKovIos
Copy link
Collaborator

NikKovIos commented Aug 14, 2021

@chenium I think you're right. Now I did replaced assert by log. That wouldn't fix the problem, but user stop crash.
If someone can reproduce it, please make a PR.
Related #668

@NikKovIos NikKovIos added Crash The picker crashes ! Often asked The questions/bug/features, that are often asked. labels Aug 14, 2021
@hansemannn
Copy link

Happy to sponsor a bug bounty for this. Anyone able to fix this?

@NikKovIos
Copy link
Collaborator

@hansemannn I can't reproduce it. Maybe you can fix it?

@hansemannn
Copy link

Unfortunately I wasn't ever able to reproduce it, I just noticed it via Crashlytics. I feel like it's some kind of threading issue or maybe #696, but I wasn't even able to reproduce that.

@NikKovIos
Copy link
Collaborator

@hansemannn so am I 🤷🏻‍♂️

@majid701
Copy link
Author

@hansemannn @NikKovIos
It happens when selecting multiple assets from the library and from data I received on the crashlytics dashboard it's happening 100% on iOS 14 and above. Looks like something is happening when user taps on the multiple selection button:

Crashed: com.apple.main-thread 0 YPImagePicker 0x3b1b0 YPLibraryVC.showMultipleSelection() + 182 (YPLibraryVC.swift:182) 1 YPImagePicker 0x3aa18 YPLibraryVC.multipleSelectionButtonTapped() + 164 (YPLibraryVC.swift:164) 2 YPImagePicker 0x3ac84 @objc YPLibraryVC.multipleSelectionButtonTapped() + 4335955076 (<compiler-generated>:4335955076)

Unfortunately I haven't been able to reproduce it but I will try again on my side and post any updates here.

@krzysiek84
Copy link

krzysiek84 commented Jan 5, 2022

This happens from time to time to one of the users of my app.

I've got crash log from XCode. It crashes in showMultipleSelection and it shows the issue was because of "Unexpectedly found nil while implicitly unwrapping an Optional Value".
In this line:
let asset = mediaManager.fetchResult[currentlySelectedIndex]

So looks like fetchResult is nil. No idea though why this happens, how to replicate and what is the proper fix 🤷

@NikKovIos
Copy link
Collaborator

Tryed to fix it in beed49d
You can try this commit and say if it help.

@NikKovIos
Copy link
Collaborator

Use https://github.com/Yummypets/YPImagePicker/releases/tag/5.2.1
Should be fixed there)

@krzysiek84
Copy link

@NikKovIos Can confirm that i no longer see the crash in YPImagePicker when using 5.2.1 version 👍

@parham-up
Copy link

@paulsUsername
Copy link

Still seeing crash in 5.2.1:

Crashed: com.apple.root.user-initiated-qos
0 - 0xbb7634 closure #1 in YPLibraryVC.selectedMedia(photoCallback:videoCallback:multipleItemsCallback:) + 4349097524 (:4349097524)
1 - 0xb8ec34 thunk for @escaping @callee_guaranteed () -> () + 4348931124 (:4348931124)
2 libdispatch.dylib 0x2460 _dispatch_call_block_and_release + 32
3 libdispatch.dylib 0x3f88 _dispatch_client_callout + 20
4 libdispatch.dylib 0x15b8c _dispatch_root_queue_drain + 684
5 libdispatch.dylib 0x16284 _dispatch_worker_thread2 + 164
6 libsystem_pthread.dylib 0xdbc _pthread_wqthread + 228
7 libsystem_pthread.dylib 0xb98 start_wqthread + 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash The picker crashes ! Often asked The questions/bug/features, that are often asked.
Projects
None yet
Development

No branches or pull requests

9 participants