Bug 9920 - REGRESSION: Assertion failure: !m_policyListener in WebFrameLoaderClient::setUpPolicyListener when re-sending form data
Summary: REGRESSION: Assertion failure: !m_policyListener in WebFrameLoaderClient::set...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL: http://www.verticaladventures.org/tra...
Keywords: InRadar, NeedsReduction, Regression
: 12418 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-14 13:56 PDT by Alexey Proskuryakov
Modified: 2007-07-14 06:06 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2006-07-14 13:56:09 PDT
When trying to reproduce another bug, I got an assertion failure:

=================
ASSERTION FAILED: !reachedTerminalState (/Users/ap/WebKit/WebKit/WebView/WebLoader.m:601 -[WebLoader cancelWithError:])
=================

Immediately before that, I reloaded a page that was itself a result of form submission (see bug URL), and clicked Cancel in the sheet offering to re-send the data. I could reproduce this twice, but could not find any way to reproduce reliably.

Thread 0 Crashed:
0   com.apple.WebKit         	0x0034590c -[WebLoader cancelWithError:] + 104 (WebLoader.m:601)
1   com.apple.WebKit         	0x003859cc -[WebMainResourceLoader cancelWithError:] + 268 (WebMainResourceLoader.m:114)
2   com.apple.WebKit         	0x00385b24 -[WebMainResourceLoader stopLoadingForPolicyChange] + 128 (WebMainResourceLoader.m:126)
3   com.apple.WebKit         	0x00385ba8 -[WebMainResourceLoader continueAfterNavigationPolicy:formState:] + 84 (WebMainResourceLoader.m:134)
4   com.apple.WebKit         	0x0035a0b4 -[WebFrame(WebPrivate) _continueAfterNavigationPolicy:] + 752 (WebFrame.m:1778)
5   com.apple.WebKit         	0x003b2478 -[WebPolicyDecisionListener _usePolicy:] + 92 (WebPolicyDelegate.m:92)
6   com.apple.WebKit         	0x003b25d4 -[WebPolicyDecisionListener ignore] + 68 (WebPolicyDelegate.m:112)
7   com.apple.Safari         	0x00017ee4 0x1000 + 93924
8   com.apple.Safari         	0x000a9f6c 0x1000 + 692076
9   com.apple.AppKit         	0x938ec390 -[NSAlert didEndSheet:returnCode:contextInfo:] + 108
10  com.apple.AppKit         	0x938d73ac -[NSAlert buttonPressed:] + 380
11  com.apple.AppKit         	0x9378ac4c -[NSApplication sendAction:to:from:] + 108
12  com.apple.Safari         	0x0002956c 0x1000 + 165228
13  com.apple.AppKit         	0x9378ab80 -[NSControl sendAction:to:] + 96
14  com.apple.AppKit         	0x9378aa60 -[NSCell _sendActionFrom:] + 156
15  com.apple.AppKit         	0x937a4a88 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1020
16  com.apple.AppKit         	0x937a4670 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 564
17  com.apple.AppKit         	0x937a4094 -[NSControl mouseDown:] + 536
18  com.apple.AppKit         	0x93745890 -[NSWindow sendEvent:] + 4616
19  com.apple.AppKit         	0x936ee8d4 -[NSApplication sendEvent:] + 4172
20  com.apple.Safari         	0x00021238 0x1000 + 131640
21  com.apple.AppKit         	0x936e5d10 -[NSApplication run] + 508
Comment 1 Alexey Proskuryakov 2006-12-22 12:25:29 PST
Even after all the refactoring, this bug still reproduces, although with a different assertion:

ASSERTION FAILED: !m_policyListener
(/Users/ap/WebKit/WebKit/WebCoreSupport/WebFrameLoaderClient.mm:1151 setUpPolicyListener)

Thread 0 Crashed:
0   com.apple.WebKit         	0x003d806c WebFrameLoaderClient::setUpPolicyListener(void (WebCore::FrameLoader::*)(WebCore::PolicyAction)) + 120 (WebFrameLoaderClient.mm:1151)
1   com.apple.WebKit         	0x003d84bc WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(void (WebCore::FrameLoader::*)(WebCore::PolicyAction), WebCore::String const&, WebCore::ResourceRequest const&) + 200 (WebFrameLoaderClient.mm:670)
2   com.apple.WebCore        	0x0149094c WebCore::FrameLoader::checkContentPolicy(WebCore::String const&, void (*)(void*, WebCore::PolicyAction), void*) + 176 (FrameLoaderMac.mm:626)
3   com.apple.WebCore        	0x01497494 WebCore::MainResourceLoader::didReceiveResponse(NSURLResponse*) + 784 (MainResourceLoaderMac.mm:299)
4   com.apple.WebCore        	0x01493918 WebCore::ResourceLoader::didReceiveResponse(WebCore::ResourceHandle*, WebCore::ResourceResponse const&) + 80 (ResourceLoaderMac.mm:437)
5   com.apple.WebCore        	0x014a8a2c -[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:] + 164 (ResourceHandleMac.mm:268)
6   com.apple.Foundation     	0x9298da2c -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] + 416
7   com.apple.Foundation     	0x9298d810 _sendCallbacks + 156


Steps to reproduce:
1. Open http://www.verticaladventures.org/trainingmanuals.cfm
2. Enter something for the code, press Enter.
3. Dismiss an alert that appears.
4. Reload the page, click Cancel when asked about re-sending form data.
4. Reload the page again, click Resend this time.

Results: the same sheet asking about re-sending form data appears again; then WebKit crashes with an assertion.

Adding a NeedsRadar keyword, because the behavior is closely tied to Safari.
Comment 2 Alexey Proskuryakov 2006-12-22 13:10:23 PST
Closed by accident, re-opening.
Comment 3 Mark Rowe (bdash) 2007-01-16 18:46:06 PST
<rdar://problem/4928572>
Comment 4 David Kilzer (:ddkilzer) 2007-01-26 10:46:19 PST
*** Bug 12418 has been marked as a duplicate of this bug. ***
Comment 5 David Kilzer (:ddkilzer) 2007-01-26 10:48:12 PST
I've been seeing this a lot recently when playing with the W3C HTML validator using this URL:

http://validator.w3.org/#validate-by-upload

See Bug 12418 for current assertion and stack trace.
Comment 6 David Kilzer (:ddkilzer) 2007-01-26 11:09:10 PST
Steps to reproduce:

1. Open Safari/WebKit.
2. Open URL:  http://validator.w3.org/
3. Click "Choose File" in "Validate by File Upload" section and select an HTML file.
4. Click "Check" button.
5. Let page load, but DO NOT click anywhere in the page or scroll it.
6. Click "Reload" button in Safari.

Expected results:

Page should reload without crashing Safari/WebKit.

Actual results:

Safari/WebKit crashes with said assertion failure.

Regression:

This is a regression from shipping Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8N1037).

Notes:

Reproduced using a locally-built debug build of WebKit r19151 with Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8N1037).

Comment 7 David Kilzer (:ddkilzer) 2007-01-26 11:11:30 PST
(In reply to comment #6)
> Steps to reproduce:
> 
> 1. Open Safari/WebKit.
> 2. Open URL:  http://validator.w3.org/
> 3. Click "Choose File" in "Validate by File Upload" section and select an HTML file.
> 4. Click "Check" button.
> 5. Let page load, but DO NOT click anywhere in the page or scroll it.
> 6. Click "Reload" button in Safari.

7. Click "Send" on the "Are you sure you want to send a form again?" sheet.

Note that a second sheet will appear, but Safari/WebKit will crash before you may click "Send".  Bug 12417 is filed for the second sheet appearing.
Comment 8 Maciej Stachowiak 2007-02-04 11:06:41 PST
Closed in Radar; resolving
Comment 9 Alexey Proskuryakov 2007-02-04 12:38:25 PST
This still happens for me; reopening. Chris Petersen is going to reopen the Radar bug, as well.
Comment 10 Maciej Stachowiak 2007-02-09 03:38:02 PST
Indeed, I can repro with the validator steps as well. Escalating to P1, since it blocks another P1 on the validator page.
Comment 11 Anders Carlsson 2007-02-16 12:19:13 PST
I can't reproduce this anymore, it was probably fixed by the fix to http://bugs.webkit.org/show_bug.cgi?id=12417
Comment 12 Alexey Proskuryakov 2007-07-14 06:06:03 PDT
Still happens with slightly different steps to reproduce, see bug 14617.