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

Unsupported operation: serialization of generic DartType: UnknownType(?) (UnknownType) #42615

Closed
datayeah opened this issue Jul 7, 2020 · 13 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@datayeah
Copy link

datayeah commented Jul 7, 2020

Tried to compile my flutter app which always worked since the last update.

name and version of operating system:
MacOS Mojave 10.14.4 (18E226)

  • the Dart SDK build number (2.9.0-edge.69aba23371ffb12caf596e29dab0d52f74a591e7), and

The compiler crashed: Unsupported operation: serialization of generic DartType: UnknownType(?) (UnknownType)
#0 BinaryPrinter.defaultDartType (package:kernel/binary/ast_to_binary.dart:2229:5)
#1 UnknownType.accept (package:front_end/src/fasta/type_inference/type_schema.dart:82:14)
#2 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#3 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#4 BinaryPrinter.visitInterfaceType (package:kernel/binary/ast_to_binary.dart:2067:7)
#5 InterfaceType.accept (package:kernel/ast.dart:7504:42)
#6 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#7 BinaryPrinter.visitFutureOrType (package:kernel/binary/ast_to_binary.dart:2088:5)
#8 FutureOrType.accept (package:kernel/ast.dart:7903:42)
#9 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#10 BinaryPrinter.visitAsExpression (package:kernel/binary/ast_to_binary.dart:1614:5)
#11 AsExpression.accept (package:kernel/ast.dart:4913:44)
#12 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#13 BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:474:7)
#14 BinaryPrinter.visitReturnStatement (package:kernel/binary/ast_to_binary.dart:1942:5)
#15 ReturnStatement.accept (package:kernel/ast.dart:6491:43)
#16 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#17 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#18 BinaryPrinter.visitBlock (package:kernel/binary/ast_to_binary.dart:1801:5)
#19 Block.accept (package:kernel/ast.dart:5823:43)
#20 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#21 BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:474:7)
#22 BinaryPrinter.visitFunctionNode (package:kernel/binary/ast_to_binary.dart:1325:5)
#23 FunctionNode.accept (package:kernel/ast.dart:2909:38)
#24 BinaryPrinter.writeFunctionNode (package:kernel/binary/ast_to_binary.dart:388:10)
#25 BinaryPrinter.visitFunctionExpression (package:kernel/binary/ast_to_binary.dart:1740:5)
#26 FunctionExpression.accept (package:kernel/ast.dart:5535:44)
#27 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#28 BinaryPrinter.visitNamedExpression (package:kernel/binary/ast_to_binary.dart:1501:5)
#29 NamedExpression.accept (package:kernel/ast.dart:3813:38)
#30 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#31 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#32 BinaryPrinter.visitArguments (package:kernel/binary/ast_to_binary.dart:1495:5)
#33 Arguments.accept (package:kernel/ast.dart:3753:38)
#34 BinaryPrinter.writeArgumentsNode (package:kernel/binary/ast_to_binary.dart:395:10)
#35 BinaryPrinter.visitConstructorInvocation (package:kernel/binary/ast_to_binary.dart:1487:5)
#36 ConstructorInvocation.accept (package:kernel/ast.dart:4154:44)
#37 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#38 BinaryPrinter.visitNamedExpression (package:kernel/binary/ast_to_binary.dart:1501:5)
#39 NamedExpression.accept (package:kernel/ast.dart:3813:38)
#40 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#41 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#42 BinaryPrinter.visitArguments (package:kernel/binary/ast_to_binary.dart:1495:5)
#43 Arguments.accept (package:kernel/ast.dart:3753:38)
#44 BinaryPrinter.writeArgumentsNode (package:kernel/binary/ast_to_binary.dart:395:10)
#45 BinaryPrinter.visitConstructorInvocation (package:kernel/binary/ast_to_binary.dart:1487:5)
#46 ConstructorInvocation.accept (package:kernel/ast.dart:4154:44)
#47 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#48 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#49 BinaryPrinter.visitListLiteral (package:kernel/binary/ast_to_binary.dart:1703:5)
#50 ListLiteral.accept (package:kernel/ast.dart:5292:44)
#51 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#52 BinaryPrinter.visitNamedExpression (package:kernel/binary/ast_to_binary.dart:1501:5)
#53 NamedExpression.accept (package:kernel/ast.dart:3813:38)
#54 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#55 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#56 BinaryPrinter.visitArguments (package:kernel/binary/ast_to_binary.dart:1495:5)
#57 Arguments.accept (package:kernel/ast.dart:3753:38)
#58 BinaryPrinter.writeArgumentsNode (package:kernel/binary/ast_to_binary.dart:395:10)
#59 BinaryPrinter.visitConstructorInvocation (package:kernel/binary/ast_to_binary.dart:1487:5)
#60 ConstructorInvocation.accept (package:kernel/ast.dart:4154:44)
#61 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#62 BinaryPrinter.visitNamedExpression (package:kernel/binary/ast_to_binary.dart:1501:5)
#63 NamedExpression.accept (package:kernel/ast.dart:3813:38)
#64 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#65 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#66 BinaryPrinter.visitArguments (package:kernel/binary/ast_to_binary.dart:1495:5)
#67 Arguments.accept (package:kernel/ast.dart:3753:38)
#68 BinaryPrinter.writeArgumentsNode (package:kernel/binary/ast_to_binary.dart:395:10)
#69 BinaryPrinter.visitConstructorInvocation (package:kernel/binary/ast_to_binary.dart:1487:5)
#70 ConstructorInvocation.accept (package:kernel/ast.dart:4154:44)
#71 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#72 BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:474:7)
#73 BinaryPrinter.visitReturnStatement (package:kernel/binary/ast_to_binary.dart:1942:5)
#74 ReturnStatement.accept (package:kernel/ast.dart:6491:43)
#75 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#76 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:291:7)
#77 BinaryPrinter.visitBlock (package:kernel/binary/ast_to_binary.dart:1801:5)
#78 Block.accept (package:kernel/ast.dart:5823:43)
#79 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:381:10)
#80 BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:474:7)
#81 BinaryPrinter.visitFunctionNode (package:kernel/binary/ast_to_binary.dart:1325:5)
#82 FunctionNode.accept (package:kernel/ast.dart:2909:38)
#83 BinaryPrinter.writeFunctionNode (package:kernel/binary/ast_to_binary.dart:388:10)
#84 BinaryPrinter.writeOptionalFunctionNode (package:kernel/binary/ast_to_binary.dart:483:7)
#85 BinaryPrinter.visitProcedure (package:kernel/binary/ast_to_binary.dart:1201:5)
#86 Procedure.accept (package:kernel/ast.dart:2400:40)
#87 BinaryPrinter.writeProcedureNode (package:kernel/binary/ast_to_binary.dart:409:10)
#88 BinaryPrinter.writeProcedureNodeList (package:kernel/binary/ast_to_binary.dart:300:7)
#89 BinaryPrinter.visitClass (package:kernel/binary/ast_to_binary.dart:1129:5)
#90 Class.accept (package:kernel/ast.dart:1379:38)
#91 BinaryPrinter.writeClassNode (package:kernel/binary/ast_to_binary.dart:423:10)
#92 BinaryPrinter.writeClassNodeList (package:kernel/binary/ast_to_binary.dart:318:7)
#93 BinaryPrinter.visitLibrary (package:kernel/binary/ast_to_binary.dart:959:5)
#94 Library.accept (package:kernel/ast.dart:607:38)
#95 BinaryPrinter.writeLibraryNode (package:kernel/binary/ast_to_binary.dart:402:10)
#96 BinaryPrinter.writeLibraries (package:kernel/binary/ast_to_binary.dart:708:9)
#97 BinaryPrinter.writeComponentFile. (package:kernel/binary/ast_to_binary.dart:551:7)
#98 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#99 BinaryPrinter.writeComponentFile (package:kernel/binary/ast_to_binary.dart:535:14)
#100 KernelLoaderTask.load.. (package:compiler/src/kernel/loader.dart:198:19)
#101 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:179:35)
#102 KernelLoaderTask.load. (package:compiler/src/kernel/loader.dart:191:9)

#103 KernelLoaderTask.load. (package:compiler/src/kernel/loader.dart)
#104 CompilerTask.measure (package:compiler/src/common/tasks.dart:64:51)
#105 KernelLoaderTask.load (package:compiler/src/kernel/loader.dart:60:12)
#106 Compiler.runInternal (package:compiler/src/compiler.dart:238:48)
#107 Compiler.run.. (package:compiler/src/compiler.dart:212:38)
#108 new Future.sync (dart:async/future.dart:223:31)
#109 Compiler.run. (package:compiler/src/compiler.dart:212:20)
#110 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:179:35)
#111 Compiler.run (package:compiler/src/compiler.dart:209:41)
#112 CompilerImpl.run.. (package:compiler/src/apiimpl.dart:91:22)
#113 _RootZone.runUnary (dart:async/zone.dart:1450:54)
#114 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#115 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#116 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#117 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#118 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:567:7)
#119 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#120 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#121 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#122 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

@lrhn lrhn added area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js labels Jul 8, 2020
@sigmundch sigmundch added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Jul 8, 2020
@sigmundch
Copy link
Member

@johnniwinther - this may be a CFE issue. This is happening under the --cfe-only flag, so it is serializing the dill immediately after invoking the CFE.

@chloestefantsova
Copy link
Contributor

