-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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 using isar
package.
#97301
Comments
@anandsubbu007 |
@anandsubbu007 Please run
That should print the name of the function being compiled when compiler crashes. Could post the source code of that function here? Also, it would be useful to get a flow graph for that function. That could be done with |
thanks. I believe there may be a bug in the external package "Isar" that I'm using in this.
|
I tried creating a sample which uses package:isar, but I wasn't able to reproduce the crash - it builds fine. I used isar 1.0.5 for that as it was mentioned in the build log. @anandsubbu007 It looks like we still need a complete sample reproducing the problem in order to investigate this error. Can you try to extract just the code which uses package:isar and cut down unrelated pieces of the app? The repro code doesn't need to run - it just needs to be syntactically correct and crash the compiler. |
Problems Occurs When 'Isar.open()' function runs.
An Error occurs in External Library only on Android Build.
|
Thanks for the code sample, using it, I do see the same stacktrace / behavior as reported originally. console error log
beta, master flutter doctor -v
|
isar
package.
Minimal repro: import 'dart:ffi';
@pragma("vm:never-inline")
external Pointer<Uint32> foo();
main(List<String> args) {
final Pointer<Uint32> offsetsPtr = foo();
for (var i = 0; i < 2; i++) {
print(offsetsPtr.asTypedList(1));
}
} Crash happens when AOT-compiling for 32-bit ARM. Code generation crashes as there is a deoptimizing (speculative) instruction This instruction is inserted by
This probably happens due to mismatch between types of
where |
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr representation (uint32) and then the value is passed to a StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr representation (int32). As a result, a speculative uint32->int32 IntConverter instruction is inserted by SelectRepresentations pass. AOT doesn't support deoptimization so code generation crashes after retrying without speculative inlining. This change fixes the type incompatibility by loading value with LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr). TEST=ffi/regress_flutter97301_test Fixes flutter/flutter#97301 Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956 Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
The fix rolled into Flutter in 981df81. |
may I know when will this update on flutter which version? |
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr representation (uint32) and then the value is passed to a StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr representation (int32). As a result, a speculative uint32->int32 IntConverter instruction is inserted by SelectRepresentations pass. AOT doesn't support deoptimization so code generation crashes after retrying without speculative inlining. This change fixes the type incompatibility by loading value with LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr). TEST=ffi/regress_flutter97301_test Fixes flutter/flutter#97301 Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956 Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
@anandsubbu007 flutter 2.10.1 released |
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr representation (uint32) and then the value is passed to a StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr representation (int32). As a result, a speculative uint32->int32 IntConverter instruction is inserted by SelectRepresentations pass. AOT doesn't support deoptimization so code generation crashes after retrying without speculative inlining. This change fixes the type incompatibility by loading value with LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr). TEST=ffi/regress_flutter97301_test Fixes flutter/flutter#97301 Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956 Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
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 |
Mostly related to this issue: #80902 (comment)
flutter build apk
flutter doctor -v
flutter build apk --release --verbose
The text was updated successfully, but these errors were encountered: