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 AOT precompiler crash #79441

Closed
vaind opened this issue Mar 31, 2021 · 5 comments
Closed

Flutter AOT precompiler crash #79441

vaind opened this issue Mar 31, 2021 · 5 comments
Assignees
Labels
a: build Building flutter applications with the tool c: crash Stack traces logged to the console dependency: dart Dart team may need to help us found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically

Comments

@vaind
Copy link
Member

vaind commented Mar 31, 2021

Steps to Reproduce

  1. flutter create errorful
  2. change lib/main.dart contents to https://gist.github.com/vaind/2ffd8c8bde7e2d0bd1fc9559cbdfb3be
  3. change pubspec.yaml min SDK version to 2.12 to enable null-safety
  4. flutter build apk --release

you get ../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 2761: error: unreachable code

Logs

Logs
Running "flutter pub get" in errorful...                           390ms

💪 Building with sound null safety 💪

../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 2761: error: unreachable code
Dart snapshot generator failed with exit code -6                        
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/home/ivan/lib/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildRelease'.            
> Process 'command '/home/ivan/lib/flutter/bin/flutter'' finished with non-zero exit value 1
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 3s                                                      
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                       3.6s
Gradle task assembleRelease failed with exit code 1

[✓] Flutter (Channel stable, 2.0.3, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.3 at /home/ivan/lib/flutter
    • Framework revision 4d7946a68d (12 days ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2
@mraleph
Copy link
Member

mraleph commented Mar 31, 2021

Seems like we are stuck in speculation loop in one of the functions. @alexmarkov could you take a look?

@mraleph mraleph added the dependency: dart Dart team may need to help us label Mar 31, 2021
vaind added a commit to objectbox/objectbox-dart that referenced this issue Mar 31, 2021
@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Mar 31, 2021
@TahaTesser
Copy link
Member

Hi @vaind
I can confirm it

logs
tahatesser@Tahas-MacBook-Pro errorful % flutterm build apk --release
Running "flutter pub get" in errorful...                         1,214ms

💪 Building with sound null safety 💪

../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3177: error: unreachable code
Dart snapshot generator failed with exit code -6                        
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/tahatesser/Code/flutter_master/packages/flutter_tools/gradle/flutter.gradle' line: 1029
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildRelease'.            
> Process 'command '/Users/tahatesser/Code/flutter_master/bin/flutter'' finished with non-zero exit value 1
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 47s                                                     
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      48.0s
Gradle task assembleRelease failed with exit code 1
tahatesser@Tahas-MacBook-Pro errorful % 
flutter doctor -v
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale
    en-GB)
    • Flutter version 2.0.3 at /Users/tahatesser/Code/flutter_stable
    • Framework revision 4d7946a68d (13 days ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.54.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.20.0

[✓] Connected device (3 available)
    • iPhone 12 (mobile) • 83060656-28E7-44CD-801E-B11EC3EC89BA • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64
      • macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript
      • Google Chrome 89.0.4389.114

• No issues found!
[✓] Flutter (Channel master, 2.1.0-13.0.pre.346, on macOS 11.2.3 20D91
    darwin-x64, locale en-GB)
    • Flutter version 2.1.0-13.0.pre.346 at
      /Users/tahatesser/Code/flutter_master
    • Framework revision 8158b478d7 (9 hours ago), 2021-03-31 13:29:03 +0800
    • Engine revision dbcbf69a57
    • Dart version 2.13.0 (build 2.13.0-175.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.54.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.20.0

[✓] Connected device (3 available)
    • iPhone 12 (mobile) • 83060656-28E7-44CD-801E-B11EC3EC89BA • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64
      • macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript
      • Google Chrome 89.0.4389.114

• No issues found!

Thanks for filing the issue!

@TahaTesser TahaTesser added a: build Building flutter applications with the tool found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels Mar 31, 2021
@alexmarkov
Copy link
Contributor

Fix: https://dart-review.googlesource.com/c/sdk/+/193824.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Apr 6, 2021
…nd stores

Previously, FFI store could use kUnboxedUint32 for value being stored
via 8-bit or 16-bit StoreIndexed instruction. However, such
StoreIndexed instructions require kUnboxedIntPtr representation.
Due to the mismatch in the representations, SelectRepresentations
pass inserts a speculative (deoptimizing) IntConverter instruction,
which cases crash in AOT mode. Similar problem exists for FFI loads.

This change corrects representation when unboxing value in the body
of FFI store intrinsics and when boxing the value in FFI loads,
so representation of the value matches representation required by
StoreIndexed / returned by LoadIndexed.

TEST=ffi/regress_flutter79441_test
Fixes flutter/flutter#79441

Change-Id: Ida144e8d2e7a69d6767c9d4447bb20e79d847d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193824
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
@alexmarkov
Copy link
Contributor

The fix was rolled into Flutter in e5f75db.

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

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 Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool c: crash Stack traces logged to the console dependency: dart Dart team may need to help us found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically
Projects
None yet
Development

No branches or pull requests

4 participants