Fix cancellation handling in HTMLParserScriptRunner::pendingScriptFinished() |
|
Issue descriptionIn HTMLParserScriptRunner::pendingScriptFinished(), when the PendingScript is cancelled during executing a script, we simply dispose()s the PendingScript. [A] https://codereview.chromium.org/2693423002 introduced a bug, because after this CL we have to clear pointers to PendingScript, not just calling PendingScript::dispose(). This regression is tracked e.g. by Issue 695730 . [B] However, there looks still a subtle bug: pendingScriptFinished() can be called in two cases, where (1) |pendingScript| is |m_parserBlockingScript|, or (2) |pendingScript| is |m_scriptsToExecuteAfterParsing.first()|, corresponding to two call sites of watchForLoad(). In the case of (2), PendingScript is silently disposed without calling HTMLParserScriptRunner::executeScriptsWaitingForParsing(), and thus I suspect HTMLDocumentParser::end() is not called in some situations. I think this is not a recent regression. I'm not so sure whether/how frequently the case (2) occurs (so far clusterfuzz or I haven't found any test case), or the issue [B] actually matters. There was a code block that handles the case (2) explicitly, so perhaps the case (2) actually occurs?: Before https://codereview.chromium.org/2549143009, HTMLParserScriptRunner::stopWatchingResourceForLoad() handles both cases. My plan is to fix [A] to fix recent regressions, and handle [B] later. Also I'll add a CHECK() for a short period of time (only on canary, or DCHECK()) that causes the case (2) to crash, expecting clusterfuzz to find a nice test case for that. Does anyone know anything about these cases?
,
May 21 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c365bd25d9c0c2d847bc7cc5aab378ed0d29e1c9 commit c365bd25d9c0c2d847bc7cc5aab378ed0d29e1c9 Author: Kouhei Ueno <kouhei@chromium.org> Date: Mon May 21 12:26:03 2018 retire CHECK(false) Bug: 695730 , 696775, 686281 Change-Id: Id11515ceb7ce61fa15411a57ac4a105d03f3e6e6 Reviewed-on: https://chromium-review.googlesource.com/1065559 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#560258} [modify] https://crrev.com/c365bd25d9c0c2d847bc7cc5aab378ed0d29e1c9/third_party/blink/renderer/core/script/html_parser_script_runner.cc |
|
►
Sign in to add a comment |
|
Comment 1 by bugdroid1@chromium.org
, Feb 28 2017