This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
heap use-after-free at WebCore::TimerBase::heapPopMin()
https://bugs.webkit.org/show_bug.cgi?id=157742 <rdar://problem/26236778> Source/WebCore: Reviewed by David Kilzer. Tested by fast/frames/resources/crash-during-iframe-load-stop.html. * loader/FrameLoader.cpp: (WebCore::FrameLoader::stopForUserCancel): Protect m_frame from destruction while it is still being used by the current stack frame. (WebCore::FrameLoader::frameDetached): Ditto. (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): Ditto. LayoutTests: Reviewed by Simon Fraser. * fast/frames/crash-during-iframe-load-stop-expected.txt: Added. * fast/frames/crash-during-iframe-load-stop.html: Added. * fast/frames/resources/crash-during-iframe-load-stop-inner.html: Added. * fast/frames/resources/crash-during-iframe-load-stop.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@200986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
bfulgham@apple.com
committed
May 17, 2016
1 parent
464f4cd
commit 98845d9
Showing
7 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
LayoutTests/fast/frames/crash-during-iframe-load-stop-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This tests that WebKit does not crash when frame loads are interrupted. This test passes if it does not crash. | ||
|
||
|
38 changes: 38 additions & 0 deletions
38
LayoutTests/fast/frames/crash-during-iframe-load-stop.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<html> | ||
<head> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.waitUntilDone(); | ||
testRunner.dumpAsText(); | ||
} | ||
|
||
var count = 0; | ||
</script> | ||
</head> | ||
<body onload='deleteFrame()'> | ||
<script> | ||
function deleteFrame() | ||
{ | ||
var frameToRemove = document.getElementById('subframe'); | ||
document.body.removeChild(frameToRemove); | ||
} | ||
|
||
function reloadSubframe() | ||
{ | ||
var iframe = document.createElement('iframe'); | ||
iframe.id = 'subframe'; | ||
iframe.src = 'resources/crash-during-iframe-load-stop.html'; | ||
document.body.appendChild(iframe); | ||
setTimeout(function() { deleteFrame(); }, 0); | ||
} | ||
|
||
function subFrameFinishedLoading() | ||
{ | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
} | ||
</script> | ||
<p>This tests that WebKit does not crash when frame loads are interrupted. This test passes if it does not crash.</p> | ||
<iframe id="subframe" src='resources/crash-during-iframe-load-stop.html'></iframe> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
LayoutTests/fast/frames/resources/crash-during-iframe-load-stop-inner.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<html> | ||
<script> | ||
window.parent.stop(); | ||
window.parent.subFrameFinishedLoading(); | ||
</script> | ||
</html> |
16 changes: 16 additions & 0 deletions
16
LayoutTests/fast/frames/resources/crash-during-iframe-load-stop.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
<script> | ||
function subFrameFinishedLoading() | ||
{ | ||
window.parent.count = window.parent.count + 1; | ||
if (window.parent.count < 10) | ||
window.parent.reloadSubframe(); | ||
else | ||
window.parent.subFrameFinishedLoading(); | ||
} | ||
</script> | ||
</head> | ||
<iframe src="crash-during-iframe-load-stop-inner.html"></iframe> | ||
<iframe src="data:text/html, <html></html>"></iframe> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98845d9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1254687
3155