Skip to content

[Due for payment 2026-09-22] [$250] [Sentry: APP-93Z] HybridApp iOS EXC_BREAKPOINT in CACElementNumberStabilizer mergeLists #96177

Closed

Description

@mountiny

Sentry

https://expensify.sentry.io/issues/APP-93Z

Impact (snapshot at filing)

  • Users (total since first seen): 186
  • Events: 203
  • Users (last 14d): 33
  • First seen: 2026-03-20
  • Last seen: now (ongoing)
  • Platform: iOS HybridApp
  • App version(s): 9.4.25 through 9.4.31
  • Affected route(s): unknown (background TLS trust evaluation)
  • Mechanism: mach (EXC_BREAKPOINT)

Stack trace (top frames, first-party only)

CACElementNumberStabilizer mergeLists (Accessibility presentation merge)
_xzm_xzone_malloc_freelist_outlined
SecTrustSerialize / NWIOConnection TLS trust evaluation

Suspected cause

iOS 26 Accessibility element-number stabilizer crashes during list merge, triggered from a background TLS certificate serialization path — may be an OS-level regression interacting with network activity.

Reproduction

Unknown — see Sentry events linked from the Sentry issue.

Related

  • Sibling Sentry IDs (if any): none identified
  • Prior GH issues: none
Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. self-assigned this
    on Jul 20, 2026
  2. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 20, 2026
  3. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 20, 2026
  4. melvin-bot commented on Jul 20, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @bernhardoj (External)

  5. samranahm commented on Jul 20, 2026

    @samranahm
    Contributor

    Proposal

    What is the root cause of that problem?

    The crash frame CACElementNumberStabilizer mergeLists belongs to Apple's private Core Accessibility framework, not to first-party JavaScript. On iOS 26, when VoiceOver/accessibility recomputes element ordering it calls mergeLists, and the sibling frames (_xzm_xzone_malloc_freelist_outlined, SecTrustSerialize, NWIOConnection TLS trust evaluation) show this runs concurrently with a background TLS certificate serialization. The EXC_BREAKPOINT is a malloc freelist integrity trap that fires when the accessibility element list is being mutated on one thread while the OS stabilizer merges it on another. So the user-visible consequence (a hard crash on iOS 26 HybridApp, versions 9.4.25 through 9.4.31) is triggered inside Apple code that the app cannot call or patch directly.

    The app-side factor that raises exposure is how often we rebuild large accessibility element trees. Heavy SelectionList screens render many accessibility nodes per row. UserSelectionListItem re-derives display data and passes keyForList={item.keyForList} on every render:

    function UserSelectionListItem<TItem extends ListItem>({
    item,
    isFocused,
    isFocusVisible,
    showTooltip,
    isDisabled,
    canSelectMultiple,
    onSelectRow,
    onSelectionButtonPress,
    onDismissError,
    shouldPreventEnterKeySubmit,
    onFocus,
    shouldSyncFocus,
    wrapperStyle,
    pressableStyle,
    }: UserSelectionListItemProps<TItem>) {
    const styles = useThemeStyles();
    const currentUserPersonalDetails = useCurrentUserPersonalDetails();
    const {formatPhoneNumber, translate} = useLocalize();
    const userHandle = useMemo(() => {
    const login = item.login ?? '';
    // If the emails are not in the same private domain, we just return the users email
    if (!areEmailsFromSamePrivateDomain(login, currentUserPersonalDetails.login ?? '')) {
    return Str.removeSMSDomain(login);
    }
    // Otherwise, the emails are a part of the same private domain, so we can remove the domain and just show username
    return login.split('@').at(0);
    }, [currentUserPersonalDetails.login, item.login]);
    const userDisplayName = useMemo(() => {
    return getDisplayNameForParticipant({
    accountID: item.accountID ?? CONST.DEFAULT_NUMBER_ID,
    formatPhoneNumber,
    translate,
    });
    }, [formatPhoneNumber, item.accountID, translate]);
    return (
    <SelectableListItem
    item={item}
    wrapperStyle={[styles.flex1, styles.sidebarLinkInner, styles.userSelectNone, wrapperStyle]}
    isFocused={isFocused}
    isFocusVisible={isFocusVisible}
    isDisabled={isDisabled}
    showTooltip={showTooltip}
    canSelectMultiple={canSelectMultiple}
    onSelectRow={onSelectRow}
    onSelectionButtonPress={onSelectionButtonPress}
    onDismissError={onDismissError}
    shouldPreventEnterKeySubmit={shouldPreventEnterKeySubmit}
    rightHandSideComponent={item.rightElement}
    errors={item.errors}
    pendingAction={item.pendingAction}
    pressableStyle={pressableStyle}
    keyForList={item.keyForList}
    onFocus={onFocus}
    shouldSyncFocus={shouldSyncFocus}
    >
    <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.h13, styles.gap3]}>
    {!!item.icons?.length && (
    <View style={styles.mentionSuggestionsAvatarContainer}>
    <Avatar
    source={item.icons.at(0)?.source}
    size={CONST.AVATAR_SIZE.SMALLER}
    name={item.icons.at(0)?.name}
    avatarID={item.icons.at(0)?.id}
    type={item.icons.at(0)?.type ?? CONST.ICON_TYPE_AVATAR}
    fallbackIcon={item.icons.at(0)?.fallbackIcon}
    />
    </View>
    )}
    <View style={[styles.flex1, styles.flexRow, styles.gap2, styles.flexShrink1, styles.alignItemsCenter]}>
    <TextWithTooltip
    shouldShowTooltip={showTooltip}
    text={userDisplayName}
    style={[styles.flexShrink0, styles.optionDisplayName, isFocusVisible ? styles.sidebarLinkActiveText : styles.sidebarLinkText, styles.sidebarLinkTextBold, styles.pre]}

    When keyForList or item identity changes frequently, rows remount and the native accessibility element list is torn down and merged again. The more often that merge runs while background network/TLS activity is live, the more often iOS 26's stabilizer hits the unstable freelist and traps.

    What changes do you think we should make in order to solve the problem?

    1. Confirm the scope first: this is an iOS 26 OS regression, so the crash cannot be fully eliminated from JS. The realistic goal is to reduce how often the native accessibility element tree is rebuilt during list rendering, which reduces how often the Apple stabilizer runs and can trap.

    2. Stabilize the accessibility element count coming from SelectionList rows. In UserSelectionListItem.tsx, the memoized userHandle and userDisplayName are already stable, but the row still exposes each icon and control as its own accessibility element. Group the row into a single accessibility element so the stabilizer merges fewer nodes:

    function UserSelectionListItem<TItem extends ListItem>({
    item,
    isFocused,
    isFocusVisible,
    showTooltip,
    isDisabled,
    canSelectMultiple,
    onSelectRow,
    onSelectionButtonPress,
    onDismissError,
    shouldPreventEnterKeySubmit,
    onFocus,
    shouldSyncFocus,
    wrapperStyle,
    pressableStyle,
    }: UserSelectionListItemProps<TItem>) {
    const styles = useThemeStyles();
    const currentUserPersonalDetails = useCurrentUserPersonalDetails();
    const {formatPhoneNumber, translate} = useLocalize();
    const userHandle = useMemo(() => {
    const login = item.login ?? '';
    // If the emails are not in the same private domain, we just return the users email
    if (!areEmailsFromSamePrivateDomain(login, currentUserPersonalDetails.login ?? '')) {
    return Str.removeSMSDomain(login);
    }
    // Otherwise, the emails are a part of the same private domain, so we can remove the domain and just show username
    return login.split('@').at(0);
    }, [currentUserPersonalDetails.login, item.login]);
    const userDisplayName = useMemo(() => {
    return getDisplayNameForParticipant({
    accountID: item.accountID ?? CONST.DEFAULT_NUMBER_ID,
    formatPhoneNumber,
    translate,
    });
    }, [formatPhoneNumber, item.accountID, translate]);
    return (
    <SelectableListItem
    item={item}
    wrapperStyle={[styles.flex1, styles.sidebarLinkInner, styles.userSelectNone, wrapperStyle]}
    isFocused={isFocused}
    isFocusVisible={isFocusVisible}
    isDisabled={isDisabled}
    showTooltip={showTooltip}
    canSelectMultiple={canSelectMultiple}
    onSelectRow={onSelectRow}
    onSelectionButtonPress={onSelectionButtonPress}
    onDismissError={onDismissError}
    shouldPreventEnterKeySubmit={shouldPreventEnterKeySubmit}
    rightHandSideComponent={item.rightElement}
    errors={item.errors}
    pendingAction={item.pendingAction}
    pressableStyle={pressableStyle}
    keyForList={item.keyForList}
    onFocus={onFocus}
    shouldSyncFocus={shouldSyncFocus}
    >
    <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.h13, styles.gap3]}>
    {!!item.icons?.length && (
    <View style={styles.mentionSuggestionsAvatarContainer}>
    <Avatar
    source={item.icons.at(0)?.source}
    size={CONST.AVATAR_SIZE.SMALLER}
    name={item.icons.at(0)?.name}
    avatarID={item.icons.at(0)?.id}
    type={item.icons.at(0)?.type ?? CONST.ICON_TYPE_AVATAR}
    fallbackIcon={item.icons.at(0)?.fallbackIcon}
    />
    </View>
    )}
    <View style={[styles.flex1, styles.flexRow, styles.gap2, styles.flexShrink1, styles.alignItemsCenter]}>
    <TextWithTooltip
    shouldShowTooltip={showTooltip}
    text={userDisplayName}
    style={[styles.flexShrink0, styles.optionDisplayName, isFocusVisible ? styles.sidebarLinkActiveText : styles.sidebarLinkText, styles.sidebarLinkTextBold, styles.pre]}

    <View
        style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.h13, styles.gap3]}
        accessible
        accessibilityRole="button"
        accessibilityLabel={`${userDisplayName} ${userHandle ?? ''}`.trim()}
    >

    Collapsing each row to one accessibility element shrinks the list the OS must merge, which lowers the chance of tripping mergeLists.

    1. Because the crash originates in Apple's framework, also add a Sentry inbound-filter/beforeSend entry for the CACElementNumberStabilizer mergeLists signature so this OS-level noise stops dominating the dashboard while the mitigation ships and iOS point releases land. This uses the existing Sentry wiring referenced by the stub in sentry-react-native.ts:

    const Sentry = {
    startInactiveSpan,

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. melvin-bot commented on Jul 20, 2026

    @melvin-bot
  7. changed the title [-][Sentry: APP-93Z] HybridApp iOS EXC_BREAKPOINT in CACElementNumberStabilizer mergeLists[/-] [+][$250] [Sentry: APP-93Z] HybridApp iOS EXC_BREAKPOINT in CACElementNumberStabilizer mergeLists[/+] on Jul 20, 2026
  8. yuvrajangadsingh commented on Jul 20, 2026

    @yuvrajangadsingh
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    iOS 26 HybridApp is hard-crashing with an EXC_BREAKPOINT whose top frames flip between Apple's accessibility element merge (CACElementNumberStabilizer mergeLists) and a background TLS trust evaluation (SecTrustSerialize / NWIOConnection), with _xzm_xzone_malloc_freelist_outlined sitting in the middle. 186 users, app versions 9.4.25 to 9.4.31, no known repro.

    What is the root cause of that problem?

    The only frame that names the actual failure is _xzm_xzone_malloc_freelist_outlined. That is iOS's malloc catching a corrupted zone freelist and trapping with EXC_BREAKPOINT. So this is a heap-corruption crash, not an accessibility logic bug. The bad write happens earlier, and the trap fires on the next allocation that touches the poisoned zone. That is why the "cause" frame changes between events: accessibility element merging in some, TLS certificate serialization in others. Whoever corrupts the heap has to live in both of those worlds.

    The one thing in the app that instruments both the view/accessibility tree and background TLS network activity is FullStory. Its session-replay engine walks the native view hierarchy including accessibility elements to build each replay frame, and it continuously uploads captured session bundles over HTTPS on background threads, which is precisely SecTrustSerialize / NWIOConnection. You can see how deep it reaches into RN internals in node_modules/@fullstory/react-native/ios/FullStory.mm, where FSReactSwizzleBootstrap swizzles RCTComponentData viewConfig, every RCTViewComponentView subclass's handleCommand:args:, and RNNComponentViewController renderReactViewIfNeeded.

    We already have a use-after-free from this exact SDK in HybridApp: #91225, patched in this same file. That patch (patches/@fullstory/react-native/@fullstory+react-native+1.9.0.patch) added an invalidate that clears _eventEmitterCallback when the NewDot bridge tears down on the ND to OD switch. But it only clears the callback. It never stops FullStory's capture engine. After the bridge invalidates, the FS singleton is still registered as the SDK delegate (FS.delegate = self in init) and keeps walking now-freed RN view objects and firing background upload callbacks against a half torn-down runtime. That is the corruption source, and the malloc trap lands wherever the next allocation happens, accessibility or TLS. It reads as iOS-26-only and HybridApp-only because iOS 26 tightened the malloc zone integrity checks, so a pre-existing corruption that used to slide by now traps, and only HybridApp tears the RN bridge down while a FullStory session is live.

    I can't point at the exact offending line because the corruptor is inside FullStory's closed FullStory xcframework, pinned at 1.70.1 in ios/Podfile:133. The app-side surface we do control is when the SDK runs relative to bridge teardown, and which SDK build we ship.

    What changes do you think we should make in order to solve the problem?

    Two things, mirroring how #91225 was handled.

    Extend the existing FullStory patch so the SDK actually stops capturing when the bridge tears down, instead of only nulling the callback. shutdown is already exported by the module (RCT_EXPORT_METHOD(shutdown) calling [FS shutdown]) but nothing in JS ever calls it. Add it to invalidate in patches/@fullstory/react-native/@fullstory+react-native+1.9.0.patch:

    - (void)invalidate {
        // Stop capture before the bridge tears down so FullStory's screen-capture and
        // background upload threads stop touching freed RN views (APP-93Z, #91225).
        [FS shutdown];
        _eventEmitterCallback = nullptr;
    }

    This is safe because capture already gets re-armed on the way back. consentAndIdentify in src/libs/Fullstory/index.native.ts:44 calls FullStory.restart(), and that fires whenever UserMetadata updates, wired at src/libs/actions/Session/index.ts:114. So NewDot coming back turns FullStory on again exactly like it does today.

    Then bump the pinned FullStory native SDK past 1.70.1 at ios/Podfile:133 and re-run pod install to refresh Podfile.lock. 1.70.1 predates iOS 26's stricter malloc zones, and FullStory ships iOS 26 memory fixes in newer builds. The teardown-stop closes the HybridApp race; the SDK bump covers the case where 1.70.1 corrupts the heap during normal capture on iOS 26 even without a teardown. I'd open a FullStory support ticket with the Sentry stack so they can confirm the fixed version before we pin it.

    What alternative solutions did you explore? (Optional)

    I looked at the "it's just an Apple accessibility regression, collapse the SelectionList rows into one accessibility element" route, but that can't explain the events that crash in the TLS path, and you don't fix a malloc freelist trap by shrinking the accessibility node count. I also checked whether another native SDK (the Sentry profiler, group-ib) could be the corruptor, but FullStory is the only one that touches both the accessibility tree and background TLS uploads, and it already has a documented HybridApp UAF right here. A Sentry inbound filter for this signature is worth adding to cut dashboard noise while the real fix ships, but it has to go on the native Sentry init (ios/SentryNativeSDKManager.m) or Sentry's server-side inbound filters, not the JS beforeSend in setupSentry.ts, since this is a native mach crash the JS layer never sees. That only hides it though, so it's a companion, not the fix.

  9. bernhardoj commented on Jul 21, 2026

    @bernhardoj
    Contributor

    @MelvinBot please investigate this issue. Can you check if this is related to an iOS 26 native Network module regression?

  10. melvin-bot commented on Jul 21, 2026

    @melvin-bot

    I can't run change requests for your access level. I can investigate, or file an issue in Expensify/Expensify instead.


    Failed after 0s · 0 tools used · view debug log

  11. 63 remaining items

  12. ZhenjaHorbach commented on Sep 22, 2026

    @ZhenjaHorbach
    Contributor

    I reviewed one PR!

  13. bernhardoj commented on Sep 22, 2026

    @bernhardoj
    Contributor

    I only analyze the root cause but don't review the PR since I don't have access to physical iOS.

  14. melvin-bot commented on Sep 22, 2026

    @melvin-bot

    Payment Summary

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  15. mallenexpensify commented on Sep 24, 2026

    @mallenexpensify
    Contributor

    @bernhardoj @ZhenjaHorbach can you provide the PR link/s and tag me? Thx

  16. melvin-bot commented on Oct 1, 2026

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  17. mallenexpensify commented on Oct 3, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @ZhenjaHorbach due $250 via NewDot
    Contributor+: @bernhardoj due $75 via NewDot

    @bernhardoj this is a bit of an edge case, I sent wtih 25% mainly cuz I don't think we should pay out 1.5x or higher on issues where C+ should be able to see them through, from start to finish (or ask to reassign and not be due compensation).

    @ZhenjaHorbach plz complete the Contributor+ checklist and tag me in a post once you have. Thx

  18. ZhenjaHorbach commented on Oct 3, 2026

    @ZhenjaHorbach
    Contributor

    Oh
    Sorry
    I’ll add the checklist today or tomorrow!

  19. ZhenjaHorbach commented on Oct 5, 2026

    @ZhenjaHorbach
    Contributor

    @mallenexpensify
    I think the checklist isn't needed here
    This is an iOS 26 OS-level crash, not a regression from a PR, and there are no repro steps for a regression test
    And the fix is verified via Sentry

  20. garrettmknight commented on Nov 5, 2026

    @garrettmknight
    Contributor

    $250 approved for @ZhenjaHorbach

  21. flaviadefaria commented on Nov 9, 2026

    @flaviadefaria
    Contributor

    Approved: @bernhardoj due $75 via NewDot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions