10000 [flutter_tools] ShaderCompilerException with exit code -1073740791 · Issue #107590 · flutter/flutter · GitHub
[go: up one dir, main page]

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

[flutter_tools] ShaderCompilerException with exit code -1073740791 #107590

Closed
christopherfujino opened this issue Jul 13, 2022 · 41 comments · Fixed by flutter/engine#36158
Closed
Assignees
Labels
e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@christopherfujino
Copy link
Member
christopherfujino commented Jul 13, 2022

Two affected clients, 8 total reports, all with the same exit code on beta/3.1.0-9.0.pre

NOTE If you are experiencing this crash, please comment with the full logs from flutter run --verbose, as that would help debugging!

with command: flutter run -d chrome

ShaderCompilerException: ShaderCompilerException: Shader compilation of "C:\Users\USERNAME\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag" to "build\flutter_assets\shaders/ink_sparkle.frag" failed with exit code -1073740791.
at ShaderCompiler.compileShader(shader_compiler.dart:81)
at <asynchronous gap>(async)
at writeBundle.<anonymous closure>(bundle_builder.dart:175)
at <asynchronous gap>(async)
at Future.wait.<anonymous closure>(future.dart:522)
at <asynchronous gap>(async)
at writeBundle(bundle_builder.dart:161)
at <asynchronous gap>(async)
at WebDevFS.update(devfs_web.dart:842)
at <asynchronous gap>(async)
at ResidentWebRunner._updateDevFS(resident_web_runner.dart:491)
at <asynchronous gap>(async)
at ResidentWebRunner.run.<anonymous closure>(resident_web_runner.dart:286)
at <asynchronous gap>(async)
at asyncGuard.<anonymous closure>(async_guard.dart:111)
at <asynchronous gap>(async)

From the stacktrace, this is happening at https://github.com/flutter/flutter/blame/b005a34790add6032dedaadf5842be37b8ae38c6/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart#L77

    final List<String> cmd = <String>[
      impellerc.path,
      // TODO(zanderso): When impeller is enabled, the correct flags for the
      // target backend will need to be passed.
      // https://github.com/flutter/flutter/issues/102853
      '--flutter-spirv',
      '--spirv=$outputPath',
      '--input=${input.path}',
      '--input-type=frag',
    ];
@christopherfujino christopherfujino added tool Affects the "flutter" command-line tool. See also t: labels. engine flutter/engine repository. See also e: labels. labels Jul 13, 2022
@christopherfujino
Copy link
Member Author

cc @zanderso any clue as to the cause of this crash from impellerc?

@zanderso
Copy link
Member

Some google searching indicates that that error code corresponds to corruption of the stack. Unfortunately, we probably won't be able to track that down without the native backtrace. Hopefully someone who experiences the crash will file an issue with logs.

@chinmaygarde chinmaygarde added the e: impeller Impeller rendering backend issues and features requests label Jul 18, 2022
@chinmaygarde chinmaygarde added the P2 Important issues not at the top of the work list label Jul 18, 2022
@chinmaygarde chinmaygarde moved this to 🤔 Needs Triage in Impeller Jul 18, 2022
@chinmaygarde chinmaygarde moved this from 🤔 Needs Triage to 🐞 Bugs in Impeller Jul 18, 2022
@christopherfujino
Copy link
Member Author

This now looks like (on beta/3.3.0-0.1.pre):

ProcessException: This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.
  Command: C:\tools\flutter\bin\cache\artifacts\engine\windows-x64\impellerc.exe --flutter-spirv --spirv=build\unit_test_assets\shaders/ink_sparkle.frag --input=C:\tools\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag --input-type=frag
at _ProcessImpl._start(process_patch.dart:401)
at Process.start(process_patch.dart:38)
at LocalProcessManager.start(local_process_manager.dart:42)
at ErrorHandlingProcessManager.start.<anonymous closure>(error_handling_io.dart:691)
at _run(error_handling_io.dart:567)
at ErrorHandlingProcessManager.start(error_handling_io.dart:690)
at ShaderCompiler.compileShader(shader_compiler.dart:72)
at writeBundle.<anonymous closure>(bundle_builder.dart:184)
at <asynchronous gap>(async)
at Future.wait.<anonymous closure>(future.dart:521)
at <asynchronous gap>(async)
at writeBundle(bundle_builder.dart:162)
at <asynchronous gap>(async)
at TestCommand._buildTestAsset(test.dart:479)
at <asynchronous gap>(async)
at TestCommand.runCommand(test.dart:318)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1209)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:209)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:281)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:229)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:62)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at main(executable.dart:91)
at <asynchronous gap>(async)

@Jasguerrero
Copy link
Contributor

Could this #109627 be related?

@darshankawar
Copy link
Member
darshankawar commented Aug 29, 2022

Similar issues reported on Windows master version and closed in favor of this issue:

#110391
#110409

@progamax
Copy link
progamax commented Sep 1, 2022

I have this bug on the release 3.3.0

@zanderso
Copy link
Member
zanderso commented Sep 1, 2022

@progamax Could you please share flutter doctor --verbose output and full logs? Any additional information about your setup that you think is relevant would also be helpful. Thanks!

@progamax
Copy link
progamax commented Sep 1, 2022

I'm using VS Code
flutter doctor

[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [version 10.0.22622.586], locale fr-FR)
    • Flutter version 3.3.0 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (3 days ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\maxen\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.70.2)
    • VS Code at C:\Users\maxen\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[√] Connected device (4 available)
    • SM G996B (mobile) • R3CR30CV61H • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [version 10.0.22622.586]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 104.0.5112.81
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 104.0.1293.70

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

flutter run

Launching lib\main.dart on Edge in debug mode...

Waiting for connection from debug service on Edge...                   -
Oops; flutter has exited unexpectedly: "ShaderCompilerException: Shader compilation of "C:\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag" to "build\flutter_assets\shaders/ink_sparkle.frag" failed 
with exit code -1073740791.

Unfortunately I don't have any addition information that would be relevant

@christopherfujino
Copy link
Member Author

I'm using VS Code flutter doctor

[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [version 10.0.22622.586], locale fr-FR)
    • Flutter version 3.3.0 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (3 days ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\maxen\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.70.2)
    • VS Code at C:\Users\maxen\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[√] Connected device (4 available)
    • SM G996B (mobile) • R3CR30CV61H • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [version 10.0.22622.586]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 104.0.5112.81
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 104.0.1293.70

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

flutter run

Launching lib\main.dart on Edge in debug mode...

Waiting for connection from debug service on Edge...                   -
Oops; flutter has exited unexpectedly: "ShaderCompilerException: Shader compilation of "C:\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag" to "build\flutter_assets\shaders/ink_sparkle.frag" failed 
with exit code -1073740791.

Unfortunately I don't have any addition information that would be relevant

Can you try flutter run --verbose in case there is anything useful in the verbose logs?

@turtlepile
Copy link

We are having the same issue, as a quick solution, we downgraded our flutter :)

looking for a real solution here!

@Lorenzobettega
Copy link

As #111378 was closed, i'm gonna post my error here too so then it can help the team:

Everthing was ok when i was using flutter 3.0.5, but after the update, everytime there's an ShaderCompilerException error if i try to build my project:

flutter doctor:

[√] Flutter (Channel stable, 3.3.1, on Microsoft Windows [versÆo 10.0.22000.856], locale pt-BR)
[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
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] VS Code (version 1.71.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 3 categories.

flutter build web:

 Building with sound null safety


Target web_release_bundle failed: ShaderCompilerException: Shader compilation of
"C:\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag" to "build\web\assets\shaders/ink_sparkle.frag"
failed with exit code -1073740791.

Compiling lib\main.dart for the Web...                             52,1s
Exception: Failed to compile application for the Web.

flutter build web -v:
full_log.txt

tried running on master channel and the error is still here:

Channel master, 3.4.0-19.0.pre.192
Target web_release_bundle failed: ShaderCompilerException: Shader compilation of
"C:\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag" to "build\web\assets\shaders/ink_sparkle.frag" failed with exit code     
-1073740791.
impellerc stdout:

impellerc stderr:

Compiling lib\main.dart for the Web...                             59,8s
Exception: Failed to compile application for the Web.

@Macacoazul01
Copy link
Contributor
Macacoazul01 commented Sep 12, 2022

@darshankawar the same code that on @Lorenzobettega pc ended with an error here everything went ok:

ok_log.txt

my flutter doctor:

[√] Flutter (Channel stable, 3.3.1, on Microsoft Windows [versao 10.0.22000.918], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.71.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

Like it's shader related i don't know if it's something caused by our different gpus. We both are using windows 11, and nvidea cards. Mine is the gtx 1650 and his is the gtx 1050 ti.

@Macacoazul01
Copy link
Contributor

@christopherfujino is there any way of avoiding impeller to build on web?

@christopherfujino
Copy link
Member Author
christopherfujino commented Sep 21, 2022

Re-opening as it sounds like a more robust fix will be needed, on the following recipe CL the issue re-appears: https://flutter-review.googlesource.com/c/recipes/+/34140

Repository owner moved this from ✅ Done to 🤔 Needs Triage in Impeller Sep 21, 2022
@dnfield
Copy link
Contributor
dnfield commented Sep 22, 2022

I believe @jason-simmons found another place where the same fix is needed.

The efforts to update CI to test this more robustly have also resulted in some failures.

@darshankawar darshankawar removed the r: fixed Issue is closed as already fixed in a newer version label Sep 22, 2022
@chinmaygarde chinmaygarde moved this from 🤔 Needs Triage to ⚙️ In Progress in Impeller Sep 22, 2022
@zanderso zanderso assigned jason-simmons and unassigned zanderso Sep 22, 2022
@zanderso zanderso added P1 High-priority issues at the top of the work list tool Affects the "flutter" command-line tool. See also t: labels. and removed P2 Important issues not at the top of the work list tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 22, 2022
@jason-simmons
Copy link
Member

Command line argument processing in ImpellerC was also failing when handling non-ASCII characters on Windows.

Fixed by flutter/engine#36335

@SimplyTolex
Copy link
  • What is the full path of the directory of your project?

Renaming my programming projects folder (from Russian) to English actually helped! Thanks!

@zanderso
Copy link
Member

@christopherfujino Looking at the tool crash numbers, would it be helpful to also CP flutter/engine#36335?

@christopherfujino
Copy link
Member Author

@christopherfujino Looking at the tool crash numbers, would it be helpful to also CP flutter/engine#36335?

Yes, I think so. I'll open a CP request.

@christopherfujino
Copy link
Member Author

closing this as fixed.

Repository owner moved this from ⚙️ In Progress to ✅ Done in Impeller Oct 18, 2022
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Oct 19, 2022
@github-actions
Copy link
github-actions bot commented Nov 2, 2022

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 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.
Projects
Archived in project
0