-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[analyzer/ffi] Crash #54754
Comments
https://dart-review.googlesource.com/c/sdk/+/342763 removed that line. before revert: 'dart_revision': 1d0b890 b6647fd...148d5ac So it must be the dart-ffi commit. Since the offending line was removed (fixed) in that PR, we might have version skew and are using an older analyzer to analyze the code which then trips over new code added. |
So this used I am a bit surprised about |
@zanderso What version is Also, it's being reported as Could you elaborate on how this is set up? If we have to support version skew during the rolling, we should probably revert https://dart-review.googlesource.com/c/sdk/+/342763, land the fix in the ffi_verifier.dart first, wait for that to roll and then reland https://dart-review.googlesource.com/c/sdk/+/342763. (I did the fix in ffi_verifier because some example somewhere else in the doc triggers it.) |
I'm skeptical that there's any version skew. The logs come from an engine -> framework roll where the most recent version of Dart was |
Ah right, the stack trace was from the firs roll that failed. Here's one from the last Dart version before the revert:
Source: https://github.com/flutter/flutter/runs/20954221253
Dartdoc is DEPSed in in the Dart SDK. And Dartdoc depends on a published version of the analyzer: https://github.com/dart-lang/dartdoc/blob/main/pubspec.yaml (version skew if the pubspec.yaml is obeyed) As far as I understand, the dependencies for dartdoc in pubspec.yaml get overridden in the Dart SDK. The fact that it is overridden means that the applied fix in the analyzer is actually picked up by @srawlins What version of the analyzer is supposed to be in a |
Inside the Dart SDK the analyzer used in Reintroducing the problem: $ git diff
diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
index a392ca74062..64c1c289fff 100644
--- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
@@ -1651,7 +1651,7 @@ class FfiVerifier extends RecursiveAstVisitor<void> {
/// Validate the invocation of the extension method
/// `Pointer<T extends Struct>.ref`.
void _validateRefPrefixedIdentifier(PrefixedIdentifier node) {
- var targetType = node.prefix.staticType;
+ var targetType = node.typeOrThrow;
if (!_isValidFfiNativeType(targetType,
allowVoid: false, allowEmptyStruct: true)) {
final AstNode errorNode = node;
main branch without edits:
So there must be something different about the |
The Dart SDK is not built inside the Flutter build. It is only copied to the Flutter gs bucket. |
Doesn't that cause version skew? Or is that exactly the version that is being rolled in? Then what's the DEPS file in flutter engine for that has git hashes? |
From the stack trace it's clear that we have version skew somewhere, so let's revert to unblock the Dart into Flutter roll. |
The script used in this test is running the Dartdoc 8.0.2 package, not the https://github.com/flutter/flutter/blob/master/dev/bots/docs.sh#L114 |
Thanks @jason-simmons! That explains it. Should we consider running |
cc @gspencergoog IIRC is familiar with the dartdoc setup? |
The version of dartdoc is pinned for the same reason that all the other dependencies are pinned: so that we can roll it back to an earlier version to unblock the Flutter build if something incompatible happens with the dartdoc package. We could just use the I'm not really sure how the |
That makes sense. This also means that It also means that
Yeah, so this is a trade-off, either
I'm not sure which one we'd be more comfortable giving up. If we want to stick with the status quo, we should address at least two things:
If we want to change the status quo so that package:analyzer and package:dartdoc roll into Flutter (which they do partially already through
As for the current roll breakage: I've created a revert and will reland the analyzer fixes first. |
This reverts commit c2e15cf. Reason for revert: #54754 Version skew somewhere in the analyzer/dartdoc/flutter combination. We need to land the fix inside ffi_verifier.dart first, and then reland the API docs that trigger the code path in the analyzer that throws the exception. Original change's description: > [vm/ffi] Introduce `Struct.create` and `Union.create` > > Structs and unions can now be created from an existing typed data > with the new `create` methods. > > The typed data argument to these `create` methods is optional. If > the typed data argument is omitted, a new typed data of the right > size will be allocated. > > Compound field reads and writes are unchecked. (These are > TypedDataBase loads and stores, rather than TypedData loads and stores. > And Pointers have no byte length.) Therefore the `create` method taking > existing TypedData objects check whether the length in bytes it at > least the size of the compound. > > TEST=pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart > TEST=pkg/vm/testcases/transformations/ffi/struct_typed_data.dart > TEST=tests/ffi/structs_typed_data_test.dart > TEST=tests/ffi/vmspecific_static_checks_test.dart > > Closes: #45697 > Closes: #53418 > > Change-Id: If12c56106c7ca56611bccfacbc1c680c2d4ce407 > CoreLibraryReviewExempt: FFI is a VM and WASM only feature. > Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342763 > Commit-Queue: Daco Harkes <dacoharkes@google.com> > Reviewed-by: Johnni Winther <johnniwinther@google.com> > Reviewed-by: Lasse Nielsen <lrn@google.com> > Reviewed-by: Martin Kustermann <kustermann@google.com> Change-Id: I285dc39946b5659219b37a1d8f10de479133957e Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349061 Commit-Queue: Daco Harkes <dacoharkes@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Zach Anderson <zra@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
Fixes a crash in the analyzer that was exercised via dartdoc in https://dart-review.googlesource.com/c/sdk/+/342763. Landing the analyzer fix separately, so that it can be rolled first. Bug: #54754 Change-Id: I40375374cb785c11e3f0b2f21a8a2c74b8f080c6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349240 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Auto-Submit: Daco Harkes <dacoharkes@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Rolling analyzer as required per dart-lang/sdk#54754 so that it can roll into Flutter.
Log: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8757721845749192753/+/u/run_test.dart_for_docs_shard_and_subshard_None/test_stdout
Context:
The text was updated successfully, but these errors were encountered: