question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CardField crash the app with EXC_BAD_ACCESS on iOS 13.*

See original GitHub issue

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:

  1. Create navigation stack with react-navigation
  2. Add <CardField /> component
  3. Focus on CardField without enter anything
  4. Go back navigation.goBack
  5. Navigate to the screen with CardField again
  6. Try to focus CardField
  7. 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:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
arekkubaczkowskicommented, Jul 13, 2021

@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.

2reactions
aganovcommented, Jul 13, 2021

We’ve created example app https://github.com/aganov/stripe-rn-ca-mask-crash containing just react-navigation and stripe-react-native https://github.com/aganov/stripe-rn-ca-mask-crash/blob/master/App.js it crashes with EXC_BAD_ACCESS on CA::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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found