Skip to content

Crash in BraintreeCore/BTWebAuthenticationSession.swift starting in v6.35.0 #1653

@ecant

Description

@ecant

Braintree SDK Version

6.35.0 and above

Environment

Production

Xcode Version

Xcode 16.4.0

OS Version & Device

Seems to span multiple iOS versions and devices (including most recent iOS 18.6.2 and iPhone 16 Pro)

Integration type

Swfit Package Manager

Development Processor

Apple Silicon (M-series chips)

Describe the bug

Summary

Our crash reporting system started reporting app crashes in the first version where we upgraded the Braintree iOS SDK from 6.34.0 to 6.35.0. We're on 6.37.0 now and the issue is still occurring.

We haven't made any code changes in our payments code that integrates with the Braintree SDK for months, so long before when this started happening.

The crash does not consistently happen, and it occurs at various points in the user journey, so there appears to be a race or timing issue of some sort involved. However, it has affected over a thousand clients in the past month.

Crash info

The crash report is consistent however: a segmentation fault when calling BTWebAuthenticationSession.start(...). The crash consistently reports as occurring on line 43 of BTWebAuthenticationSession.swift, inside the main-queue closure that invokes sessionDidAppear(self.currentSession?.start() ?? false).

FWIW, I can see there were some code changes in BTWebAuthenticationSession.swift starting in SDK version 6.35.0, which is the version we started experiencing this crash.

Here is an example screenshot of the crash stack trace:

Image

To reproduce

I have tried to reproduce this on my local device but can't so far. However, like I mentioned, we have crash reports from a thousand+ users.

Expected behavior

The SDK doesn't cause a crash in our app.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions