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

Cannot build the SDK with constant-update-2018 enabled #37357

Closed
kmillikin opened this issue Jun 25, 2019 · 7 comments
Closed

Cannot build the SDK with constant-update-2018 enabled #37357

kmillikin opened this issue Jun 25, 2019 · 7 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. P0 A serious issue requiring immediate resolution
Milestone

Comments

@kmillikin
Copy link

As of b32d196 it is no longer possible to build the SDK with constant-update-2018 enabled because of a crash in the VM. /cc @aartbik

To reproduce:

  1. Edit tools/experimental_features.yaml to have enabledIn: 2.0 under constant-update-2018:, then run pkg/front_end/tool/fasta generate-experimental-flags. Alternately patch in https://dart-review.googlesource.com/c/sdk/+/106943.

  2. Run tools/build.py -mrelease create_sdk. It will crash with a segmentation fault when trying to build a snapshot of kernel-service.dart. Debug builds will fail with an ASSERT failure.

Command failed: ./dart --deterministic --packages=/usr/local/google/home/kmillikin/dart.git/sdk/.packages --snapshot=gen/kernel-service.dart.snapshot --snapshot-depfile=/usr/local/google/home/kmillikin/dart.git/sdk/out/DebugX64/gen/kernel-service.dart.snapshot.d --snapshot-kind=app-jit /usr/local/google/home/kmillikin/dart.git/sdk/out/DebugX64/gen/kernel_service.dill --train file:////usr/local/google/home/kmillikin/dart.git/sdk/pkg/compiler/lib/src/dart2js.dart
output: ../../runtime/vm/compiler/frontend/constant_evaluator.cc: 299: error: expected: !H.constants_table().IsNull()
version=2.3.3-edge.de72f2f1bd864c74434cc93882052f66198f5f8b (Tue Jun 25 08:02:46 2019 +0000) on "linux_x64"
thread=59610, isolate=main(0x55b1309d6c00)
  pc 0x000055b12e19a3bc fp 0x00007ffcec578fc0 dart::Profiler::DumpStackTrace(void*)
  pc 0x000055b12ddc1342 fp 0x00007ffcec5790a0 dart::Assert::Fail(char const*, ...)
  pc 0x000055b12e3ab1ac fp 0x00007ffcec579130 dart::kernel::ConstantEvaluator::EvaluateConstantExpression(long)
  pc 0x000055b12e0a7a63 fp 0x00007ffcec579260 dart::kernel::KernelLoader::ReadVMAnnotations(dart::Library const&, long, dart::String*, bool*, bool*)
  pc 0x000055b12e0a888f fp 0x00007ffcec5793e0 dart::kernel::KernelLoader::LoadProcedure(dart::Library const&, dart::Class const&, bool, long)
  pc 0x000055b12e0a7283 fp 0x00007ffcec579580 dart::kernel::KernelLoader::FinishTopLevelClassLoading(dart::Class const&, dart::Library const&, dart::kernel::LibraryIndex const&)
  pc 0x000055b12e0aa84e fp 0x00007ffcec579970 dart::kernel::KernelLoader::FinishLoading(dart::Class const&)
  pc 0x000055b12dfd1861 fp 0x00007ffcec579b10 dart::ClassFinalizer::FinalizeClass(dart::Class const&)
  pc 0x000055b12dfd3371 fp 0x00007ffcec579c40 dart::ClassFinalizer::LoadClassMembers(dart::Class const&)
  pc 0x000055b12e0dce65 fp 0x00007ffcec579c80 dart::Class::EnsureIsFinalized(dart::Thread*) const
  pc 0x000055b12e113eb6 fp 0x00007ffcec579cc0 dart::Library::EnsureTopLevelClassIsFinalized() const
  pc 0x000055b12e117e06 fp 0x00007ffcec579cf0 dart::Library::LookupLocalField(dart::String const&) const
  pc 0x000055b12e6b80f3 fp 0x00007ffcec579e50 Dart_FinalizeLoading
  pc 0x000055b12dde9c79 fp 0x00007ffcec579ec0 dart::bin::DartUtils::PrepareForScriptLoading(bool, bool)
  pc 0x000055b12dda9df5 fp 0x00007ffcec579f50 ./dart+0x1676df5
  pc 0x000055b12dda8a53 fp 0x00007ffcec57a020 ./dart+0x1675a53
  pc 0x000055b12dda7f22 fp 0x00007ffcec57a0f0 dart::bin::RunMainIsolate(char const*, dart::bin::CommandLineOptions*)
  pc 0x000055b12dda9341 fp 0x00007ffcec57a1f0 dart::bin::main(int, char**)
  pc 0x000055b12dda9d79 fp 0x00007ffcec57a200 ./dart+0x1676d79
