Skip to content

_CastError in SemanticsOwner.performAction #100358

Closed

Description

@koral--

Steps to Reproduce

This is an automated anonymous crash report.
According to breadcrumbs, it happened right after navigating to a page.

Expected results:
No exception is thrown.

Actual results:

_CastError: Null check operator used on a null value
  File "semantics.dart", line 3092, in SemanticsOwner.performAction
  File "binding.dart", line 347, in RendererBinding._handleSemanticsAction
  File "hooks.dart", line 210, in _invoke3.<fn>
  File "zone.dart", line 1428, in _rootRun
  File "zone.dart", line 1328, in _CustomZone.run
  File "zone.dart", line 1236, in _CustomZone.runGuarded
  File "hooks.dart", line 209, in _invoke3
  File "platform_dispatcher.dart", line 919, in PlatformDispatcher._dispatchSemanticsAction
  File "hooks.dart", line 98, in _dispatchSemanticsAction
Code sample No app code is involved. Check `SemanticsOwner` in this repo.
Logs

N/A

No issues found!

App was built on CI, some time ago, so I could not execute shell commands. However, here is the relevant part of the log which is available:

Flutter 2.8.1 • channel unknown • unknown source
Framework • revision 77d935af4d (3 months ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1

It looks like there is an issue with code here: https://github.com/flutter/flutter/blob/flutter-2.8-candidate.20/packages/flutter/lib/src/semantics/semantics.dart#L3092

    if (action == SemanticsAction.showOnScreen && _nodes[id]!._showOnScreen != null)
      _nodes[id]!._showOnScreen!();
  }

_nodes[id] turned out to be bull, the same code is still there on master, only line numbers are slightly changed.
The trivial fix is to add a nullcheck for _nodes[id]. However, there might be a deeper error.

Activity

  1. darshankawar commented on Mar 18, 2022

    @darshankawar
    Member

    The implementation seems to be same on latest master:

    if (action == SemanticsAction.showOnScreen && _nodes[id]!._showOnScreen != null)

    Keeping it open and labeling for further investigation from the team.

    /cc @chunhtai

  2. added
    c: crashStack traces logged to the console
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    a: productionIssues experienced in live production apps
    and removed
    in triagePresently being triaged by the triage team
    on Mar 18, 2022
  3. chunhtai commented on Mar 18, 2022

    @chunhtai
    Contributor

    Do you know the OS of the device when the crashes happened?

  4. koral-- commented on Mar 18, 2022

    @koral--
    Author

    iPad Air (4th generation)
    Model:J307AP
    iOS 15.3.1

  5. goderbauer commented on Feb 27, 2023

    @goderbauer
    Member

    Also observed at b/270962612. cc @apwilson

  6. goderbauer commented on Feb 27, 2023

    @goderbauer
    Member

    Pretty sure it should be

     if (action == SemanticsAction.showOnScreen && _nodes[id]?._showOnScreen != null) 

    I'll send a PR.

  7. self-assigned this
    on Feb 27, 2023
  8. added
    P1High-priority issues at the top of the work list
    on Feb 27, 2023
  9. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 28, 2023
  10. github-actions commented on Mar 14, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: productionIssues experienced in live production appsc: crashStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions