Bug 26556 - [Qt] Crash when onunload shows a JavaScript alert message
Summary: [Qt] Crash when onunload shows a JavaScript alert message
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-19 12:25 PDT by Yael
Modified: 2009-06-23 18:33 PDT (History)
1 user (show)

See Also:


Attachments
Process getting out of deferred mode asynchronously (4.86 KB, patch)
2009-06-19 14:49 PDT, Yael
zecke: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.