-- End of DumpStackTrace
@kmillikin kmillikin added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jun 25, 2019
@mraleph
Copy link
Member

mraleph commented Jun 25, 2019

@mkustermann @alexmarkov Alex/Martin could one of you look at this given that Aart is on vacation and you have reviewed his change? We want to be in a state where we can flip the flag on a short notice.

/cc @a-siva

@mkustermann mkustermann self-assigned this Jun 25, 2019
@mkustermann
Copy link
Member

The cl/107283 should fix it.

Before committing I'll remove the flag flip again.

dart-bot pushed a commit that referenced this issue Jun 25, 2019
…eserved across snapshots

When constants are lazily created in VM from the constants table present
in the Kernel file, we have to ensure to preserve the constants table
across snapshot serialization/deserialization.

Also there is no need to use zone handles in the constant evaluator for
local handles.

Also removes some commented code and adds an assertion that we never try
to partially instantiate a closure with non-null function type
arguments.

Issue #37357

Change-Id: I49588fd18d981b7aa07c61e845cd2e2161b122bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107283
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
@mkustermann
Copy link
Member

mkustermann commented Jun 26, 2019

Will close this issue since the VM issue has been hopefully fixed.

The create_sdk still fails I believe, though due to some unimplemented code in pkg/dev_compiler/lib/src/kernel/compiler.dart

@vsmenon vsmenon reopened this Jun 26, 2019
@vsmenon vsmenon assigned vsmenon and unassigned mkustermann Jun 26, 2019
@vsmenon
Copy link
Member

vsmenon commented Jun 26, 2019

Re-opening, since we still can't build the SDK. Let me take a look.

@vsmenon
Copy link
Member

vsmenon commented Jun 26, 2019

Looks like we're now hitting the same issue as in #36635 - an UnevaluatedConstant where (I think?) we don't expect one.

See try run: https://dart-review.googlesource.com/c/sdk/+/106943

Unsupported operation: Instance creation
#0      ProgramCompiler.visitInstanceCreation (package:dev_compiler/src/kernel/compiler.dart:4931:5)
#1      InstanceCreation.accept (package:kernel/ast.dart:3354:36)
#2      ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3104:20)
#3      ProgramCompiler.visitConditionalExpression (package:dev_compiler/src/kernel/compiler.dart:4834:7)
#4      ConditionalExpression.accept (package:kernel/ast.dart:3163:36)
#5      ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3104:20)
#6      ProgramCompiler.visitUnevaluatedConstant (package:dev_compiler/src/kernel/compiler.dart:5370:7)
#7      UnevaluatedConstant.accept (package:kernel/ast.dart:5898:34)

@vsmenon vsmenon assigned kmillikin and unassigned vsmenon Jun 26, 2019
@vsmenon vsmenon added area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Jun 26, 2019
@vsmenon
Copy link
Member

vsmenon commented Jun 26, 2019

Not sure what changed to now trigger this on a build, but assigning to @kmillikin / front-end as it appears to be the same issue.

@vsmenon vsmenon added this to the D25 Release milestone Jun 26, 2019
@vsmenon vsmenon added P1 A high priority bug; for example, a single project is unusable or has many test failures P0 A serious issue requiring immediate resolution and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jun 26, 2019
@mraleph mraleph assigned mraleph and unassigned kmillikin Jul 4, 2019
dart-bot pushed a commit that referenced this issue Jul 9, 2019
CFE needs to have access to them to be able to perform constant
evaluation.

Bug: #37357
Change-Id: I15705e6fda330a05765ec2e8354051276cb88b07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108278
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
dart-bot pushed a commit that referenced this issue Jul 9, 2019
- for classes with const constructors parse field initializers;
- for const constructions parse initializer lists and default parameter
values;

Fixes issue #37357
Fixes issue #36635

Change-Id: Iff0e47f8bd2925cee9f42a2b309de4de84e99cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108279
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
@mraleph
Copy link
Member

mraleph commented Jul 9, 2019

This should now be fixed.

@mraleph mraleph closed this as completed Jul 9, 2019
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. P0 A serious issue requiring immediate resolution
Projects
None yet
Development

No branches or pull requests

4 participants