-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Kernel compiler crash #47673
Comments
Regarding the compiler-opts:
- '-Wno-nullability-completeness' |
@cskau-g Clement, could you take a look at the crash in the FFI related transformer? You are the most familiar with it after Daco. |
I can reproduce this issue locally with: import 'dart:ffi';
typedef T = Int64;
class A extends Struct {
@Array.multi([16])
external Array<T> b;
} Where But with a bit more fiddling I ended up with:
Which led me to this:
And sure enough, once I updated my pubspec all issues went away: environment:
sdk: '>=2.13.0 <3.0.0' @dnfield you should be able to work around this issue the same way. The bottom line here is that underlying issue is that we don't fail on the typedef error soon enough to avoid transforms getting invalid input. |
Bringing in Chloe who recently introduced the change that I believe ultimately triggered this. |
I agree with @cskau-g's analysis: the program shouldn't work as written in 2.12, but we should report a compile-time error instead of crashing. |
I work on the fix here: https://dart-review.googlesource.com/c/sdk/+/220008 |
Why is ffigen generating code incompatible with the version from my pubspec? What if I intend to support clients down to 2.12? |
One can select an older version to do this. The supported SDK mentioned on https://pub.dev/packages/ffigen/versions should be the same as ghe minimum SDK one is planning to support. |
Ahh ok, that makes sense. Thanks. |
It would be very helpful if whatever error gets shown somehow helps me understand this as the user. Alternatively, it would be helpful if |
Thanks for reporting. The FFI transform should not crash. We could opt to not run the FFI transform at all if there are any CFE errors. However, that will hide all FFI errors until all non-FFI errors are resolved. So maybe it's better to just deal with this in the FFI transform. The FFI transform also crashes in the latest language version with an unknown type. class A extends Struct {
@Array.multi([16])
external Array<Unknown> b;
} |
ffigen 4.1.1
LLVM 13
Tried to run it on wuffs:
https://raw.githubusercontent.com/google/wuffs/34e2786dd2e766a1800d7c55e71f024421585dd9/release/c/wuffs-v0.3.c
Running
dart run ffigen
does generate someSEVERE
red warnings, but they all seem to be aboutNullability
issues in the stdlib.h from my Xcode install, e.g.When I try to
dart hello.dart
on a program that loads and uses theNativeLibrary
generated from that, I get a kernel compiler crash:Dart SDK version: 2.15.0-268.0.dev (dev) (Fri Oct 29 15:59:24 2021 -0700) on "macos_x64"
/cc @mraleph
The text was updated successfully, but these errors were encountered: