-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix($compile): workaround a GC bug in Chrome < 50 #14286
Conversation
In the version of V8 used in Chrome < 50, the parent of template nodes for `transclude: "element"` directives would be improperly garbage collected despite still having been referenced via `parentNode`. Fixes angular#14041
For reasons mentioned in the original message, no tests were included, however I cannot reproduce the bug anymore with this patch. |
Crazy how you tracked this down 😃 |
Is there a bug opened in Chrome that tracks this? If there is one, can this information be added as a comment in the code. |
@lgalfaso So before making this PR I tried to find any issue or commit on the Chromium, Blink, or v8 bug trackers/repos that I could reference in a comment or the commit message, but I couldn't find anything. I think chances are high that it's a commit in v8 that fixed the actual bug since it's GC related, but no message that has the word Easiest way to figure it out would end up being to git-bisect v8 and re-run the test case to find the commit where it gets fixed, but I don't have a Chromium/v8 build environment and it may not be worth the effort. |
Hey, what I was looking for is more basic:
On Tuesday, March 22, 2016, dherman [email protected] wrote:
|
@lgalfaso, there is "empirical evidence" that it's fixed in Chrome 50 (but no hard proof 😛). |
@gkalpak empirical evidence is good enough :) |
Yep, I tested the original un-patched reproducer in both Chrome 50 and 51 (current canary). I cannot reproduce in either version, so somewhere between v8 versions 4.9.385.28 and 5.0.71, there was a commit that fixed this problem. |
Thanks @dcherman! |
@Narretz, shouldn't this also be backported to |
Absolutely yes. Will do
|
In the version of V8 used in Chrome < 50, the parent of template nodes for `transclude: "element"` directives would be improperly garbage collected despite still having been referenced via `parentNode`. This bug surfaced due to the introduction of lazy transclusion (652b83e), and appears under certain circumstances when using directive start and end elements. It should be removed some time after Chrome 50 has been released. Fixes #14041 Closes #14286
In the version of V8 used in Chrome < 50, the parent of template nodes for
transclude: "element"
directives would be improperly garbage collecteddespite still having been referenced via
parentNode
.No tests are included with this change since this is not a deterministic bug and would require triggering a GC sweep which would involve running the test suite with v8 natives enabled.
Fixes #14041