Re: KLinkStatus crash

Andras Mantia <[email protected]>
Newsgroups gmane.comp.kde.devel.quanta
Message-ID <[email protected]>
On Wednesday 08 February 2006 03:16, Jens Herden wrote:
> Very strange. I tried Andras tip and I got the message that there are
> more than 30.000 errors and that I should go and fix my application
> from valgrind :-)

I also run and found the crash as well.Regarding the errors, many came from X, 
ICE and some from Qt, you can ignore them. The interesting errors are those
 coming from your code. There are a lot regarding painting the cells in 
TreeView/TreeViewItem. But the problem seem to be in other place (non-formatted text, 
so use a wide window to see it):

==15418== Conditional jump or move depends on uninitialised value(s)
==15418==    at 0x59AB4BF: KURL::url(int, int) const (kurl.cpp:1466)
==15418==    by 0xA176239: LinkChecker::checkRef() (linkchecker.cpp:472)
==15418==    by 0xA176357: LinkChecker::check() (linkchecker.cpp:74)
==15418==    by 0xA17E4F7: SearchManager::checkLinksSimultaneously(std::vector<LinkStatus*, std::allocator<LinkStatus*> > const&) (searchmanager.cpp:515)
==15418==    by 0xA17E555: SearchManager::checkVectorLinks(std::vector<LinkStatus*, std::allocator<LinkStatus*> > const&) (searchmanager.cpp:439)
==15418==    by 0xA17DDC9: SearchManager::continueSearch() (searchmanager.cpp:392)
==15418==    by 0xA17E1A4: SearchManager::slotLinkChecked(LinkStatus const*, LinkChecker*) (searchmanager.cpp:541)
==15418==    by 0xA17EBAF: SearchManager::qt_invoke(int, QUObject*) (searchmanager.moc:205)
==15418==    by 0x6622B37: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib64/libqt-mt.so.3.3.5)
==15418==    by 0xA175901: LinkChecker::transactionFinished(LinkStatus const*, LinkChecker*) (linkchecker.moc:130)
==15418==    by 0xA175A62: LinkChecker::finnish() (linkchecker.cpp:420)
==15418==    by 0xA1768C4: LinkChecker::slotData(KIO::Job*, QMemArray<char> const&) (linkchecker.cpp:211)
==15418==
==15418== Use of uninitialised value of size 8
==15418==    at 0x68A1D93: QString::QString(QString const&) (in /usr/lib/qt3/lib64/libqt-mt.so.3.3.5)
==15418==    by 0x59AB4E8: KURL::url(int, int) const (kurl.cpp:1474)
==15418==    by 0xA176239: LinkChecker::checkRef() (linkchecker.cpp:472)
==15418==    by 0xA176357: LinkChecker::check() (linkchecker.cpp:74)
==15418==    by 0xA17E4F7: SearchManager::checkLinksSimultaneously(std::vector<LinkStatus*, std::allocator<LinkStatus*> > const&) (searchmanager.cpp:515)
==15418==    by 0xA17E555: SearchManager::checkVectorLinks(std::vector<LinkStatus*, std::allocator<LinkStatus*> > const&) (searchmanager.cpp:439)
==15418==    by 0xA17DDC9: SearchManager::continueSearch() (searchmanager.cpp:392)
==15418==    by 0xA17E1A4: SearchManager::slotLinkChecked(LinkStatus const*, LinkChecker*) (searchmanager.cpp:541)
==15418==    by 0xA17EBAF: SearchManager::qt_invoke(int, QUObject*) (searchmanager.moc:205)
==15418==    by 0x6622B37: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib64/libqt-mt.so.3.3.5)
==15418==    by 0xA175901: LinkChecker::transactionFinished(LinkStatus const*, LinkChecker*) (linkchecker.moc:130)
==15418==    by 0xA175A62: LinkChecker::finnish() (linkchecker.cpp:420)
==15418==
==15418== Invalid read of size 4
==15418==    at 0x68A1D93: QString::QString(QString const&) (in /usr/lib/qt3/lib64/libqt-mt.so.3.3.5)
==15418==    by 0x59AB4E8: KURL::url(int, int) const (kurl.cpp:1474)
==15418==    by 0xA176239: LinkChecker::checkRef() (linkchecker.cpp:472)
==15418==    by 0xA176357: LinkChecker::check() (linkchecker.cpp:74)
==15418==    by 0xA17E4F7: SearchManager::checkLinksSimultaneously(std::vector<LinkStatus*, std::allocator<LinkStatus*> > const&) (searchmanager.cpp:515)
==15418==    by 0xA17E555: SearchManager::checkVectorLinks(std::vector<LinkStatus*, std::allocator<LinkStatus*> > const&) (searchmanager.cpp:439)
==15418==    by 0xA17DDC9: SearchManager::continueSearch() (searchmanager.cpp:392)
==15418==    by 0xA17E1A4: SearchManager::slotLinkChecked(LinkStatus const*, LinkChecker*) (searchmanager.cpp:541)
==15418==    by 0xA17EBAF: SearchManager::qt_invoke(int, QUObject*) (searchmanager.moc:205)
==15418==    by 0x6622B37: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib64/libqt-mt.so.3.3.5)
==15418==    by 0xA175901: LinkChecker::transactionFinished(LinkStatus const*, LinkChecker*) (linkchecker.moc:130)
==15418==    by 0xA175A62: LinkChecker::finnish() (linkchecker.cpp:420)
==15418==  Address 0x1103 is not stack'd, malloc'd or (recently) free'd
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = klinkstatus path = <unknown> pid = 15418


All of those come to line 472 of linkchecker.cpp, which reads:
KURL url (url.url().left(i_ref));
this is wrong, as it should be
KURL url = KURL::fromPathOrURL(url.url().left(i_ref));

but the bug is not this, but the "url.url()" call. So somehow url is corrupted. Possible problems:

1) The  linkStatus() is invalid or some of its members are uninitialized.
2) linkStatus()->absoluteUrl() returns a reference to a KURL which was set via a reference passing. If the original URL does not exists or something similar, this results in the bug.

You know your code better, so now it is up to you to fix. ;-)

Andras
--
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

_______________________________________________
quanta-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/quanta-devel
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBD6b/eTQdfac6L/08RAtbqAJ9NcEhs/M8WosSPPqW3yR/hLGp3PACghCn0
0McFG8O7Uu9zr3AuD4u9kwg=
=B3Qq
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.