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

Internal problem: Unimplemented constant evaluation during expression evaluation #36479

Closed
a-siva opened this issue Apr 4, 2019 · 7 comments
Closed
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@a-siva
Copy link
Contributor

a-siva commented Apr 4, 2019

When ExperimentalFlag.constantUpdate2018 is turned on by default using the following patches

https://dart-review.googlesource.com/c/sdk/+/98485
https://dart-review.googlesource.com/c/sdk/+/98563
and setting ExperimentalFlag.constantUpdate2018 to true in https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/api_prototype/experimental_flags.dart#L29

many service tests fail with the following stack trace

ServerRpcException(org-dartlang-debug:synthetic_debug_expression:1: Internal problem: Unimplemented constant evaluation during expression evaluation.
#0      internalProblem (package:front_end/src/fasta/problems.dart:45:3)
#1      unimplemented (package:front_end/src/fasta/problems.dart:51:10)
#2      KernelTarget.runProcedureTransformations (package:front_end/src/fasta/kernel/kernel_target.dart:794:7)
#3      IncrementalCompiler.compileExpression.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:795:16)
<asynchronous suspension>
#4      CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:46)
#5      new Future.sync (dart:async/future.dart:224:31)
#6      CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:19)
#7      _rootRun (dart:async/zone.dart:1124:13)
#8      _CustomZone.run (dart:async/zone.dart:1021:19)
#9      _runZoned (dart:async/zone.dart:1516:10)
#10     runZoned (dart:async/zone.dart:1463:12)
#11     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#12     IncrementalCompiler.compileExpression (package:front_end/src/fasta/incremental_compiler.dart:709:26)
<asynchronous suspension>
#13     IncrementalCompiler.compileExpression (package:vm/incremental_compiler.dart:156:23)
#14     _processExpressionCompilationRequest (file:///usr/local/google/home/asiva/workspace/dart-ws2/sdk/pkg/vm/bin/kernel_service.dart:374:52)
<asynchronous suspension>
#15     _processLoadRequest (file:///usr/local/google/home/asiva/workspace/dart-ws2/sdk/pkg/vm/bin/kernel_service.dart:468:11)
<asynchronous suspension>
#16     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
)

@a-siva a-siva added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Apr 4, 2019
@a-siva a-siva added this to the Dart 2.3 milestone Apr 4, 2019
@a-siva
Copy link
Contributor Author

a-siva commented Apr 4, 2019

/cc @aam

@dgrove dgrove added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Apr 4, 2019
@kmillikin kmillikin self-assigned this Apr 5, 2019
@kmillikin
Copy link

You no longer need to manually update experimental_flags.dart, I've updated https://dart-review.googlesource.com/c/sdk/+/98485 to include it.

If you also patch in https://dart-review.googlesource.com/c/sdk/+/98675 then it will re-enable expression compilation but we will not evaluate constants. This leaves two service test failures:

service/auth_token_test
service/get_source_report_test

@a-siva could you get someone on the VM team to look into these and see if they are just different expectations or indicate a deeper problem? If there is no problem other than missing static checks on constants, then we could consider this a temporary solution. (Unfortunately, it requires keeping the old C++ constant evaluation code.)

A better solution is to perform constant evaluation and serialize a constant pool back to the VM, but this doesn't match the way that things work right now so it will take some time.

@aam
Copy link
Contributor

aam commented Apr 5, 2019

The test seems to rely on DART_SERVICE_USE_AUTH environment define https://github.com/dart-lang/sdk/blob/master/sdk/lib/vmservice/vmservice.dart#L45, which is not defined during platform.dill build. Switching from const to new seems to fix the problem

diff --git a/sdk/lib/vmservice/vmservice.dart b/sdk/lib/vmservice/vmservice.dart
index 10df9dee92..8524da8f90 100644
--- a/sdk/lib/vmservice/vmservice.dart
+++ b/sdk/lib/vmservice/vmservice.dart
@@ -42,7 +42,7 @@ String _makeAuthToken() {
 final String serviceAuthToken = _makeAuthToken();
 
 // TODO(johnmccutchan): Enable the auth token and drop the origin check.
-final bool useAuthToken = const bool.fromEnvironment('DART_SERVICE_USE_AUTH');
+final bool useAuthToken = new bool.fromEnvironment('DART_SERVICE_USE_AUTH');
 
 // This is for use by the embedder. It is a map from the isolateId to
 // anything implementing IsolateEmbedderData. When an isolate goes away,

@vsmenon
Copy link
Member

vsmenon commented Apr 8, 2019

It looks like @aam landed the above. Does this unblock us from flipping the const flag in the SDK?

@vsmenon
Copy link
Member

vsmenon commented Apr 8, 2019

ping - @kmillikin @askeksa-google - is there work pending here?

@kmillikin
Copy link

We need to land CL 98675 to enable expression compilation and then we are passing all the VM service tests with the constant-update-2018.

@a-siva
Copy link
Contributor Author

a-siva commented Apr 9, 2019

I patched in CL 98675 and tried all the VM service tests and they pass with that patch. I think this issue can be closed after the CL lands.

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. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

5 participants