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

FFI doesn't work on some arm-v7a android devices #54948

Closed
simolus3 opened this issue Apr 16, 2020 · 30 comments
Closed

FFI doesn't work on some arm-v7a android devices #54948

simolus3 opened this issue Apr 16, 2020 · 30 comments
Labels
e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. platform-android Android applications specifically

Comments

@simolus3
Copy link
Contributor

Problem

I maintain a package providing sqlite3 bindings with dart:ffi (called moor_ffi). Some users were reporting that on some devices, inserting a (64 bit) integer will write bogus values to the database (link to issue).

I could reproduce this with a very minimal native library:

int test_2(void* stmt, int bar, int64_t baz) {
  // same signature as sqlite3_bind_int64
  return baz >> 32;
}

I'm binding to this function in Dart using

class SomeStruct extends Struct {}

typedef test_2_native = Int32 Function(Pointer<SomeStruct>, Int32, Int64);
typedef test_2 = int Function(Pointer<SomeStruct>, int, int);

Calling test2(Pointer.fromAddress(0xdeadbeef), 123, 1); returns 1 on some devices. I would expect it to return 0, as it does on most devices. While it looks like this problem only happens on arm-v7a devices, it doesn't happen on every arm-v7a device, and also not on each android version.

Steps to Reproduce

This requires the NDK to be installed and available.

  1. Check out https://github.com/simolus3/arm-ffi-repro
  2. Run flutter run --release on an affected device
  3. See exception in the output

Affected devices

@pY4x3g could reproduce this on a Moto G5 Plus, running Android 8.1. Their flutter doctor output was

[√] Flutter (Channel beta, v1.17.0, on Microsoft Windows [Version 10.0.18363.720], locale de-DE)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.6)
[!] IntelliJ IDEA Community Edition (version 2019.3)
    X Flutter plugin not installed; this adds Flutter specific functionality.
[!] VS Code, 64-bit edition (version 1.43.0)
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)

! Doctor found issues in 2 categories.

If the small repro has the same underlying problem as the one in moor_ffi, devicelab failures provided by @britannio indicate that the devices listed here are affected as well.

I don't know if it helps, but it seems like this does not happen on all arm-v7a devices. The only 32 bit arm device I have is an old Galaxy S3, where this does not happen.

@VladyslavBondarenko VladyslavBondarenko added e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. platform-android Android applications specifically labels Apr 16, 2020
@mraleph
Copy link
Member

mraleph commented Apr 28, 2020

Seems really strange that it only affects some devices, ABI should be the same.

/cc @dcharkes

@mraleph
Copy link
Member

mraleph commented Apr 28, 2020

/cc @mkustermann

@dcharkes
Copy link
Contributor

dcharkes commented May 11, 2020

I added the test, but it does not repro on the phone that I'm using to test, a Nexus 5X.

$ tools/test.py -n dartk-android-debug-arm tests/ffi_2/regress_flt54948_test.dart  &&  tools/test.py -n dartkp-android-debug-arm tests/ffi_2/regress_flt54948_test.dart
Test configuration:
    dartk-android-debug-arm(architecture: arm, compiler: dartk, mode: debug, runtime: vm, system: android)
Suites tested: ffi_2
Found 1 Android devices.
[00:46 | 100% | +    1 | -    0]

=== All 1 test passed ===
Test configuration:
    dartkp-android-debug-arm(architecture: arm, compiler: dartkp, mode: debug, runtime: dart_precompiled, system: android)
Suites tested: ffi_2
Found 1 Android devices.
[00:37 | 100% | +    1 | -    0]

=== All 1 test passed ===

It also doesn't repro on QEMU, but that uses a slightly different ABI: armabihf. And unfortunately QEMU doesn't come with Cortex A53 core simulation, which are the ones in the Snapdragon 625, in the Moto G5 Plus.

$ qemu-arm -cpu cortex-a15 -L /usr/arm-linux-gnueabihf/ out/DebugXARM/dart --ignore-unrecognized-flags --packages=/usr/local/google/home/dacoharkes/dart-sdk/sdk/.packages /usr/local/google/home/dacoharkes/dart-sdk/sdk/tests/ffi_2/regress_flt54948_test.dart

