Bug 85057 - konqueror crashed after closing
Summary: konqueror crashed after closing
Status: RESOLVED DUPLICATE of bug 116599
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 70731 83686 106810 114467 115233 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-13 05:43 UTC by Gardner Bell
Modified: 2007-05-24 18:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gardner Bell 2004-07-13 05:43:21 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6) 
OS:                Linux

I've tried to reproduce the following crash a second time to give you more to go on but was unable to.  At the time of the crash I had just closed up konq after performing a search on google.

Using host libthread_db library "/lib/libthread_db.so.1".
[KCrash handler]
#5  0x4142e201 in kill () from /lib/libc.so.6
#6  0x412c0b61 in pthread_kill () from /lib/libpthread.so.0
#7  0x412c0edb in raise () from /lib/libpthread.so.0
#8  0x4142df94 in raise () from /lib/libc.so.6
#9  0x4142f4e8 in abort () from /lib/libc.so.6
#10 0x41427678 in __assert_fail () from /lib/libc.so.6
#11 0x41a1f85a in khtml::Cache::clear() () at qdict.h:114
#12 0x4191fbf8 in ~KHTMLFactory (this=0x80fc768)
    at /home/gdcb04/src/kde/kdelibs/khtml/khtml_factory.cpp:96
#13 0x4191fdc8 in KHTMLFactory::deref() ()
    at /home/gdcb04/src/kde/kdelibs/khtml/khtml_factory.cpp:135
#14 0x4191fb07 in ~KHTMLFactory (this=0x84c7b90)
    at /home/gdcb04/src/kde/kdelibs/khtml/khtml_factory.cpp:99
#15 0x4081d0dc in ~KLibrary (this=0x84d03c0)
    at /home/gdcb04/src/kde/kdelibs/kdecore/klibloader.cpp:134
#16 0x4081de9c in KLibrary::slotTimeout() (this=0x412c6b84)
    at /home/gdcb04/src/kde/kdelibs/kdecore/klibloader.cpp:256
#17 0x408209a8 in KLibrary::qt_invoke(int, QUObject*) (this=0x84d03c0, _id=4, 
    _o=0xbfffe470) at klibloader.moc:91
#18 0x40bd16fc in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#19 0x40bd1524 in QObject::activate_signal(int) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#20 0x40f0d8db in QTimer::timeout() () from /usr/qt/3/lib/libqt-mt.so.3
#21 0x40bf2df2 in QTimer::event(QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
#22 0x40b7575f in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#23 0x40b74b1e in QApplication::notify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#24 0x40755393 in KApplication::notify(QObject*, QEvent*) (this=0xbfffeeb0, 
    receiver=0x82e05e8, event=0xbfffe8a0)
    at /home/gdcb04/src/kde/kdelibs/kdecore/kapplication.cpp:512
#25 0x40b64e95 in QEventLoop::activateTimers() ()
   from /usr/qt/3/lib/libqt-mt.so.3
#26 0x40b2012b in QEventLoop::processEvents(unsigned) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#27 0x40b878d8 in QEventLoop::enterLoop() () from /usr/qt/3/lib/libqt-mt.so.3
#28 0x40b87788 in QEventLoop::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#29 0x40b759b1 in QApplication::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#30 0x4160479c in kdemain (argc=0, argv=0x0)
    at /home/gdcb04/src/kde/kdebase/konqueror/konq_main.cc:204
#31 0x40917986 in kdeinitmain (argc=0, argv=0x0) at konqueror_dummy.cc:2
#32 0x0804cd46 in launch (argc=2, _name=0x80bc554 "konqueror", 
    args=0x80bc567 "\001", cwd=0x0, envc=1, envs=0x80bc578 "", 
    reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x0)
    at /home/gdcb04/src/kde/kdelibs/kinit/kinit.cpp:599
#33 0x0804e3b1 in handle_launcher_request (sock=8)
    at /home/gdcb04/src/kde/kdelibs/kinit/kinit.cpp:1163
#34 0x0804e8fd in handle_requests (waitForPid=0)
    at /home/gdcb04/src/kde/kdelibs/kinit/kinit.cpp:1364
#35 0x0804fa62 in main (argc=3, argv=0xbffff5a4, envp=0x0)
    at /home/gdcb04/src/kde/kdelibs/kinit/kinit.cpp:1817

The following is what I found in my logfile after the crash:

