Bug 15154 - Segmentation fault when running javascript
Summary: Segmentation fault when running javascript
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 523.x (Safari 3)
Hardware: All Linux
: P2 Normal
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-07 00:29 PDT by Rikardo Tinauer
Modified: 2008-04-15 05:26 PDT (History)
2 users (show)

See Also:


Attachments
xhtml file containing javascript that crashes WebKit (386.55 KB, application/xhtml+xml)
2007-09-07 00:32 PDT, Rikardo Tinauer
no flags Details
segmentation fault backtrace (10.96 KB, text/plain)
2007-09-07 01:10 PDT, Rikardo Tinauer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rikardo Tinauer 2007-09-07 00:29:45 PDT
I loaded my xhtml file into WebKit (QtLauncher). My xhtml the contains a lot of javascript code and input widgets. The file gets loaded (some errors reported). When I click some input fields and scroll the xhtml up-down a bit it crashes and says segmentation fault.
Comment 1 Rikardo Tinauer 2007-09-07 00:32:21 PDT
Created attachment 16213 [details]
xhtml file containing javascript that crashes WebKit

I suppose javascript in the xhtml file is guilty of crashing WebKit, I have tesed WebKit with variuos sites and html pages with javascripts and I never crshed WebKit since this xhtml file
Comment 2 Rikardo Tinauer 2007-09-07 00:33:12 PDT
I have added attachment that I assume causes the WebKit crash.
Comment 3 Rikardo Tinauer 2007-09-07 01:10:21 PDT
Created attachment 16214 [details]
segmentation fault backtrace

I ran the QtLauncher with my xhtml file and print out backtrace that my xhtml produces
Comment 4 Rikardo Tinauer 2007-09-07 03:47:22 PDT
I forgot to mention that my form sends out AJAX requests, but server was not there when I expirienced a crash, maybe it's relevant information?
Comment 5 Rikardo Tinauer 2007-09-07 04:44:05 PDT
The following crash occured on Linux and Windows
Comment 6 Rikardo Tinauer 2008-01-03 04:12:04 PST
Bug not closed. Found error.

It is in Troltech's class "QWebNetworkRequestPrivate" in file "WebKit/WebKit/qt/Api/qwebnetworkinterface.cpp".

The error is in line 136 in method "QWebNetworkRequestPrivate::init(...)".
The following code 
"DeprecatedString pd = resourceRequest->httpBody()->flattenToString().deprecatedString();" assumes that server backend always exists or always sends back something. If no server backend "httpBody()" method returns null, I added sanity check for null and code now work perfectly.

I don't know it this bug is to be resolved since I have already reported it to Trolltech. The code is different (I found the same bug in Qt 4.4.0 tp1). They will correct their code and when their code is merged into WebKit the error should disappear.

Rikardo
Comment 7 Simon Hausmann 2008-01-03 06:04:13 PST
Holger ran into the same crash some time ago. Your fix is identical to what he came up with and correct :). We'll submit it to SVN soon.
Comment 8 Simon Hausmann 2008-04-15 05:26:32 PDT
Fix landed in r29734