Bug 135988 - Javascript freeze [abort] issue at linux.org
Summary: Javascript freeze [abort] issue at linux.org
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-19 21:46 UTC by Nick Warne
Modified: 2006-10-21 15:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
preliminary patch (965 bytes, patch)
2006-10-20 21:58 UTC, Maksim Orlovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Warne 2006-10-19 21:46:31 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
Compiler:          GCC 3.4.6 -march=athlon-tbird
OS:                Linux

[Problem] If you select 'all matches' in each drop down box from the URL below, Konq produces the 'freeze [abort]' message after a few seconds [wait for it!] loading the results page. 

Strangely, if you do change some categories in the drop down menus, all works OK:

http://www.linux.org/dist/

Atypical it is a Linux site, too ;-)

Nick
Comment 1 Maksim Orlovich 2006-10-19 21:54:55 UTC
Not seeing it, though may be your notion of a few seconds is much shorter than mine.. I presume I was supposed to click 'go' after selecting from the boxes, right?

(But thanks for this report, BTW -- it's very useful to know if instances where this pops up..)
Comment 2 Nick Warne 2006-10-19 22:11:27 UTC
Yes, just click 'go' with all selections left as default 'all matches'.

The page produces this error for me after perhaps 10 seconds.

Maybe go from the front page:

http://www.linux.org/

and select 'distributons' from the left hand frame link.

I also got this on 3.5.4, but waited until 3.5.5 was out as I saw a lot of fixes in the pipeline.

Nick
Comment 3 Nick Warne 2006-10-19 22:17:24 UTC
OK, here is a long gdb output:

konqueror: setLocationBarURL : url = http://www.linux.org/dist/
konqueror: KonqMainWindow::setLocationBarURL: url = http://www.linux.org/dist/
konqueror: Creating new konqrun for http://www.linux.org/dist/ req.typedURL=
kparts: BrowserRun::scanfile http://www.linux.org/dist/
kparts: slotBrowserMimetype: found text/html for http://www.linux.org/dist/
kio (KIOJob): Job::kill this=0x8465d30 KIO::TransferJob m_progressId=0 quietly=true
konqueror: KonqMainWindow::openView text/html http://www.linux.org/dist/ 0x82c9068 req:[forceAutoEmbed]
konqueror: changeViewMode: serviceType is text/html serviceName is  current service name is khtml
konqueror: KonqView::openURL url=http://www.linux.org/dist/ locationBarURL=http://www.linux.org/dist/
konqueror: KonqMainWindow::setLocationBarURL: url = http://www.linux.org/dist/
khtml (part): KHTMLPart(0x839ca48)::openURL http://www.linux.org/dist/
khtml (part): saveState this=0x839ca48 '' saving URL http://www.linux.org/dist/
khtml (part):     saveState this=0x85461e0 'linuxhq' saving URL http://www.linuxhq.com/kernel/bin/latest
libkonq: ## addToHistory: http://www.linux.org/dist/ Typed URL: http://www.linux.org/dist/, Title:
konqueror: KonqMainWindow::openView ok=true bOthersFollowed=false returning true
kio (Scheduler): Resume metadata is ''
kio (Scheduler): HOLD: Reusing held slave for http://www.linux.org/dist/
konqueror: KonqMainWindow::slotRunFinished()
kparts: 0x8544e18 emitting activePartChanged (nil)
kparts: Part::~Part 0x85461e0
kparts: deleting widget [KHTMLView pointer (0x8319390) to widget linuxhq, geometry=300x160+2187+2779] linuxhq
khtml (html):  using compatibility parseMode
konqueror: KonqMainWindow::setCaption(Linux Online - Distributions and FTP Sites)
khtml (tokenizer): Finished loading an external script
khtml (tokenizer): Finished loading an external script
khtml (tokenizer): Finished loading an external script
khtml: 0x839ca48: KHTMLPart::submitForm target= url=list.html
khtml (tokenizer): Finished loading an external script
khtml (part): saveState this=0x839ca48 '' saving URL http://www.linux.org/dist/
libkonq: ## addToHistory: http://www.linux.org/dist/ Typed URL: , Title: Linux Online - Distributions and FTP Sites
khtml: 0x839ca48: KHTMLPart::submitForm target= url=list.html
konqueror: KonqMainWindow::slotOpenURLRequest frameName=
konqueror: KonqMainWindow::openURL (from slotOpenURLRequest) url=http://www.linux.org/dist/list.html
konqueror: KonqMainWindow::openURL : url = 'http://www.linux.org/dist/list.html'  serviceType=' req=[]' view=0x82c9068
khtml (part): saveState this=0x839ca48 '' saving URL http://www.linux.org/dist/
konqueror: trying openView for http://www.linux.org/dist/list.html (serviceType )
konqueror: setLocationBarURL : url = http://www.linux.org/dist/list.html
konqueror: KonqMainWindow::setLocationBarURL: url = http://www.linux.org/dist/list.html
konqueror: Creating new konqrun for http://www.linux.org/dist/list.html req.typedURL=
kparts: BrowserRun::scanfile http://www.linux.org/dist/list.html
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
konqueror: Render Style Declaration created
kparts: slotBrowserMimetype: found text/html for http://www.linux.org/dist/list.html
kio (KIOJob): Job::kill this=0x850bae0 KIO::TransferJob m_progressId=0 quietly=true
konqueror: KonqMainWindow::openView text/html http://www.linux.org/dist/list.html 0x82c9068 req:[forceAutoEmbed]
konqueror: changeViewMode: serviceType is text/html serviceName is  current service name is khtml
konqueror: KonqView::openURL url=http://www.linux.org/dist/list.html locationBarURL=http://www.linux.org/dist/list.html
konqueror: KonqMainWindow::setLocationBarURL: url = http://www.linux.org/dist/list.html
khtml (part): KHTMLPart(0x839ca48)::openURL http://www.linux.org/dist/list.html
khtml (part): saveState this=0x839ca48 '' saving URL http://www.linux.org/dist/list.html
libkonq: ## addToHistory: http://www.linux.org/dist/list.html Typed URL: http://www.linux.org/dist/list.html, Title:
konqueror: KonqMainWindow::openView ok=true bOthersFollowed=false returning true
kio (Scheduler): Resume metadata is ''
kio (Scheduler): HOLD: Reusing held slave for http://www.linux.org/dist/list.html
konqueror: KonqMainWindow::slotRunFinished()
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
khtml (html):  using compatibility parseMode
konqueror: KonqMainWindow::setCaption(Linux Online - List of distributions)
khtml (tokenizer): Finished loading an external script
khtml (tokenizer): Finished loading an external script
khtml (tokenizer): Finished loading an external script
khtml (tokenizer): Finished loading an external script
khtml (jscript): alarmhandler
                                                                          
Comment 4 Maksim Orlovich 2006-10-20 21:39:25 UTC
OK, I can confirm it on my laptop if I slow it down to 600MHz. How fast is your machine, and did you build with optimizations?

The slowness seems to be due innerText suckage -- I'll try to see that doing speed ups similar to what I did with innerHTML will help...
Comment 5 Nick Warne 2006-10-20 21:48:38 UTC
My box is quiet old, circa 2000 - CPU is AMD Athlon-tbird 1200Mhz.  I have 1.5GB RAM.

I build KDE with Konstruct using one optimisation only:

-march=athlon-tbird

on gcc version 3.4.6

I can test any patch you create.  Thanks for help, Maksim.

Nick
Comment 6 Maksim Orlovich 2006-10-20 21:58:26 UTC
Created attachment 18211 [details]
preliminary patch 

Preliminary patch. This has some debug output, which will be gone in the final
version -- it tells how much time was spent in that method.. On this machine
before this patch it actually took something like 5-7 seconds, and after
something like 20ms (it's an asymptotic fix). Please let me know if it helps...
(The other machine I tried on was sufficiently beefy not to hit it --- 3GHz
Pentium 4..)

Thanks again for reporting this and the help with the testing..

[There is still some slight freeze on the webpage, I'll see whether I can try
catching it...]
Comment 7 Nick Warne 2006-10-20 22:10:55 UTC
Bloody genius - works PERFECT :-)

Great stuff!!!

I would mark as resolved, but this is a preliminary patch.

Nick
Comment 8 Nick Warne 2006-10-20 22:20:08 UTC
OK, I don't run debug (I have $ENV set to off) so timing values I can't see unless I reset all... if you need them.

But here is gdb output now with patch applied (tail end):

konqueror: Render Style Declaration destroyed
konqueror: Render Style Declaration destroyed
khtml (css): CSSStyleDeclarationImpl::setProperty invalid property: [padding-bottom] value: [1px;]
khtml (css): CSSStyleDeclarationImpl::setProperty invalid property: [padding-bottom] value: [1px;]
khtml (css): CSSStyleDeclarationImpl::setProperty invalid property: [padding-bottom] value: [1px;]
khtml (jscript): WARNING: Script threw exception: TypeError: Attempted to access 'tagName' property on undefined object (result of expression obj.tagName)
khtml (css): CSSStyleDeclarationImpl::setProperty invalid property: [padding-bottom] value: [1px;]
konqueror: KonqMainWindow::closeEvent begin
konqueror: KonqMainWindow::closeEvent end


Nick :-)
Comment 9 Nick Warne 2006-10-21 12:32:50 UTC
With debug ON, I get this after page is loaded:

spent:107

Nick
Comment 10 Maksim Orlovich 2006-10-21 15:44:22 UTC
SVN commit 597736 by orlovich:

Fix poor scalability of innerText, making it much faster..
BUG:135988


 M  +3 -2      html_elementimpl.cpp  


--- branches/KDE/3.5/kdelibs/khtml/html/html_elementimpl.cpp #597735:597736
@@ -460,7 +460,7 @@
 
 DOMString HTMLElementImpl::innerText() const
 {
-    DOMString text = "";
+    QString text = "";
     if(!firstChild())
         return text;
 
@@ -481,7 +481,8 @@
             n = next;
         }
         if(n->isTextNode() ) {
-            text += static_cast<const TextImpl *>(n)->data();
+            DOMStringImpl* data = static_cast<const TextImpl *>(n)->string();
+            text += QConstString(data->s, data->l).string();
         }
     }
  end: