Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart VM compiler crash #100375

Closed
zanderso opened this issue Mar 18, 2022 · 25 comments
Closed

Dart VM compiler crash #100375

zanderso opened this issue Mar 18, 2022 · 25 comments
Assignees
Labels
c: fatal crash Crashes that terminate the process dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list

Comments

@zanderso
Copy link
Member

A crash was noticed by a customer:

  ../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc: 685: error: expected: !is_optimizing() || !instr->HasUnmatchedInputRepresentations()

Looks like that is a new assert added in dart-lang/sdk@35eef00

Which rolled into the Engine at flutter/engine@a5718ab

And into the framework at bf98767

That is in the 2.12 beta.

@a-siva @alexmarkov @dnfield

@godofredoc will there be a hotfix release for 2.12?

@zanderso zanderso added dependency: dart Dart team may need to help us c: fatal crash Crashes that terminate the process labels Mar 18, 2022
@godofredoc
Copy link
Contributor

@itsjustkevin for the details on the hot fixes schedule.

@luigi-rosso
Copy link

I wasn't able to get around this a flutter clean, btw. Issue persisted.

@alexmarkov
Copy link
Contributor

@zanderso Could you provide a reproduction? Can we see a full output of the compiler when it crashed?

@dnfield
Copy link
Contributor

dnfield commented Mar 21, 2022

@caudetgit or @luigi-rosso are you able to share a project that reproduces this compilation error?

@a-siva
Copy link
Contributor

a-siva commented Mar 21, 2022

@luigi-rosso normally the compiler dumps a stacktrace when it crashes, is it possible for you to look in the logs when these crashes happen and share the stack trace dump from the logs.

@Hixie
Copy link
Contributor

Hixie commented Mar 29, 2022

@caudetgit @luigi-rosso We're not able to make further progress without a way to reproduce this, unfortunately.

@caudetgit
Copy link

@Hixie Sorry about the delay. We'll follow up as soon as we can.

@darshankawar darshankawar added the engine flutter/engine repository. See also e: labels. label Apr 5, 2022
@a-siva
Copy link
Contributor

a-siva commented Apr 11, 2022

Should we consider lowering the priority of this issue as we don't seem to have enough timely information to make any progress.

@zanderso zanderso added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds P1 High-priority issues at the top of the work list and removed P2 labels Apr 11, 2022
@zanderso
Copy link
Member Author

Yes. I've lowered the priority and added the waiting for customer response label.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 11, 2022
@caudetgit
Copy link

Hi all. We appreciate your attention on this, given competing priorities on our end it makes sense to lower the priority of this ticket for now.

@caudetgit
Copy link

caudetgit commented May 10, 2022

updated to flutter 2.10.5 and the build errors no longer repro

@dnfield
Copy link
Contributor

dnfield commented May 10, 2022

@caudetgit - can you please check the latest Flutter beta and see if they're reproducing? When originally reported, this bug was showing on a revision past 2.10.5.

@luigi-rosso
Copy link

I was able to repro it on Flutter 3.0. This seems to only happen on Windows. I've tried a flutter clean, issue still presents itself.

  ../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc: 685: error: expected: !is_optimizing() || !instr->HasUnmatchedInputRepresentations()
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(245,5): error MSB8066: Custom build for 'C:\Users\luigi\Documents\rive\packages\editor\build\windows\CMakeFiles\7a0d611c6c003d0468c6ede5c8d1c0a8\flutter_windows.dll.rule;C:\Users\luigi\Documents\rive\packages\editor\build\windows\CMakeFiles\1290aa185e0b82bfe1dbdd59ce2f1d6f\flutter_assemble.rule' exited with code 1. [C:\Users\luigi\Documents\rive\packages\editor\build\windows\flutter\flutter_assemble.vcxproj]
Building Windows application...
Build process failed.

Doctor:

[√] Flutter (Channel unknown, 3.0.0, on Microsoft Windows [Version 10.0.19044.1645], locale en-US)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.3)
[!] Android Studio (not installed)
[√] VS Code (version 1.66.0)
[√] Connected device (3 available)

flutter run -dwindows works fine.

I don't have an isolated repro but I can try to spend some time on one as time permits, or happy to invite someone from the Dart/Flutter team to our private repository.

@a-siva
Copy link
Contributor

a-siva commented May 18, 2022

Do you have the full log of when the crash happens, the compiler dumps a stacktrace when it crashes, this would help us debug the problem. Can you capture the stacktrace from the log and post it here.

@luigi-rosso
Copy link

luigi-rosso commented May 19, 2022

There's no indication of where a log would've been written to in the terminal. I tried building the runner from vs2022 and it also fails with apparently no indication of a crashlog being written. Is there a known path I should be looking for this at?

image

image

Verbose Build

Building with --verbose dumps a bunch of stuff which looks like what you might be looking for:
flutter_build_windows_verbose.txt

@luigi-rosso
Copy link

That verbose log seems to indicate it fails compiling our websocket code. Attached
web_socket.zip

Note that I'm not including all the imports, some are pretty verbose and I'd prefer not to share them. Happy to give someone access to our repo.

@zanderso
Copy link
Member Author

Thanks @luigi-rosso! The verbose log in https://github.com/flutter/flutter/files/8723845/flutter_build_windows_verbose.txt contains the CFG for the problematic method. I expect that this may be enough information to go on.

Assigning to @a-siva to route to the right person.

@alexmarkov
Copy link
Contributor

Standalone small repro:

class ReconnectingWebsocketClient {
  int _reconnectAttempt = 0;

  void _reconnect() {
    if (_reconnectAttempt < 1) {
      _reconnectAttempt = 1;
    }
    _reconnectAttempt *= 2;
  }
}

main() {
  ReconnectingWebsocketClient()._reconnect();
}

@luigi-rosso
Copy link

Fantastic thank you both!

@a-siva a-siva removed their assignment May 19, 2022
@alexmarkov
Copy link
Contributor

It looks like this bug (mismatched representation in the IL) was recently fixed in dart-lang/sdk@2b0cd3c. The fix is not in the Flutter yet, but should be rolled in a few days.

@dnfield
Copy link
Contributor

dnfield commented May 19, 2022

Do we want ot CP this to stable?

@a-siva
Copy link
Contributor

a-siva commented May 19, 2022

I will file a request on the Dart side for cherry picking the change into Dart 2.17

@MrHBS
Copy link

MrHBS commented Oct 31, 2022

@a-siva Can this be closed now?

@zanderso
Copy link
Member Author

This can be closed.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: fatal crash Crashes that terminate the process dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list
Projects
None yet
Development

No branches or pull requests

10 participants