Bug 26556

Summary: [Qt] Crash when onunload shows a JavaScript alert message
Product: WebKit Reporter: Yael <yael>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hausmann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.5   
Attachments:
Description Flags
Process getting out of deferred mode asynchronously zecke: review+

Description Yael 2009-06-19 12:25:03 PDT
Loading the following content, and reloading it again causes a crash:

<html>
<body  onunload="alert('goodbye');">
test
</body>
</html>

The reason is that the QNetworkReply::finished signal is processed before the QNetworkReply::readyRead signal.
A patch will be added shortly.
Comment 1 Kenneth Rohde Christiansen 2009-06-19 12:51:40 PDT
When you finish the patch (I have already look at a preliminary one) please add a test. 

You could add the code snipped as a WebCore/manual-test/qt test, but instead of writing "test" write something along the lines of:

"Reload me twice ensuring that this didn't result in a crash. Test added due to bug <a 'href="https://bugs.webkit.org/show_bug.cgi?id=26556'>@25556</a>"
Comment 2 Yael 2009-06-19 14:49:18 PDT
Created attachment 31565 [details]
Process getting out of deferred mode asynchronously

With this patch, processing of getting out of deferred mode is processed asynchronously.
In the attached test case, onunload causes a JavaScript alert to show up, and the newly received data is not processed until getting out of deferred mode. We should not process the next signal in the queue, before finishing processing of the current one.
Comment 3 Holger Freyther 2009-06-22 00:10:09 PDT
Comment on attachment 31565 [details]
Process getting out of deferred mode asynchronously

Okay, looks sensible. Maybe we should rename m_should* to something like m_handle*Later?
Comment 4 Yael 2009-06-22 06:26:17 PDT
Landed in 44934.
I did not change the argument names because I did not want to mess-up the commit :-) We should revisit the naming again.