Bug 305770

Summary: Extremely slow form submission in rekonq-git when using kdelibs-4.9.0
Product: [Unmaintained] kdelibs Reporter: Jan Kundrát <jkt>
Component: kdewebkitAssignee: webkit-devel
Status: RESOLVED FIXED    
Severity: normal CC: adawit, cfeck
Priority: NOR    
Version: 4.9   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.9.4
Sentry Crash Report:

Description Jan Kundrát 2012-08-25 16:22:16 UTC
1) Go to https://datatracker.ietf.org/submit
2) Add a .txt and an .xml file to the first two <input> fields
3) Click on "Upload". Don't worry, there will be a confirmation (but don't abuse this feature too much).
4) See that rekonq slows down to a crawling speed

I believe that this is in fact a bug in kdelibs. The JavaScript code used for form data extraction looks like a likely culprit, but I haven't tried patching out that code away yet.

When run from inside a debugger, this is the backtrace I get:

(gdb) bt
#0  WTF::HashTable<void*, std::pair<void*, JSC::Weak<WebCore::JSDOMWrapper> >, WTF::PairFirstExtractor<std::pair<void*, JSC::Weak<WebCore::JSDOMWrapper> > >, WTF::PtrHash<void*>, WTF::PairHashTraits<WTF::HashTraits<void*>, WTF::HashTraits<JSC::Weak<WebCore::JSDOMWrapper> > >, WTF::HashTraits<void*> >::rehash (this=0x7fec9b432e68, newTableSize=<optimized out>) at ../../JavaScriptCore/wtf/HashTable.h:931
#1  0x00007feca61fda78 in removeAndInvalidateWithoutEntryConsistencyCheck (pos=0x7fec31033fe0, this=0x7fec9b432e68) at ../JavaScriptCore/wtf/HashTable.h:813
#2  removeWithoutEntryConsistencyCheck (this=0x7fec9b432e68, it=<optimized out>) at ../JavaScriptCore/wtf/HashTable.h:856
#3  remove (this=0x7fec9b432e68, it=<optimized out>) at ../JavaScriptCore/wtf/HashMap.h:289
#4  remove (key=@0x7fff65ed9710, this=0x7fec9b432e68) at ../JavaScriptCore/wtf/HashMap.h:295
#5  uncacheWrapper<void> (domObject=0x7fec367b3190, world=0x7fec9b432e60, wrapper=<optimized out>) at bindings/js/JSDOMBinding.h:134
#6  WebCore::JSDOMWrapperOwner::finalize (this=<optimized out>, handle=<optimized out>, context=<optimized out>) at bindings/js/DOMWrapperWorld.cpp:36
#7  0x00007feca6bfdd8c in JSC::HandleHeap::finalizeWeakHandles (this=0x7fec9b44ac28) at heap/HandleHeap.cpp:104
#8  0x00007feca6bfeb2e in reset (sweepToggle=JSC::Heap::DoNotSweep, this=0x7fec9b44a868) at heap/Heap.cpp:398
#9  JSC::Heap::allocateSlowCase (this=0x7fec9b44a868, bytes=56) at heap/Heap.cpp:122
#10 0x00007feca5f639e0 in allocate (bytes=56, this=0x7fec9b44a868) at ../../JavaScriptCore/runtime/JSCell.h:393
#11 operator new (exec=<optimized out>, size=56) at ../../JavaScriptCore/runtime/JSCell.h:403
#12 createWrapper<WebCore::JSDOMMimeType, WebCore::DOMMimeType> (node=0x7fec2d7bf708, globalObject=0x7fec9835c8d0, exec=0x7fec99b386d8) at ../../WebCore/bindings/js/JSDOMBinding.h:142
#13 wrap<WebCore::JSDOMMimeType, WebCore::DOMMimeType> (domObject=0x7fec2d7bf708, globalObject=0x7fec9835c8d0, exec=0x7fec99b386d8) at ../../WebCore/bindings/js/JSDOMBinding.h:155
#14 WebCore::toJS (exec=0x7fec99b386d8, globalObject=0x7fec9835c8d0, impl=0x7fec2d7bf708) at ../../WebCore/generated/JSDOMMimeType.cpp:202
#15 0x00007feca5f5fa0e in toJS<WebCore::DOMMimeType> (ptr=..., globalObject=<optimized out>, exec=0x7fec99b386d8) at ../../WebCore/bindings/js/JSDOMBinding.h:233
#16 WebCore::JSDOMPlugin::indexGetter (exec=0x7fec99b386d8, slotBase=..., index=<optimized out>) at ../../WebCore/generated/JSDOMPlugin.cpp:305
#17 0x00007feca62a1879 in getValue (propertyName=..., exec=0x7fec99b386d8, this=0x7fff65ed9910) at ../JavaScriptCore/runtime/PropertySlot.h:72
#18 get (propertyName=..., exec=0x7fec99b386d8, this=0x7fec25946e60) at ../JavaScriptCore/runtime/JSObject.h:547
#19 convertValueToQVariantMap (recursionLimit=1, visitedObjects=0x7fff65f41b30, object=0x7fec25946e60, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:197
#20 JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65eda7b0, visitedObjects=0x7fff65f41b30, recursionLimit=1) at bridge/qt/qt_runtime.cpp:388
#21 0x00007feca629ffda in convertValueToQVariantMap (recursionLimit=2, visitedObjects=0x7fff65f41b30, object=0x7fec25946df0, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:201
#22 JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65edb010, visitedObjects=0x7fff65f41b30, recursionLimit=2) at bridge/qt/qt_runtime.cpp:388
#23 0x00007feca629ffda in convertValueToQVariantMap (recursionLimit=3, visitedObjects=0x7fff65f41b30, object=0x7fec2594cce8, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:201
#24 JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65edb870, visitedObjects=0x7fff65f41b30, recursionLimit=3) at bridge/qt/qt_runtime.cpp:388
#25 0x00007feca629ffda in convertValueToQVariantMap (recursionLimit=4, visitedObjects=0x7fff65f41b30, object=0x7fec2594cc78, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:201
#26 JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65edc0d0, visitedObjects=0x7fff65f41b30, recursionLimit=4) at bridge/qt/qt_runtime.cpp:388
#27 0x00007feca629ffda in convertValueToQVariantMap (recursionLimit=5, visitedObjects=0x7fff65f41b30, object=0x7fec2a141378, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:201
[...]
#411 0x00007feca629ffda in convertValueToQVariantMap (recursionLimit=197, visitedObjects=0x7fff65f41b30, object=0x7fec49fa3cd0, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:201
#412 JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65f41130, visitedObjects=0x7fff65f41b30, recursionLimit=197) at bridge/qt/qt_runtime.cpp:388
#413 0x00007feca629ffda in convertValueToQVariantMap (recursionLimit=198, visitedObjects=0x7fff65f41b30, object=0x7fec9977f150, exec=0x7fec99b386d8) at bridge/qt/qt_runtime.cpp:201
#414 JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65f41990, visitedObjects=0x7fff65f41b30, recursionLimit=198) at bridge/qt/qt_runtime.cpp:388
#415 0x00007feca629ec6b in JSC::Bindings::convertValueToQVariant (exec=0x7fec99b386d8, value=..., hint=<optimized out>, distance=0x7fff65f41c94, visitedObjects=0x7fff65f41b30, recursionLimit=199) at bridge/qt/qt_runtime.cpp:423
#416 0x00007feca62a2e72 in JSC::Bindings::convertValueToQVariant (exec=<optimized out>, value=<optimized out>, hint=<optimized out>, distance=<optimized out>) at bridge/qt/qt_runtime.cpp:832
#417 0x00007feca618fc8e in QWebFrame::evaluateJavaScript (this=0x7fecb7b96350, scriptSource=<optimized out>) at Api/qwebframe.cpp:1541
#418 0x00007feca45487d4 in KWebWallet::KWebWalletPrivate::parseFormData (this=0x7fecb791e550, frame=0x7fecb7b96350, fillform=false, ignorepasswd=false)
    at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kdewebkit/kwebwallet.cpp:152
