dart-sdk/utils
Jens Johansen ed8e4255a4 Proposed fix to #36644
TL;DR: Unbind canonical names doesn't do what you think it does and
probably shouldn't (ever) be used. This CL stops using it in a few places.

Longer version:

When loading a dill file it:
- First loads the table of canonical names. These have no references yet.
- When a canonical name is asked for its reference it creates one if it
  doesn't yet have one.
- When loading, for instance, a library, it asks for the reference.

When unbinding a canonical name:
- It removes itself (the canonical name) from the reference
- It removes the reference in itself
- Note: Whatever has a pointer to the reference keeps it, and the
  reference points to whatever node it already pointed to.

This also means, that if we have a dill file that's split in two and:
- Load #1
- Load #2
that works fine, but if we
- Load #1
- Unbind canonical names
- Binds canonical names
- Load #2
stuff is not bound correctly (and an error is thrown).

And - the cause of this bug:
- Load #1
- Load #2
everything is fine
- Unbind canonical names
- Binds canonical names
- Load #2'
stuff is not bound correctly --- references points to stuff loaded as #2,
not as #2'. On top of being weird, wrong and confusing it also caused wrong
things to be but into the class hierarchy which ultimatly caused the crash.

This CL fixes it by not calling unbind and force loading of dill files
(at specific call sites) to create new libraries
(and in the process overwriting references ".node").

Revert "[dartdevc] Retry ddc incremental compile on crash"

This reverts commit ecdbdf00b8.

Revert "[kernel_worker] retry on failure"

This reverts commit 43eebea5a3.

Fixes #36644

Bug: #36644
Change-Id: Id8f548179e6a409b01f2ebfa3219f94cb64b1c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100380
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-26 07:18:28 +00:00
..
analysis_server [gen_snapshot] Restore support for --snapshot_kind=vm-aot-assembly; update docs. 2018-09-28 21:43:04 +00:00
bazel Proposed fix to #36644 2019-04-26 07:18:28 +00:00
compiler Remove library-root option - replace it with a libraries-spec option instead 2018-11-09 22:40:28 +00:00
dartanalyzer Remove the Dart 1 tests. 2018-10-11 23:45:18 +00:00
dartdevc switch dartdevc to kernel and fix path in rules. 2019-02-22 01:02:05 +00:00
dartdoc [VM/SDK] Switch kernel isolate to run in Dart 2 mode 2018-08-21 20:28:06 +00:00
dartfmt [VM/SDK] Switch kernel isolate to run in Dart 2 mode 2018-08-21 20:28:06 +00:00
gen_kernel [SDK] Adds build targets, wrappers and SDK builds for Dart AOT. 2019-04-05 13:23:44 +00:00
kernel-service Add a build rule for bytecode version of kernel_service.dill 2019-03-19 21:29:29 +00:00
peg Spelling fixes e to i. 2017-06-24 13:41:39 +02:00
pub [VM/SDK] Switch kernel isolate to run in Dart 2 mode 2018-08-21 20:28:06 +00:00
tests/peg [infra] Keep comments intact when updating status files. 2018-04-10 19:03:21 +00:00
application_snapshot.gni [sdk] Remove unused --packages flag no longer recognized by gen_snapshot. 2019-02-22 19:48:51 +00:00
compile_platform.gni [ VM / Service ] Dynamically load source from linked-in platform kernel 2019-02-21 18:22:39 +00:00
create_timestamp.gni Make list_files.py and list_dart_files.py return absolute paths for GN 2016-12-13 10:01:28 -08:00
generate_patch_sdk.gni [GN] Uses dart_action.gni instead of compiled_action.gni. 2018-05-03 21:07:13 +00:00