ed8e4255a4
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 commitecdbdf00b8. Revert "[kernel_worker] retry on failure" This reverts commit43eebea5a3. 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>