Thanks for the report, @datayeah. I couldn't reproduce the bug based on the stack trace. Could you provide a small snippet causing the crash, stripped off any app-specific information?

It would also be helpful to know if the crash surfaces on Dart SDK commit hash 8d4d3a3 (the one before the likely culprit commit).

@johnniwinther
Copy link
Member

I have a repro:

import 'dart:async';

class Class<T> {
  Class({FutureOr<List<T>> Function() a});
}

dynamic method() => null;

main() {
  Class(a: () async => method());
}

@datayeah
Copy link
Author

It's a quite big project i am working on for some time now, so i am unable to (or unsure how to) isolate the part thats causing the crash. Thanks for adding an example, @johnniwinther!

@chloestefantsova
Copy link
Contributor

Thanks for the repro @johnniwinther. I'm working on a fix in CL 154322.

@Shiba-Kar
Copy link

Unsupported operation: serialization of generic DartType: UnknownType(?) (UnknownType)
Conformed same here !!

@johnniwinther
Copy link
Member

@Shiba-Kar Which version of Dart are you running?

@Shiba-Kar
Copy link

@Shiba-Kar Which version of Dart are you running?

2.9.0

@johnniwinther
Copy link
Member

This fix is not in '2.9.0' but is in the pipeline for a future release.

@Shiba-Kar Are you blocked by this or do you have a work-around?

@Shiba-Kar
Copy link

This fix is not in '2.9.0' but is in the pipeline for a future release.

@Shiba-Kar Are you blocked by this or do you have a work-around?

For the time being I have downgraded to 1.17.5 flutter

@a-siva
Copy link
Contributor

a-siva commented Aug 8, 2020

This was fixed in the Dart tree at ac4de98, I don't believe the fix is in Flutter 1.20 which has Dart version 2.9

@pcsosinski
Copy link

should we consider this for a CP to 2.9? @franklinyow

@franklinyow
Copy link
Contributor

@pcsosinski 2.9 mean a hotfix release?
@johnniwinther

dart-bot pushed a commit that referenced this issue Aug 12, 2020
Cherry Pick CL for #42615

Closes #43013.

Bug: #42615
Change-Id: Ieb289acee04b3868304d320d3c2231fd6eb94dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154322
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

9 participants