@britannio It would be useful to know how exactly the FFI call fails.

  • Does it happen on arguments in all positions?
  • How are the bits mangled? Deterministic or not? Are the bits garbage, or some kind of permutation of the arguments?
  • Maybe to be sure that it's not some kind of build artifact, if you know how to build the Dart SDK with my testing CL, check if it reproduces on that test.

@britannio
Copy link

@dcharkes I'm not really involved in this so I'm tagging @simolus3

@simolus3
Copy link
Contributor Author

a Nexus 5X

From Wikipedia it looks like that phone has a Snapdragon S808, which according to this is 64 bit. I guess that shouldn't make a difference when running a 32-bit app but it looks like this bug is specific to some few devices.

Note that I couldn't reproduce this myself, but from this comment it sounds like the test should fail on a Moto G5 Plus.

How are the bits mangled?

If you mean the last parameter, I was just trying to iterate over random values to reproduce this. The function was supposed to mimic sqlite3_bind_int64, where the last parameter is a 64 bit int.

I'll try to reproduce this in Firebase Test Lab. If that works I can try to move the 64 bit arg to a different position as well.

@dcharkes
Copy link
Contributor

dcharkes commented May 21, 2020

@mraleph The cross compiler (simarm_x64/gen_snapshot) also doesn't trigger this on QEMU.

$ tools/test.py -n dartkp-linux-debug-arm-qemu -k -v tests/ffi_2/regress_flt54948_test.dart
Test configuration:
    dartkp-linux-debug-arm-qemu(architecture: arm, compiler: dartkp, mode: debug, runtime: dart_precompiled, system: linux, use-qemu)
Suites tested: ffi_2
Running "vm_compile_to_kernel []" command: DART_CONFIGURATION=DebugXARM /usr/local/google/home/dacoharkes/dart-sdk/sdk/pkg/vm/tool/gen_kernel --aot --platform=out/DebugXARM/vm_platform_strong.dill -o /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.dill /usr/local/google/home/dacoharkes/dart-sdk/sdk/tests/ffi_2/regress_flt54948_test.dart --packages=/usr/local/google/home/dacoharkes/dart-sdk/sdk/.packages -Ddart.vm.product=false -Ddart.developer.causal_async_stacks=true
Running "precompiler" command: DART_CONFIGURATION=DebugXARM out/DebugSIMARM_X64/gen_snapshot --snapshot-kind=app-aot-assembly --assembly=/usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.S --no-use-integer-division --ignore-unrecognized-flags --packages=/usr/local/google/home/dacoharkes/dart-sdk/sdk/.packages /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.dill
Running "assemble" command: DART_CONFIGURATION=DebugXARM arm-linux-gnueabihf-gcc -shared -nostdlib -o /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.aotsnapshot /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.S
Running "vm" command: DART_CONFIGURATION=DebugXARM qemu-arm -L /usr/arm-linux-gnueabihf/ out/DebugXARM/dart_precompiled_runtime --ignore-unrecognized-flags --packages=/usr/local/google/home/dacoharkes/dart-sdk/sdk/.packages /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.aotsnapshot
Done dartkp-dart_precompiled debug_arm ffi_2/regress_flt54948_test: pass

Neither does not cross compiling (out/DebugXARM/clang_x86/gen_snapshot):

$ out/DebugXARM/clang_x86/gen_snapshot --snapshot-kind=app-aot-assembly --assembly=/usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.S --no-use-integer-division --ignore-unrecognized-flags --packages=/usr/local/google/home/dacoharkes/dart-sdk/sdk/.packages /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.dill
$ arm-linux-gnueabihf-gcc -shared -nostdlib -o /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.aotsnapshot /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.S
$ qemu-arm -L /usr/arm-linux-gnueabihf/ out/DebugXARM/dart_precompiled_runtime --ignore-unrecognized-flags --packages=/usr/local/google/home/dacoharkes/dart-sdk/sdk/.packages /usr/local/google/home/dacoharkes/dart-sdk/sdk/out/DebugXARM/generated_compilations/dartkp/tests_ffi_2_regress_flt54948_test/out.aotsnapshot

I was also trying to double check if there is any discrepancy between standalone dart (tested to tools/test.py) and Flutter. However, I'm pretty sure this runs in 64 bit (on a 64 bit phone like the Nexus 5X):

$ flutter run --release
Launching lib/main.dart on Nexus 5X in release mode...
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      19.0s
✓ Built build/app/outputs/flutter-apk/app-release.apk (6.3MB).
Installing build/app/outputs/flutter-apk/app.apk...                 9.7s

Flutter run key commands.
h Repeat this help message.
c Clear the screen
q Quit (terminate the application on the device).
I/flutter (23489): check succeeded

Application finished.

We can specify a target platform when building, but not when running:

$ flutter build apk --release --target-platform=android-arm
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                       1.9s
✓ Built build/app/outputs/flutter-apk/app-release.apk (5.0MB).
$ flutter run --release --target-platform=android-arm
Could not find an option named "target-platform".

Is it possible to get flutter run to run a 32 bit app on a 64 bit phone?

@mkustermann
Copy link
Member

Firstly thank you very much for the detailed bug report!

I have tried to follow the reproduction instructions from #54948 (comment) on Moto 4G / Nexus 5X without success.

@simolus3 @pY4x3g @britannio Could I ask you confirm that this issue persists with newest master of flutter/flutter and tell us which device you can confirm this on?

If we have confirmation, we can purchase such a device and get to the bottom of it.

@jonahwilliams
Copy link
Member

We don't support a targetPlatform argument to run anymore (we really should add it back). But you can simulate it by building the APK variant you want with --target-platform, and then running with flutter run --use-application-binary=path/to/app.apk

@andreystavitsky
Copy link

E/flutter (12232): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: test_2(1) = 1. Expected 0
E/flutter (12232): #0      runCheck (package:arm_ffi_repro/ffi_repro.dart:41)
E/flutter (12232): #1      main (file:///e:/Projects/_Flutter_Projects/repro/lib/main.dart:7)
E/flutter (12232): #2      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:247)
E/flutter (12232): #3      _rootRun (dart:async/zone.dart:1190)
E/flutter (12232): #4      _CustomZone.run (dart:async/zone.dart:1093)
E/flutter (12232): #5      _runZoned (dart:async/zone.dart:1630)
E/flutter (12232): #6      runZonedGuarded (dart:async/zone.dart:1618)
E/flutter (12232): #7      _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:239)
E/flutter (12232): #8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301)
E/flutter (12232): #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168)
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.19.0-2.0.pre.145, on Microsoft Windows [Version 10.0.18363.836], locale ru-RU)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.45.1)
[√] Connected device (1 available)

• No issues found!

Huawei Honor 8S (MediaTek Helio A22 MT6761), 64 bit Cortex-A53

@mkustermann
Copy link
Member

@andreystavitsky Thank you!

We have ordered a Honor 8S 32GB, Dual SIM, Android 9.0 (Pie), MediaTek MT6761. It will take some time until it arrives. We'll update the thread once it arrives and we can verify the problem.

@mkustermann
Copy link
Member

@andreystavitsky The good news is that our Honor 8S arrived today. The bad news is that I cannot reproduce the issue.

First I prepare my flutter checkout to have a close version to what was reported:

<flutter-flutter-checkout> % git checkout 1.19.0-2.0.pre -b ffi-bug

Then I build the app via:

% git clone https://github.com/simolus3/arm-ffi-repro                
Cloning into 'arm-ffi-repro'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 47 (delta 0), reused 47 (delta 0), pack-reused 0
Receiving objects: 100% (47/47), 15.02 KiB | 0 bytes/s, done.

% cd arm-ffi-repro

arm-ffi-repro % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.19.0-2.0.pre, on Mac OS X 10.15.3 19D76, locale en-US)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.45.1)
[✓] Connected device (4 available)

• No issues found!

% flutter build apk --release --target-platform=android-arm --split-per-abi
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      36.6s
✓ Built build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk (5.0MB).

% adb install build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk 
Performing Streamed Install
Success

=> I can launch the app without any issues on Huawei Honor 8S.

When digging a little deeper it seems like the CPU in Honor 8S is capable of 64-bit but the Android OS runs in 32-bit system.

The next hypothesis I had was that this was somehow a Windows specific problem, so I've tried to build the APK the same way on windows and install it but it sill succeeds.

@andreystavitsky Could you make the APK you built (and crashes) publicly available?

@andreystavitsky
Copy link

andreystavitsky commented Jun 3, 2020

I'm using flutter run --release

https://send.firefox.com/download/3daf11e2a8d15d64/#de2J7kIPiH7RfJdplzkYZQ

I can try to build on Mac and then provide access to my Mac.

@andreystavitsky
Copy link

Well, I cant reproduce this bug on Mac, only on Windows
Windows 10 2004 19041.264 Pro, Hyper-V enabled, installed Docker and WSL2

d:\Projects\_Flutter_Projects\repro2>flutter doctor -v
[√] Flutter (Channel stable, v1.17.2, on Microsoft Windows [Version 10.0.19041.264], locale uk-UA)
    • Flutter version 1.17.2 at D:\Projects\_Flutter
    • Framework revision 5f21edf8b6 (6 days ago), 2020-05-28 12:44:12 -0700
    • Engine revision b851c71829
    • Dart version 2.8.3

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\andre\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.45.1)
    • VS Code at C:\Users\andre\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.11.0

[√] Connected device (1 available)
    • KSA LX9 • 3PQNU20104300142 • android-arm • Android 9 (API 28)
d:\Projects\_Flutter_Projects\repro2>flutter run --release
Launching lib\main.dart on KSA LX9 in release mode...
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                       8,9s
√ Built build\app\outputs\apk\release\app-release.apk (5.9MB).
Installing build\app\outputs\apk\app.apk...                         2,5s

Flutter run key commands.
h Repeat this help message.
c Clear the screen
q Quit (terminate the application on the device).
E/flutter (13281): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: test_2(1) = 1. Expected 0
E/flutter (13281): #0      runCheck (package:arm_ffi_repro/ffi_repro.dart:41)
E/flutter (13281): #1      main (file:///d:/Projects/_Flutter_Projects/repro2/lib/main.dart:7)
E/flutter (13281): #2      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:241)
E/flutter (13281): #3      _rootRun (dart:async/zone.dart:1184)
E/flutter (13281): #4      _CustomZone.run (dart:async/zone.dart:1077)
E/flutter (13281): #5      _runZoned (dart:async/zone.dart:1619)
E/flutter (13281): #6      runZonedGuarded (dart:async/zone.dart:1608)
E/flutter (13281): #7      _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:233)
E/flutter (13281): #8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301)
E/flutter (13281): #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168)

@mraleph
Copy link
Member

mraleph commented Jun 3, 2020

given that is a Windows only issue this might mean a bug similar to one fixed by dart-lang/sdk@164948a (maybe even the same bug)

@andreystavitsky
Copy link

andreystavitsky commented Jun 3, 2020

Test on latest master
d:\Projects_Flutter_Projects\repro2>flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.19.0-4.0.pre.38, on Microsoft Windows [Version 10.0.19041.264], locale uk-UA)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Android Studio (version 4.0)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.45.1)
[√] Connected device (1 available)

! Doctor found issues in 1 category.
d:\Projects\_Flutter_Projects\repro2>flutter run --release
Launching lib\main.dart on KSA LX9 in release mode...
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                      20,8s
√ Built build\app\outputs\flutter-apk\app-release.apk (6.0MB).
Installing build\app\outputs\flutter-apk\app.apk...                 2,5s

Flutter run key commands.
h Repeat this help message.
c Clear the screen
q Quit (terminate the application on the device).
E/flutter (21704): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: test_2(1) = 1. Expected 0
E/flutter (21704): #0      runCheck (package:arm_ffi_repro/ffi_repro.dart:41)
E/flutter (21704): #1      main (file:///d:/Projects/_Flutter_Projects/repro2/lib/main.dart:7)
E/flutter (21704): #2      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:247)
E/flutter (21704): #3      _rootRun (dart:async/zone.dart:1190)
E/flutter (21704): #4      _CustomZone.run (dart:async/zone.dart:1093)
E/flutter (21704): #5      _runZoned (dart:async/zone.dart:1630)
E/flutter (21704): #6      runZonedGuarded (dart:async/zone.dart:1618)
E/flutter (21704): #7      _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:239)
E/flutter (21704): #8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301)
E/flutter (21704): #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168)

apk: https://send.firefox.com/download/871713d512320c32/#YPByhsmXGidTTYLQTMlnhw

@andreystavitsky
Copy link

@mkustermann forgot to say, but APK is not crashes, it's just write some debug log to console.

@mkustermann
Copy link
Member

@andreystavitsky Thanks a lot. I can reproduce the issue now also with on my Windows (probably I did something wrong when I first tried it).

