CardField crash the app with EXC_BAD_ACCESS on iOS 13.*
See original GitHub issueDescribe 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 <CardField /> 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
EXC_BAD_ACCESS crash error: Understanding and solving it
An application will crash whenever we try to access a pointer that is invalid or no longer exists.
Read more >iOS 13 Crash EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
Since updated to iOS 13 we have had this crash in several Apps. (lldb) bt. * thread #1, queue = 'com.apple.main-thread', stop reason...
Read more >iOS13 crashes instantly for some (EXC_BAD_ACCESS ...
The issue is that some people (all after updating to iOS13) have the app instantly crash when trying to launch. Sentry doesn't seem...
Read more >AudioKit Recorder example crashes with EXC_BAD_ACCESS ...
This happens when the iOS app is opening. This will help me to debug an app I'm working on! Since I've updated to...
Read more >iOS EXC_BAD_ACCESS Crash - Unity Forum
If the app crashes on SceneManager.LoadScene() for a blank scene, doesn't that suggest there is something wrong with that Unity function ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@aganov we are aware of this issue and where it comes from, unfortunately we cannot re-implement it because of PCI compliance. We’re in the middle of looking for solution to correct card field deallocation. Thank you for providing such precise dubugging results.
We’ve created example app https://github.com/aganov/stripe-rn-ca-mask-crash containing just
react-navigation
andstripe-react-native
https://github.com/aganov/stripe-rn-ca-mask-crash/blob/master/App.js it crashes withEXC_BAD_ACCESS
onCA::Layer::mask()
every time you go back from the screen containing<CardField />
Please note that crash happens only on iOS 13.* like our production app.https://user-images.githubusercontent.com/176610/125401219-8da93c00-e3bb-11eb-9a88-1ec0d3e144ed.mp4