#419 0x00007feca454d245 in KWebWallet::saveFormData (this=0x7fecb7b962f0, frame=0x7fecb7b96350, recursive=true, ignorePasswordFields=false) at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kdewebkit/kwebwallet.cpp:454
#420 0x00007feca45535ff in KWebPage::acceptNavigationRequest (this=0x7fecb7bb09f0, frame=0x7fecb7b96350, request=..., type=QWebPage::NavigationTypeFormSubmitted)
    at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kdewebkit/kwebpage.cpp:409
#421 0x00007feca0bb52e7 in WebPage::acceptNavigationRequest (this=0x7fecb7bb09f0, frame=0x7fecb7b96350, request=..., type=QWebPage::NavigationTypeFormSubmitted)
    at /var/tmp/portage/www-client/rekonq-9999/work/rekonq-9999/src/webpage.cpp:301
#422 0x00007feca61df534 in WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction (this=0x7fecb7b960b0, function=
    (void (WebCore::PolicyChecker::*)(WebCore::PolicyChecker * const, WebCore::PolicyAction)) 0x7feca65e0360 <WebCore::PolicyChecker::continueAfterNavigationPolicy(WebCore::PolicyAction)>, action=..., request=...)
    at WebCoreSupport/FrameLoaderClientQt.cpp:1271
#423 0x00007feca65df9b9 in WebCore::PolicyChecker::checkNavigationPolicy (this=0x7fec9b43e988, request=..., loader=<optimized out>, formState=..., 
    function=0x7feca65c0830 <WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool)>, argument=0x7fec9b43e978) at loader/PolicyChecker.cpp:88
#424 0x00007feca65c0e54 in WebCore::FrameLoader::loadWithDocumentLoader (this=0x7fec9b43e978, loader=0x7fec38979000, type=<optimized out>, prpFormState=<optimized out>) at loader/FrameLoader.cpp:1586
#425 0x00007feca65c1976 in WebCore::FrameLoader::loadWithNavigationAction (this=0x7fec9b43e978, request=<optimized out>, action=..., lockHistory=<optimized out>, type=WebCore::FrameLoadTypeStandard, formState=...)
    at loader/FrameLoader.cpp:1492
