Bug 19588

Summary: CRASH doing open() on destroyed window
Product: WebKit Reporter: Eric Roman <eroman>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jchaffraix
Priority: P1 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Reproducible test case for crash -- click the button
none
Crash dump from running the above test on nightly webkit r34581
none
Proposed fix: add null check
eric: review-
Updated version: use top() and cover the other crash pointed by Eric eric: review+

Description Eric Roman 2008-06-16 10:18:59 PDT
Remove iframe from parent, and then do a open() on its contentWindow -- reproducible crash on Safari 3.1 and nightly.
Comment 1 Eric Roman 2008-06-16 10:20:26 PDT
Created attachment 21730 [details]
Reproducible test case for crash -- click the button
Comment 2 Eric Roman 2008-06-16 10:23:01 PDT
Created attachment 21731 [details]
Crash dump from running the above test on nightly webkit r34581
Comment 3 Mark Rowe (bdash) 2008-06-16 13:46:02 PDT
<rdar://problem/6012706>
Comment 4 Sam Weinig 2008-07-16 15:19:29 PDT
This is not a new crash.  Using bisect-builds, I was able to reproduce this all the way back to r29753, the beginning of builds available to the tool.

Comment 5 Julien Chaffraix 2008-07-21 16:57:30 PDT
Created attachment 22415 [details]
Proposed fix: add null check
Comment 6 Alexey Proskuryakov 2008-07-21 22:46:02 PDT
See also: bug 15707.
Comment 7 Eric Seidel (no email) 2008-07-22 08:32:59 PDT
Comment on attachment 22415 [details]
Proposed fix: add null check

Why shouldn't you just use "top()" here?  It seems "top()" wouldn't crash.

Seems like the end of the function doesn't check against null pages either... so that will need to be fixed and a test case added too.
Comment 8 Julien Chaffraix 2008-07-22 14:21:05 PDT
Created attachment 22432 [details]
Updated version: use top() and cover the other crash pointed by Eric

> Why shouldn't you just use "top()" here?  It seems "top()" wouldn't crash.

top() is indeed fine.

> Seems like the end of the function doesn't check against null pages either...
> so that will need to be fixed and a test case added too.

True, I have fixed that too including a layout test.
Comment 9 Eric Seidel (no email) 2008-07-23 13:17:34 PDT
Comment on attachment 22432 [details]
Updated version: use top() and cover the other crash pointed by Eric

Looks fine, but:
if (page) {
 184         for (Frame* frame = page

should change to be an early return:

if (!page)
   return 0;
Comment 10 Julien Chaffraix 2008-07-24 00:47:06 PDT
Updated with Eric's comment and landed in r35321.