Repository navigation
Description
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
- Adds geometry dirty nodes #180375 (merged) — introduced this code
- [Google3 Bug] _TypeError crash in _RenderObjectSemantics._buildSemanticsSubtree #184036 (fixed by fixes crash when invisible semantics nodes dropped from semantics tree #184226) — P1 sibling crash,
_buildSemanticsSubtree - fixes crash when invisible semantics nodes dropped from semantics tree #184226 (merged) — the fix that did not cover
updateChildren/scheduleInitialSemantics/markNeedsUpdate - Revert "Adds geometry dirty nodes (#180375)" #184344 (closed) — revert attempt of Adds geometry dirty nodes #180375
ExpansionTilesemantics assertion with nestedWidgetSpantitle in Flutter 3.44.2 #188298 (open) — different assertion in the sameupdateChildrenmethod
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
mbcorona commentedon Jul 23, 2026
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.
mbcorona commentedon Sep 30, 2026
@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 theowner!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.obiot commentedon Oct 2, 2026
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) :
Hope this helps !
Fix null check crash in flushSemantics from a stale ancestor geometry…