#426 0x00007feca65c1fcd in WebCore::FrameLoader::loadPostRequest (this=0x7fec9b43e978, inRequest=<optimized out>, referrer=..., frameName=..., lockHistory=false, loadType=WebCore::FrameLoadTypeStandard, event=..., prpFormState=...)
    at loader/FrameLoader.cpp:2852
#427 0x00007feca65c2ff3 in WebCore::FrameLoader::loadFrameRequest (this=0x7fec9b43e978, request=..., lockHistory=false, lockBackForwardList=false, event=..., formState=..., referrerPolicy=WebCore::SendReferrer)
    at loader/FrameLoader.cpp:1365
#428 0x00007feca65e5a6e in WebCore::ScheduledFormSubmission::fire (this=0x7fec390d4c80, frame=0x7fec9b43e900) at loader/NavigationScheduler.cpp:219
#429 0x00007feca65e2bcc in WebCore::NavigationScheduler::timerFired (this=<optimized out>) at loader/NavigationScheduler.cpp:393
#430 0x00007feca66d4362 in WebCore::ThreadTimers::sharedTimerFiredInternal (this=0x7fec9b45f7a8) at platform/ThreadTimers.cpp:112
#431 0x00007fecb33b53e9 in QObject::event (this=0x7fecb77043f0, e=<optimized out>) at kernel/qobject.cpp:1157
#432 0x00007fecb23d7a74 in QApplicationPrivate::notify_helper (this=0x7fecb6809b10, receiver=0x7fecb77043f0, e=0x7fff65f43a20) at kernel/qapplication.cpp:4551
#433 0x00007fecb23dcbad in QApplication::notify (this=0x7fff65f43da0, receiver=0x7fecb77043f0, e=0x7fff65f43a20) at kernel/qapplication.cpp:3933
#434 0x00007fecb4220fb6 in KApplication::notify (this=0x7fff65f43da0, receiver=0x7fecb77043f0, event=0x7fff65f43a20) at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kdeui/kernel/kapplication.cpp:311
#435 0x00007fecb339c84c in QCoreApplication::notifyInternal (this=0x7fff65f43da0, receiver=0x7fecb77043f0, event=0x7fff65f43a20) at kernel/qcoreapplication.cpp:915
#436 0x00007fecb33d6d02 in sendEvent (event=0x7fff65f43a20, receiver=<optimized out>) at kernel/qcoreapplication.h:231
#437 QTimerInfoList::activateTimers (this=0x7fecb680ac80) at kernel/qeventdispatcher_unix.cpp:611
#438 0x00007fecb33d2e2d in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:186
#439 0x00007fecae984603 in g_main_dispatch (context=0x7fecb67426e0) at gmain.c:2539
#440 g_main_context_dispatch (context=0x7fecb67426e0) at gmain.c:3075
#441 0x00007fecae984980 in g_main_context_iterate (context=0x7fecb67426e0, block=1, dispatch=1, self=<optimized out>) at gmain.c:3146
#442 0x00007fecae984a6c in g_main_context_iteration (context=0x7fecb67426e0, may_block=1) at gmain.c:3207
#443 0x00007fecb33d370f in QEventDispatcherGlib::processEvents (this=0x7fecb6812650, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#444 0x00007fecb2497346 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#445 0x00007fecb339afd2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#446 0x00007fecb339b3bd in QEventLoop::exec (this=0x7fff65f43cf0, flags=...) at kernel/qeventloop.cpp:204
#447 0x00007fecb33a0c0b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#448 0x00007feca0c3dd68 in kdemain (argc=1, argv=0x7fecb6740bd0) at /var/tmp/portage/www-client/rekonq-9999/work/rekonq-9999/src/main.cpp:219
#449 0x00007fecb48d59d8 in launch (argc=1, _name=0x7fecb67b1858 "/usr/bin/rekonq", args=<optimized out>, cwd=0x0, envc=<optimized out>, envs=<optimized out>, reset_env=false, tty=0x0, avoid_loops=false, 
    startup_id_str=0x7fecb67b1883 "svist.flaska.net;1345910648;908214;424682_TIME309003999") at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kinit/kinit.cpp:734
#450 0x00007fecb48d66f0 in handle_launcher_request (sock=<optimized out>, who=<optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kinit/kinit.cpp:1226
#451 0x00007fecb48d6e35 in handle_requests (waitForPid=0) at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kinit/kinit.cpp:1419
#452 0x00007fecb48d7ad4 in main (argc=2, argv=0x7fff65f45350, envp=0x7fff65f45290) at /var/tmp/portage/kde-base/kdelibs-4.9.0/work/kdelibs-4.9.0/kinit/kinit.cpp:1907

Reproducible: Always
Comment 1 Christoph Feck 2012-08-25 19:38:40 UTC
It looks like you are using WebKit, not KHTML, so the JavaScript code would be that of WebKit, too. Reassigning to kdewebkit developers for confirmation.
Comment 2 Dawit Alemayehu 2013-05-26 17:24:41 UTC
This issue has already been addressed for KDE 4.9.4 release.