kdeinit: konqueror --silent: /home/gdcb04/src/kde/kdelibs/khtml/misc/loader.cpp:1249: static void khtml::Cache::clear(): Assertion `it.current()->canDelete()' failed.
Comment 1 Gardner Bell 2004-07-14 23:12:51 UTC
Not sure if this will help any but konqueror crashed again after shutting it down with the same backtrace on this website. http://hispeed.rogers.yahoo.com
Comment 2 Allan Sandfeld 2005-01-10 00:09:57 UTC
Have you seen any such crashes with a KDE 3.3 stable release?
Comment 3 Allan Sandfeld 2005-01-10 00:55:54 UTC
After browsing around and closing bugs, I got it as well. Might indeed have something to do with your link.

#8  0xb6ecf029 in khtml::Cache::clear () at qdict.h:114
#9  0xb6dbaf98 in ~KHTMLFactory (this=0x852de70)
    at ../../khtml/khtml_factory.cpp:98
#10 0xb6dbb172 in KHTMLFactory::deref () at ../../khtml/khtml_factory.cpp:139
#11 0xb6dbaea7 in ~KHTMLFactory (this=0x84fbd98)
    at ../../khtml/khtml_factory.cpp:103
#12 0xb7b6394c in ~KLibrary (this=0x84fba80)
    at ../../kdecore/klibloader.cpp:131
#13 0xb7b66d85 in KLibLoader::close_pending (this=0x8526828, wrap=0x86bc390)
    at ../../kdecore/klibloader.cpp:516
#14 0xb7b6586a in ~KLibLoader (this=0x8526828)
    at ../../kdecore/klibloader.cpp:328
#15 0xb7b648f3 in KLibLoader::cleanUp () at ../../kdecore/klibloader.cpp:298
#16 0xb7a9fe91 in ~KApplication (this=0xbffff5f0)
    at ../../kdecore/kapplication.cpp:1563
Comment 4 Tommi Tervo 2005-05-20 09:53:58 UTC
*** Bug 83686 has been marked as a duplicate of this bug. ***
Comment 5 Tommi Tervo 2005-06-06 10:24:40 UTC
*** Bug 106810 has been marked as a duplicate of this bug. ***
Comment 6 Maksim Orlovich 2005-07-10 01:03:25 UTC
SVN commit 433186 by orlovich:

Fix at least one of the reasons for this:
konqueror: /home/maksim/kde3/kdelibs/khtml/misc/loader.cpp:1307: static void khtml::Cache::clear(): Assertion `it.current()->canDelete()' failed.
And actually, quite a bit of other potential leaks or worse in the parser.
Unlike in WC, khtml's parser's element stack ref's and deref's elements. So it's not right 
to merely change the pointer in the stack without updating the refcounts. Testcase upcoming.
Thanks to Ismail for the test page.

May or may not help #85057
CCBUG:85057


 M  +12 -5     htmlparser.cpp  


--- trunk/KDE/kdelibs/khtml/html/htmlparser.cpp #433185:433186
@@ -86,6 +86,13 @@
     ~HTMLStackElem()
         { node->deref(); }
 
+    void setNode(NodeImpl* newNode)
+    {
+        newNode->ref();
+        node->deref();
+        node = newNode;
+    }
+
     int       id;
     int       level;
     bool      strayTableContent;
@@ -1301,7 +1308,7 @@
             HTMLStackElem* nextElem = currElem->next;
             if (!isResidualStyleTag(currElem->id)) {
                 prevElem->next = nextElem;
-                prevElem->node = currElem->node;
+                prevElem->setNode(currElem->node);
                 delete currElem;
             }
             else
@@ -1326,7 +1333,7 @@
                 currNode = currElem->node->cloneNode(false);
 
                 // Change the stack element's node to point to the clone.
-                currElem->node = currNode;
+                currElem->setNode(currNode);
 
                 // Attach the previous node as a child of this new node.
                 if (prevNode)
@@ -1386,7 +1393,7 @@
         currElem = currElem->next;
     }
     prevElem->next = elem->next;
-    prevElem->node = elem->node;
+    prevElem->setNode(elem->node);
     delete elem;
 
     // Step 7: Reopen intermediate inlines, e.g., <b><p><i>Foo</b>Goo</p>.
@@ -1407,7 +1414,7 @@
             // curr->id rather than the node that you should pop to when the element gets pulled off
             // the stack.
             popOneBlock(false);
-            curr->node = currNode;
+            curr->setNode(currNode);
             curr->next = residualStyleStack;
             residualStyleStack = curr;
         }
@@ -1541,7 +1548,7 @@
                 // the stack.
                 popOneBlock(false);
                 Elem->next = residualStyleStack;
-                Elem->node = currNode;
+                Elem->setNode(currNode);
                 residualStyleStack = Elem;
             }
             else
Comment 7 Thiago Macieira 2005-10-16 06:01:57 UTC
*** Bug 114467 has been marked as a duplicate of this bug. ***
Comment 8 Thiago Macieira 2005-10-16 06:02:49 UTC
The backtrace is the same as bug 70731, which was first reported for KDE 3.2 and is now marked as fixed.
Comment 9 Thiago Macieira 2005-10-28 01:23:11 UTC
*** Bug 115233 has been marked as a duplicate of this bug. ***
Comment 10 Maksim Orlovich 2005-10-31 14:46:18 UTC
*** Bug 70731 has been marked as a duplicate of this bug. ***
Comment 11 Tommi Tervo 2005-11-18 08:48:21 UTC
Bug 116599 has a test case && patch

*** This bug has been marked as a duplicate of 116599 ***
Comment 12 Freddie 2007-05-24 18:33:04 UTC
same thing happened here. Konq was showing my home area. I quickly closed Opera, then konq.

I managed to lose my error log. Sorry! (you guys need an auto-report system!)