Debug service stops consistently when run with --enable-expression-evaluation
Dart SDK version: 2.12.0-edge.d13eaddf97d60c706f8a8969a8998ab6b083f753 (be) (Thu Nov 5 15:17:43 2020 +0000) on "macos_x64" webdev 2.7.1 analyzer 0.39.4
I got the application running, found a medium-sized file and was scrolling through it for an interesting place to put a breakpoint. It seems to stop consistently, the DevTools UI just says disconnected and the log says [INFO] DevHandler: Stopped debug service on sse://127.0.0.1:53029/gJh9lrBkL7g=/$debugHandler
I can reproduce this, so I can probably get more information if I know how to turn on more detailed logging. I can also provide the pubspec.lock information. The context is a large application compiled with dart2js and a very small piece compiled with DDC, though it has some dependencies. When I first ran I had too many files open (only when I did enable-expression-evaluation). A ulimit -S -n 2048 (MacOs 10.15.6) fixed the files issue.
webdev supports a --verbose argument which should help capture more detailed logs.
I was already running with --verbose.
webdev serve web --verbose --debug-extension --enable-expression-evaluation -- --verbose --delete-conflicting-outputs --track-performance
...many of these...
[FINEST] ExpressionCompilerService: serverpath for packages/thing_examples/hello_world.unsound.ddc.full.dill: packages/wdesk_examples/hello_world.unsound.ddc.full.dill
0:02:49.888280: Updated dependencies for expression evaluation in 12175ms.
[INFO] ExpressionCompilerService: Updated dependencies.
[INFO] DevHandler: Debug service listening on sse://127.0.0.1:53029/gJh9lrBkL7g=/$debugHandler
[INFO] DevHandler: Stopped debug service on sse://127.0.0.1:53029/gJh9lrBkL7g=/$debugHandler
However, I grabbed bleeding edge to throw in a couple of prints, and with that it didn't crash on the same repro. However, it also didn't evaluate. This is with 97b724ade94891a74a9b6477d80745eb354ec168 and SDK Dart SDK version: 2.12.0-edge.d13eaddf97d60c706f8a8969a8998ab6b083f753 (be) (Thu Nov 5 15:17:43 2020 +0000) on "macos_x64", so not especially stable.
> 2+2
CompilationError: <unknown error>
> this
CompilationError: <unknown error>
From the terminal
[FINEST] ExpressionEvaluator: ExpressionEvaluator: evaluating "2+2" at packages/microfrontend/src/constants, package:microfrontend/src/event_bus.dart:175:5
[FINEST] ExpressionCompilerService: compiling "2+2" at package:microfrontend/src/event_bus.dart:175
0:05:24.629367: Compiling expression to JavaScript in 122950ms.
0:05:24.630098: Collected dependencies for expression in 0ms.
0:05:24.633473: Started building UriTranslator in 3ms.
0:05:24.634240: Read libraries file in 0ms.
0:05:24.634305: Read packages file in 0ms.
0:05:24.634762: Read packages file in 0ms.
0:05:24.636263: About to initializeFromComponent in 1ms.
0:05:24.637242: Ran initializeFromComponent in 0ms.
0:05:24.638404: Appended libraries in 1ms.
0:05:24.639760: Indexed 322 libraries (0 bytes) in 1.339ms, that is,
0.000 bytes/ms, and
0.004 ms/libraries.
0:05:24.650416: Built outlines for 0 compilation units (0 bytes) in 9.251ms, that is,
0.000 bytes/ms, and
Infinity ms/compilation unit.
0:05:24.651158: Built outlines for 0 compilation units (0 bytes) in 0.461ms, that is,
0.000 bytes/ms, and
Infinity ms/compilation unit.
0:05:24.655447: Resolved parts in 4ms.
0:05:24.655472: Applied patches in 0ms.
0:05:24.655533: Computed library scopes in 0ms.
0:05:24.655580: Resolved 0 types in 0ms.
0:05:24.655603: Computed variances of 0 type variables in 0ms.
0:05:24.655646: Computed default types for 0 type variables in 0ms.
0:05:24.655692: Checked class hierarchy in 0ms.
0:05:24.655733: Resolved 0 type-variable bounds in 0ms.
0:05:24.655761: Built component in 0ms.
0:05:24.655800: Installed Object as implicit superclass in 0ms.
0:05:24.655819: Installed synthetic constructors in 0ms.
0:05:24.675743: Resolved 0 constructors in 0ms.
0:05:24.677418: Linked component in 1ms.
0:05:24.677902: Computed core types in 0ms.
0:05:24.678014: Built class hierarchy in 0ms.
0:05:24.704260: Computed class hierarchy in 26ms.
0:05:24.704358: Performed top level inference in 0ms.
0:05:24.704394: Checked supertypes in 0ms.
0:05:24.704427: Checked 0 overrides in 0ms.
0:05:24.704443: Finished initializing formals in 0ms.
0:05:24.704511: Computed 0 combined member signatures in 0ms.
0:05:24.704535: Updated 0 classes in kernel hierarchy in 0ms.
0:05:24.704564: Added noSuchMethod forwarders in 0ms.
0:05:24.704588: Checked mixin declaration applications in 0ms.
0:05:24.704659: Build outline expressions in 0ms.
0:05:24.704697: Checked type arguments of supers against the bounds in 0ms.
0:05:24.704718: Checked redirecting factories in 0ms.
0:05:24.705008: Building component in 0ms.
0:05:24.705061: Built bodies for 0 compilation units (0 bytes) in 0.040ms, that is,
0.000 bytes/ms, and
Infinity ms/compilation unit.
0:05:24.705526: Cloned default values of formals in 0ms.
0:05:24.705561: Finished deferred load tearoffs 0 in 0ms.
0:05:24.705588: Finished forwarders for 0 procedures in 0ms.
0:05:24.725693: Finished 0 native methods in 0ms.
0:05:24.725776: Finished 0 patch methods in 0ms.
0:05:24.725819: Finished constructors in 0ms.
0:05:24.726500: Evaluated constants in 0ms.
0:05:24.734969: Computed delta for expression in 8ms.
@alanknight-wk thanks for testing this! I believe you caught us mid-development :)
Possible causes for what you are seeing are:
- If you see any messages in the log that say [SEVERE] - it is related to https://github.com/dart-lang/webdev/issues/1195
- If you never see
"Emitted module for expression"after the last log line you shared above, that might mean that ddc failed to emit the module. I fixed some bugs in the SDK that caused ddc crashes, you would need SDK version >= https://github.com/dart-lang/sdk/releases/tag/2.12.0-44.0.dev to make sure they are gone:
https://github.com/dart-lang/sdk/commit/9c54996510d15f8f297a1552675f86b1f064e2f2
If none of the above seem plausible, would it be possible for you to share the full verbose log?