Closed
Description
Describe the bug
<CardField />
cause a crash if field is not completed when focused previously and got unmounted later on. Happens only on iOS 12
To Reproduce
Steps to reproduce the behavior:
- Create navigation stack with react-navigation
- Add
<CardField />
component - Focus on CardField without enter anything
- Go back
navigation.goBack
- Navigate to the screen with
CardField
again - Try to focus
CardField
- App crashes with
EXC_BAD_ACCESS
I'm expecting this to crash too if got unmounted and mounted again on the same screen, but have not tried it yet.
Expected behavior
App not crashing
Smartphone (please complete the following information):
- Device: iPhone 8 (sim), iPad mini 2 (real device)
- OS: iOS 12.4
- Stripe iOS SDK: 21.6.0
- Stripe React Native SDK: 0.14
Additional context
Exception Type: EXC_BAD_ACCESS
Exception Subtype: KERN_INVALID_ADDRESS
EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x3ff0000000000008.
0 QuartzCore _CALayerGetSuperlayer
1 UIKitCore -[UIView(UIKitManual) superview]
2 UIKitCore -[UITextSelectionView removeFromSuperview]
3 UIKitCore -[UITextSelectionView invalidate]
4 UIKitCore -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) dealloc]
5 UIKitCore -[UITextField dealloc]
6 CoreFoundation -[__NSDictionaryM removeAllObjects]
7 UIKitCore -[UIKBAutofillController clearAutofillGroup]
8 UIKitCore -[UIKBAutofillController _needAutofillCandidate:delegateAsResponder:]
9 UIKitCore -[UIKBAutofillController needAutofillCandidate:delegateAsResponder:keyboardState:]
10 UIKitCore -[UIKeyboardImpl needAutofillCandidate:]
11 UIKitCore -[UIKeyboardImpl setDelegate:force:]
12 UIKitCore -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:]
13 UIKitCore -[UIResponder(UIResponderInputViewAdditions) reloadInputViews]
14 UIKitCore -[UIResponder becomeFirstResponder]
15 UIKitCore -[UIView(Hierarchy) becomeFirstResponder]
16 UIKitCore -[UITextField becomeFirstResponder]
17 UIKitCore -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary]
18 UIKitCore -[UITextSelectionInteraction oneFingerTap:]
19 UIKitCore -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
20 UIKitCore __UIGestureRecognizerSendTargetActions
21 UIKitCore __UIGestureRecognizerSendActions
22 UIKitCore -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
23 UIKitCore __UIGestureEnvironmentUpdate
24 UIKitCore -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:]
25 UIKitCore -[UIGestureEnvironment _updateForEvent:window:]
26 UIKitCore -[UIWindow sendEvent:]
27 UIKitCore -[UIApplication sendEvent:]
28 UIKitCore ___dispatchPreprocessedEventFromEventQueue
29 UIKitCore ___handleEventQueueInternal
30 UIKitCore ___handleHIDEventFetcherDrain
31 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
32 CoreFoundation ___CFRunLoopDoSource0
33 CoreFoundation ___CFRunLoopDoSources0
34 CoreFoundation ___CFRunLoopRun
35 CoreFoundation _CFRunLoopRunSpecific
36 GraphicsServices _GSEventRunModal
37 UIKitCore _UIApplicationMain
38 ExampleApp _mh_execute_header (ExampleApp)
39 libdyld.dylib _start
Activity