Issue 1 (harmless)

It seems like the flutter tools

  • on windows uses a 32-bit gen_snapshot.exe binary (**) to produce 32-bit ARM code
  • on macos uses a 64-bit gen_snapshot binary (**) to produce 32-bit ARM code

(**) gen_snapshot is our AOT (cross)compiler.

This is a bit weird and we might want to change that. Though it should be safe either way. Though they compile to slightly different code in a special case:

Our assembler_arm.cc looks like this:

void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
  ...
  if (OS::ActivationFrameAlignment() > 1) {
    bic(SP, SP, Operand(OS::ActivationFrameAlignment() - 1));
  }
}

This uses OS::ActivationFrameAlignment() which is defined in os_win.cc:

intptr_t OS::ActivationFrameAlignment() {
#if defined(TARGET_ARCH_ARM64)
  return 16;
#elif defined(TARGET_ARCH_ARM)
  return 8;
...
}

and in os_macos.cc:

intptr_t OS::ActivationFrameAlignment() {
#if HOST_OS_IOS   // <-- This is not defined
  ...
#else
  // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
  // Function Call Guide".
  return 16;
#endif
}

This means we use 16 byte alignment when our cross compiler runs on MacOS but only 8 byte alignment if our cross compiler runs on Windows.

Though the ABI only requires 8 so we should be safe.

Issue 2

Without having verified it, it seems to me that the FFI implementation relies on undefined evaluation order, see compiler/ffi/native_calling_convention.cc:

  const NativeLocation& AllocateArgument(const NativeType& payload_type) {
    if (payload_type_converted.IsFloat()) {
      ...
    } else {
      ...
      if (target::kWordSize == 4 && payload_type.SizeInBytes() == 8) {
        ...
        if (cpu_regs_used + 2 <= CallingConventions::kNumArgRegs) {
          return *new (zone_) NativeRegistersLocation(
              payload_type, container_type,
              AllocateCpuRegister(), AllocateCpuRegister());
              //   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Evaluation order undefined
        }
      } else {
        ...
      }
    }
 }

C++ doesn't guarantee any order of evaluation for the two AllocateCpuRegister() calls. Windows is known to use different evaluation order.

=> I think this is the bug.
=> Made https://dart-review.googlesource.com/c/sdk/+/149980 and will try to verify it later today.

@mkustermann
Copy link
Member

I have manually confirmed that this fixes the problem.

@mkustermann
Copy link
Member

I have filed a cherry-pick request into beta/stable branches: dart-lang/sdk#42184

@dcharkes
Copy link
Contributor

FWIW all channels except stable contain the fix

#58631 (comment)

removing hotfix: 1.17 label based on risk assessment, this will be in our next stable release.

#58631 (comment)

@marcos930807
Copy link

@dcharkes When approximately will be the next release, I need This but my app is on production, so i like keep using stable channel.

@mraleph
Copy link
Member

mraleph commented Jun 17, 2020

The date of the next stable release is not defined yet, but it looks like it is targeting sometime in July.

@pcsosinski
Copy link

/cc @eonoe - is this the issue you're hitting?

@eonoe
Copy link

eonoe commented Jun 24, 2020

/cc @eonoe - is this the issue you're hitting?

@pcsosinski yes we think that is related with this one.

@agelormini
Copy link

agelormini commented Jul 3, 2020

how is the situation? the 17.5 version seems to have still the problem

@dcharkes
Copy link
Contributor

dcharkes commented Jul 3, 2020

The cherry pick request was denied, so it has not been merged into 1.17.5. So this fix will only be available in Flutter 1.18.x, and is available on Flutter master.

@agelormini
Copy link

The cherry pick request was denied, so it has not been merged into 1.17.5. So this fix will only be available in Flutter 1.18.x, and is available on Flutter master.

ok, is it possible to have an idea of when the 1.18 will be released? weeks, months? ty

@z-tc
Copy link

z-tc commented Jul 15, 2020

any updates on this issue?

@dcharkes
Copy link
Contributor

As mentioned, it's available in master, and will be released in the next stable release. See Flutters release cadence on the wiki: https://github.com/flutter/flutter/wiki/Roadmap#release-channels-and-cadence.

@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 Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. platform-android Android applications specifically
Projects
None yet
Development

No branches or pull requests