Skip to content

Track widget builds is broken #101379

Closed

Description

@kenzieschmoll

I noticed this today when working off of Flutter 2.12.0-4.1.pre but this is reproducible on master (2.13.0-0.0.pre.386), too.

With track widget builds enabled, there appears to be an extra begin ("ph":"B") BUILD event (or sometimes more than one) that does not have a corresponding end timeline event ("ph":"E"). This results in an out of balance event tree that DevTools cannot render. I'm going to look to see if we can add some graceful handling for this in DevTools, but there is likely a spot in the framework where we are not ending a timeline event that we should fix.

In the attached json file (you'll have to remove the .txt extension to turn it back to json), the problem BUILD event is near the top of the file and is separated from the rest of the json by a few new lines. Without this event, the timeline events will render as expected in DevTools. Near the end of the json file, there is another small group events separated by new lines. We would have expected the end BUILD event to come in somewhere between "FINALIZE TREE" and "Engine::BeginFrame", but it is missing. If you add this stubbed event before "Engine::BeginFrame", the timeline events will render as expected in DevTools: {"name":"BUILD","cat":"Dart","tid":42243,"pid":48755,"ts":67688975310,"tts":3618953,"ph":"E","args":{}},

dart_devtools_2022_4_5-1649191866099915.json.txt

Activity

  1. kenzieschmoll commented on Apr 5, 2022

    @kenzieschmoll
    MemberAuthor

    I have a band-aid fix for the DevTools side of this here: flutter/devtools#3960. We will recover gracefully from bad data like this once that PR lands, but the end time for the missing event will be inferred and inaccurate, so we still need to fix this data issue on the framework side.

  2. darshankawar commented on Apr 6, 2022

    @darshankawar
    Member

    Labeling for further tracking.

  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    a: devtoolsDevTools related - suite of performance and debugging tools
    and removed
    in triagePresently being triaged by the triage team
    on Apr 6, 2022
  4. goderbauer commented on Apr 6, 2022

    @goderbauer
    Member

    @jacob314 Do you maybe have any insights into this? (Or know somebody who could look at this?)

  5. added
    c: regressionIt was better in the past than it is now
    P1High-priority issues at the top of the work list
    on Apr 6, 2022
  6. kenzieschmoll commented on Apr 7, 2022

    @kenzieschmoll
    MemberAuthor

    I expect we are missing a call to Timeline.finishSync(); somewhere, or otherwise just not reaching it. The 'BUILD' timeline event is started here:

    AFAICT, the last PR to touch the tracing code was https://github.com/flutter/flutter/pull/93086/files#diff-134bc36bd7c045a92ffff29f7efdaa7d375384911475a40343814c76c87b17cb CC @Hixie. But nothing is jumping out to me when looking at the changes to framework.dart in that PR.

  7. Hixie commented on Apr 10, 2022

    @Hixie
    Contributor

    There's been lots of changes to this code since then. Simplest way to figure out the offending PR is to bisect.

  8. added and removed
    P1High-priority issues at the top of the work list
    on Apr 10, 2022
  9. Hixie commented on Apr 10, 2022

    @Hixie
    Contributor

    This should arguably be P1 / stop ship. cc @itsjustkevin

  10. 6 remaining items

  11. jason-simmons commented on Apr 12, 2022

    @jason-simmons
    Contributor

    This started with 61ac285

    The reproduction steps above flow through the return updatedChild! code path in Element.inflateWidget, resulting in a Timeline.startSync that was not matched by a Timeline.finishSync

  12. goderbauer commented on Apr 13, 2022

    @goderbauer
    Member

    We should cherrypick the fix into the next release.

  13. jason-simmons commented on Apr 13, 2022

    @jason-simmons
    Contributor

    Filed a cherry pick request: #101867

  14. added
    r: fixedIssue is closed as already fixed in a newer version
    on Apr 14, 2022
  15. github-actions commented on Apr 28, 2022

    @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.

  16. locked as resolved and limited conversation to collaborators on Apr 28, 2022
  17. added
    P0Critical issues such as a build break or regression
    and removed on Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: devtoolsDevTools related - suite of performance and debugging toolsc: regressionIt was better in the past than it is nowframeworkflutter/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