Skip to content

[a11y] Null-check crash (_TypeError) in _RenderObjectSemantics.updateChildren — unguarded owner! at rendering/object.dart:5875 #189908

Description

@obiot

Help us understand the severity of this issue

  • causing severe production issues e.g. malfunctions or data loss
  • blocking next binary release
  • blocking a client feature launch within a quarter
  • nice-to-have but does not block a launch within the next quarter

Surfaced as a fatal crash on Google Play's pre-launch report (Google's automated crawl runs with an accessibility service active) on a physical Android 11 device. It is a sibling of the already-fixed P1 crash #184036 — the fix (#184226) guarded _buildSemanticsSubtree but left the identical owner! deref in updateChildren (and two other methods) unguarded.

Steps to reproduce

Like #184036, this is timing/lifecycle-dependent and not deterministically reproducible from a fixed widget tree. It reproduces on Android with an accessibility service active (Google Play pre-launch report, or TalkBack) while the semantics tree is being (re)built and a render object is momentarily detached while its geometry is dirty.

The framework's own comment immediately above the crash line (rendering/object.dart, in _RenderObjectSemantics.updateChildren) describes the exact triggering scenario:

// This specific case can happen if a parent somwhere above this node decided to
// conditionally include this node.
//
// For example, render object A->B->C ...
// Frame 1: B and C both mark layout dirty, and B suddenly decide not to
// inlcude C in the semantics tree.
// In this case, C's geometry will remain dirty because it is considered as blocked.
// Frame 2: B is marked dirty again and decide C should be included
// in the semantics tree. We will run into this situation where C's geometry
// is dirty but it is not in the _nodesNeedingSemanticsGeometryUpdate.
if (childSemantics.geometryDirty) {
  renderObject.owner!._nodesNeedingSemanticsGeometryUpdate.add(childSemantics.renderObject); // ← throws when owner == null
}

renderObject.owner is null when the contributing render object is not currently attached to the pipeline owner (detached during the same frame the parent flips include→exclude→include), so owner! throws.

Expected results

The semantics/accessibility tree finalizes without crashing when a child is conditionally re-included while geometry-dirty.

Actual results

Fatal Null check operator used on a null value (_TypeError) during PipelineOwner.flushSemantics. Symbolicated framework frames (release/obfuscated build, de-obfuscated against the build's split-debug symbols; AOT code-dedup makes some frames approximate, but the crashing method and line are consistent):

Fatal Exception: Null check operator used on a null value
  PipelineOwner.flushSemantics
  _RenderObjectSemantics.updateChildren        (rendering/object.dart:5875)
  SemanticsNode.getSemanticsData / new SemanticsData
  RendererBinding.drawFrame → SchedulerBinding.handleDrawFrame

Analysis — three unguarded owner! in the geometry-dirty-nodes path

Introduced by #180375 ("Adds geometry dirty nodes"). The related P1 production crash #184036 (_TypeError in _RenderObjectSemantics._buildSemanticsSubtree, ~1000 crashes/day) was fixed by #184226, but that fix only guarded the _buildSemanticsSubtree site. Three identical owner!._nodesNeedingSemanticsGeometryUpdate.add(...) derefs remain unguarded, verified in both 3.44.4 and the latest stable 3.44.7:

rendering/object.dart Method
line 3796 RenderObject.scheduleInitialSemantics()
line 5875 _RenderObjectSemantics.updateChildren() ← this crash
line 6424 RenderObject.markNeedsUpdate()

#188298 (open, P2) is a different failure in the same updateChildren method (a sibling-config-conflict assertion via ExpansionTile + WidgetSpan), so this is not a duplicate of it.

Suggested fix

Null-guard the owner before scheduling the geometry update at all three sites, mirroring the guard added in #184226 — e.g.:

if (childSemantics.geometryDirty) {
  renderObject.owner?._nodesNeedingSemanticsGeometryUpdate.add(childSemantics.renderObject);
}

(A detached node with no owner is not in the pipeline, so the enqueue is a no-op — it will be re-scheduled when it re-attaches. If the intent is that a dirty node must be tracked, the alternative is to defer the enqueue to attach().)

Related

Flutter version

Flutter 3.44.4 • channel stable • Dart 3.12.2

Still present in 3.44.7 (latest stable). Crash device: Android 11 (arm64), accessibility service active.

Activity

  1. added
    in triage
    a: accessibility
    c: fatal crash
    team-accessibility
    on Jul 23, 2026
  2. mbcorona commented on Jul 23, 2026

    @mbcorona
    Member

    Confirmed on master. _RenderObjectSemantics.updateChildren calls renderObject.owner!._nodesNeedingSemanticsGeometryUpdate.add(...) with no null check, so it throws when the node is momentarily detached (owner is null). The same unguarded owner! is also in markNeedsUpdate. The _buildSemanticsSubtree path already guards this with if (renderObject.owner != null) (from #184226), so mirroring that guard here should fix it.
    Not a duplicate of #188298 (different failure in the same method). Routing to the accessibility team.

  3. removed
    in triage
    on Jul 23, 2026
  4. added
    P1
    triaged-accessibility
    on Jul 29, 2026
  5. self-assigned this
    on Jul 31, 2026
  6. mbcorona commented on Sep 30, 2026

    @mbcorona
    Member

    @obiot could you run your app against #192724 (branch shinofara:fix-stale-ancestor-clean-geometry-cache) with the accessibility service enabled? It fixes a geometry! crash in the same flush path with a deterministic test, and your trace can't distinguish that from the owner! at 5875. If it stops crashing, we'll close #189942 in favor of it. If you can also share the raw, un-deduplicated pre-launch report, that would settle it.

  7. added
    waiting for response
    on Sep 30, 2026
  8. obiot commented on Oct 2, 2026

    @obiot
    Author

    Hi @mbcorona, version 3.47.0 actually solved the issue for us back then(the semantics rework there seems to have narrowed it, even without the owner?. guard, and we shipped app-side workarounds in the same release, so I can't isolate/reproduce it anymore.

    Here is some more explanation from claude (sorry, explanation is getting too detailed at this point) :

    One different fatal did reach us on 3.47.0 — a single Crashlytics report, not reproduced locally: real user, Android 11 / arm64, our 1.5.0+50 beta. Symbolicated against release --split-debug-info symbols it lands in _SemanticsGeometry.computeChildGeometry (object.dart:6773) under drawFrame; the frames below that are AOT code-dedup noise. Reading the source at that point, the unguarded site looks like object.dart:6719, childRenderObject = childRenderObject.parent! in the ancestor walk, behind a.debug-only assert, so the ! throws in release AOT on a detached subtree. That may be in scope for your branch.

    Hope this helps !

  9. removed
    waiting for response
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1a: accessibilityc: fatal crashteam-accessibilitytriaged-accessibility

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions