Application: ktorrent (4.1.0) KDE Platform Version: 4.6.2 (4.6.2) Qt Version: 4.7.0 Operating System: Linux 2.6.35-28-generic i686 Distribution: Ubuntu 10.10 -- Information about the crash: - What I was doing when the application crashed: I had just finished downloading FreeBSD 8.2 iso images which downloaded flawlessly BTW (sha256 checksums fine). And I clicked quit under the File menu and it crashes with a seg fault. I did not get this version as an Ubuntu package, I compiled it from source, but there were no problems with the compile/install. The crash can be reproduced every time. -- Backtrace: Application: KTorrent (ktorrent), signal: Segmentation fault [Current thread is 1 (Thread 0xb77ce710 (LWP 23380))] Thread 3 (Thread 0xaecc9b70 (LWP 23390)): #0 0x00bd33f4 in __pthread_mutex_lock (mutex=0x88d377c) at pthread_mutex_lock.c:62 #1 0x036acf66 in pthread_mutex_lock (mutex=0x88d377c) at forward.c:182 #2 0x07df9ea3 in g_main_context_prepare () from /lib/libglib-2.0.so.0 #3 0x07dfa279 in ?? () from /lib/libglib-2.0.so.0 #4 0x07dfa848 in g_main_context_iteration () from /lib/libglib-2.0.so.0 #5 0x01acb59f in QEventDispatcherGlib::processEvents (this=0x86b7670, flags=...) at kernel/qeventdispatcher_glib.cpp:417 #6 0x01a9b609 in QEventLoop::processEvents (this=0xaecc9290, flags=) at kernel/qeventloop.cpp:149 #7 0x01a9ba8a in QEventLoop::exec (this=0xaecc9290, flags=...) at kernel/qeventloop.cpp:201 #8 0x01997b7e in QThread::exec (this=0x88c8c48) at thread/qthread.cpp:490 #9 0x01a7a35b in QInotifyFileSystemWatcherEngine::run (this=0x88c8c48) at io/qfilesystemwatcher_inotify.cpp:248 #10 0x0199adf9 in QThreadPrivate::start (arg=0x88c8c48) at thread/qthread_unix.cpp:266 #11 0x00bd0cc9 in start_thread (arg=0xaecc9b70) at pthread_create.c:304 #12 0x0369f69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 2 (Thread 0xae4c8b70 (LWP 23391)): #0 0x00bf1416 in __kernel_vsyscall () #1 0x00bd54dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169 #2 0x036acd9d in __pthread_cond_wait (cond=0x88d0f88, mutex=0x88d0f70) at forward.c:139 #3 0x0199b9c7 in wait (this=0x88d064c, mutex=0x88d0648, time=4294967295) at thread/qwaitcondition_unix.cpp:88 #4 QWaitCondition::wait (this=0x88d064c, mutex=0x88d0648, time=4294967295) at thread/qwaitcondition_unix.cpp:160 #5 0x0032ea12 in net::ReverseResolverThread::run (this=0x88d0640) at /home/rj45/Downloads/libktorrent-1.1.0/src/net/reverseresolver.cpp:123 #6 0x0199adf9 in QThreadPrivate::start (arg=0x88d0640) at thread/qthread_unix.cpp:266 #7 0x00bd0cc9 in start_thread (arg=0xae4c8b70) at pthread_create.c:304 #8 0x0369f69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 1 (Thread 0xb77ce710 (LWP 23380)): [KCrash Handler] #7 operator++ (this=0x811faf0, sock=0x86a12d8) at /usr/include/c++/4.4/bits/stl_list.h:223 #8 __distance<std::_List_const_iterator<net::BufferedSocket*> > (this=0x811faf0, sock=0x86a12d8) at /usr/include/c++/4.4/bits/stl_iterator_base_funcs.h:79 #9 distance<std::_List_const_iterator<net::BufferedSocket*> > (this=0x811faf0, sock=0x86a12d8) at /usr/include/c++/4.4/bits/stl_iterator_base_funcs.h:114 #10 size (this=0x811faf0, sock=0x86a12d8) at /usr/include/c++/4.4/bits/stl_list.h:805 #11 net::SocketMonitor::remove (this=0x811faf0, sock=0x86a12d8) at /home/rj45/Downloads/libktorrent-1.1.0/src/net/socketmonitor.cpp:170 #12 0x00331d6d in mse::StreamSocket::stopMonitoring (this=0x86e4158) at /home/rj45/Downloads/libktorrent-1.1.0/src/mse/streamsocket.cpp:114 #13 0x003406d6 in bt::Peer::~Peer (this=0x88cf438, __in_chrg=<value optimized out>) at /home/rj45/Downloads/libktorrent-1.1.0/src/peer/peer.cpp:115 #14 0x00342ac6 in qDeleteAll<QList<bt::Peer*>::const_iterator> (this=0x828fca8) at /usr/include/qt4/QtCore/qalgorithms.h:322 #15 qDeleteAll<QList<bt::Peer*> > (this=0x828fca8) at /usr/include/qt4/QtCore/qalgorithms.h:330 #16 bt::PeerManager::closeAllConnections (this=0x828fca8) at /home/rj45/Downloads/libktorrent-1.1.0/src/peer/peermanager.cpp:342 #17 0x00344b3f in bt::PeerManager::stop (this=0x828fca8) at /home/rj45/Downloads/libktorrent-1.1.0/src/peer/peermanager.cpp:437 #18 0x00381386 in bt::TorrentControl::stop (this=0x828f770, wjob=0x854a140) at /home/rj45/Downloads/libktorrent-1.1.0/src/torrent/torrentcontrol.cpp:499 #19 0x00f4951c in kt::QueueManager::stopSafely (this=0x8278db8, tc=0x828f770, wjob=0x854a140) at /home/rj45/Downloads/ktorrent-4.1.0/libktcore/torrent/queuemanager.cpp:747 #20 0x00f4a40b in kt::QueueManager::onExit (this=0x8278db8, wjob=0x854a140) at /home/rj45/Downloads/ktorrent-4.1.0/libktcore/torrent/queuemanager.cpp:424 #21 0x0806e85f in kt::Core::onExit (this=0x827b660) at /home/rj45/Downloads/ktorrent-4.1.0/ktorrent/core.cpp:912 #22 0x08076ba1 in kt::GUI::queryExit (this=0x8273b90) at /home/rj45/Downloads/ktorrent-4.1.0/ktorrent/gui.cpp:568 #23 0x012a3216 in KMainWindowPrivate::_k_shuttingDown (this=0x8285140) at ../../kdeui/widgets/kmainwindow.cpp:1142 #24 0x012a7ca6 in KMainWindow::qt_metacall (this=0x8273b90, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0xbfb4d5ac) at ./kmainwindow.moc:102 #25 0x012f052a in KXmlGuiWindow::qt_metacall (this=0x8273b90, _c=QMetaObject::InvokeMetaMethod, _id=38, _a=0xbfb4d5ac) at ./kxmlguiwindow.moc:102 #26 0x001355ca in KParts::MainWindow::qt_metacall (this=0x8273b90, _c=QMetaObject::InvokeMetaMethod, _id=38, _a=0xbfb4d5ac) at ./mainwindow.moc:75 #27 0x0807a0df in kt::GUI::qt_metacall (this=0x8273b90, _c=QMetaObject::InvokeMetaMethod, _id=38, _a=0xbfb4d5ac) at /home/rj45/Downloads/ktorrent-4.1.0/build/ktorrent/gui.moc:102 #28 0x01aa28ca in QMetaObject::metacall (object=0x8273b90, cl=QMetaObject::ReadProperty, idx=38, argv=0xbfb4d5ac) at kernel/qmetaobject.cpp:237 #29 0x01ab56ad in QMetaObject::activate (sender=0xbfb4d6a0, m=0x1bcf484, local_signal_index=0, argv=0x8be58955) at kernel/qobject.cpp:3280 #30 0x01b06c57 in QCoreApplication::aboutToQuit (this=0xbfb4d6a0) at .moc/release-shared/moc_qcoreapplication.cpp:131 #31 0x01aa0036 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1014 #32 0x05670e07 in QApplication::exec () at kernel/qapplication.cpp:3672 #33 0x08069011 in main (argc=1, argv=0xbfb4dad4) at /home/rj45/Downloads/ktorrent-4.1.0/ktorrent/main.cpp:177 Reported using DrKonqi
I also started a thread on ktorrent.org's developer forum about this bug here: http://ktorrent.org/forum/viewtopic.php?f=1&t=4044&p=20275#p20275
Cannot seem to reproduce. Could you run it under valgrind ? valgrind --log-file=vg.log --num-callers=50 /usr/bin/ktorrent --nofork When it crashes, post the vg.log file here.
Note that running under valgrind is slow.
$ cat vg.log ==23652== Memcheck, a memory error detector ==23652== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==23652== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==23652== Command: /usr/local/bin/ktorrent --nofork ==23652== Parent PID: 23568 ==23652== ==23652== Conditional jump or move depends on uninitialised value(s) ==23652== at 0x688D611: inflateReset2 (in /lib/libz.so.1.2.3.4) ==23652== by 0x688D6EC: inflateInit2_ (in /lib/libz.so.1.2.3.4) ==23652== by 0x688D762: inflateInit_ (in /lib/libz.so.1.2.3.4) ==23652== by 0x6B1DF13: png_create_read_struct_2 (in /lib/libpng12.so.0.44.0) ==23652== by 0x6B1E0F9: png_create_read_struct (in /lib/libpng12.so.0.44.0) ==23652== by 0x55E3A53: QPngHandlerPrivate::readPngHeader() (qpnghandler.cpp:356) ==23652== by 0x55E448A: QPngHandlerPrivate::readPngImage(QImage*) (qpnghandler.cpp:427) ==23652== by 0x55AC23B: QImageReader::read(QImage*) (qimagereader.cpp:1205) ==23652== by 0x55AC876: QImageReader::read() (qimagereader.cpp:1155) ==23652== by 0x559ADB0: operator>>(QDataStream&, QImage&) (qimage.cpp:5149) ==23652== by 0x55BDC93: operator>>(QDataStream&, QPixmap&) (qpixmap.cpp:1315) ==23652== by 0x4A3889F: KIconLoaderPrivate::findCachedPixmapWithPath(QString const&, QPixmap&, QString&) (kiconloader.cpp:884) ==23652== by 0x4A3FF5E: KIconLoader::loadIcon(QString const&, KIconLoader::Group, int, int, QStringList const&, QString*, bool) const (kiconloader.cpp:1231) ==23652== by 0x4A363F5: KIconEngine::pixmap(QSize const&, QIcon::Mode, QIcon::State) (kiconengine.cpp:93) ==23652== by 0x5585625: QIcon::pixmap(QSize const&, QIcon::Mode, QIcon::State) const (qicon.cpp:676) ==23652== by 0x556FAB2: QWidgetPrivate::setWindowIcon_sys(bool) (qwidget_x11.cpp:1460) ==23652== by 0x551F278: QWidget::event(QEvent*) (qwidget.cpp:8288) ==23652== by 0x54C0FDB: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4396) ==23652== by 0x54C70E8: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4361) ==23652== by 0x4A9B829: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:311) ==23652== by 0x51E5B3A: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:732) ==23652== by 0x54C12A3: QApplication::setWindowIcon(QIcon const&) (qcoreapplication.h:215) ==23652== by 0x4A9D41F: KApplicationPrivate::parseCommandLine() (kapplication.cpp:839) ==23652== by 0x4A9DE73: KApplicationPrivate::init(bool) (kapplication.cpp:475) ==23652== by 0x4A9EDAA: KApplication::KApplication(bool, KComponentData const&) (kapplication.cpp:387) ==23652== by 0x4AA571D: KUniqueApplication::KUniqueApplication(bool, bool) (kuniqueapplication.cpp:310) ==23652== by 0x807A6F1: kt::App::App() (app.cpp:42) ==23652== by 0x8068FFF: main (main.cpp:175) ==23652== ==23652== Use of uninitialised value of size 4 ==23652== at 0x50DE4C9: QMutex::lock() (qmutex.cpp:151) ==23652== by 0x408AB2C: net::SocketMonitor::add(net::BufferedSocket*) (qmutex.h:102) ==23652== by 0x4093FD6: mse::StreamSocket::startMonitoring(net::SocketReader*, net::SocketWriter*) (streamsocket.cpp:94) ==23652== by 0x40A0CFD: bt::Peer::Peer(QSharedPointer<mse::StreamSocket>, bt::PeerID const&, unsigned int, unsigned int, unsigned int, bool, bt::PeerManager*) (peer.cpp:95) ==23652== by 0x40A684C: bt::PeerManager::Private::createPeer(QSharedPointer<mse::StreamSocket>, bt::PeerID const&, unsigned int, bool) (peermanager.cpp:782) ==23652== by 0x40A8069: bt::PeerManager::peerAuthenticated(bt::Authenticate*, QWeakPointer<bt::PeerConnector>, bool) (peermanager.cpp:294) ==23652== by 0x40B1E47: bt::PeerConnector::Private::authenticationFinished(bt::Authenticate*, bool) (peerconnector.cpp:138) ==23652== by 0x40B240E: bt::PeerConnector::authenticationFinished(bt::Authenticate*, bool) (peerconnector.cpp:123) ==23652== by 0x4098A14: bt::Authenticate::onFinish(bool) (authenticate.cpp:170) ==23652== by 0x4098357: bt::Authenticate::handshakeReceived(bool) (authenticate.cpp:206) ==23652== by 0x4097596: bt::AuthenticateBase::onReadyRead() (authenticatebase.cpp:143) ==23652== by 0x409800E: bt::Authenticate::onReadyRead() (authenticate.cpp:145) ==23652== by 0x409AC07: bt::AuthenticationMonitor::handleData() (authenticationmonitor.cpp:136) ==23652== by 0x409ADCA: bt::AuthenticationMonitor::update() (authenticationmonitor.cpp:111) ==23652== by 0x806B390: kt::Core::update() (core.cpp:1043) ==23652== by 0x8073F40: kt::Core::qt_metacall(QMetaObject::Call, int, void**) (core.moc:164) ==23652== by 0x51EB8C9: QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) (qmetaobject.cpp:237) ==23652== by 0x51FE6AC: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3280) ==23652== by 0x52501E6: QTimer::timeout() (moc_qtimer.cpp:134) ==23652== by 0x52041CD: QTimer::timerEvent(QTimerEvent*) (qtimer.cpp:271) ==23652== by 0x51F8503: QObject::event(QEvent*) (qobject.cpp:1183) ==23652== by 0x54C0FDB: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4396) ==23652== by 0x54C704D: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:3798) ==23652== by 0x807A4AB: kt::App::notify(QObject*, QEvent*) (app.cpp:97) ==23652== by 0x51E5B3A: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:732) ==23652== by 0x5217AD5: QTimerInfoList::activateTimers() (qcoreapplication.h:215) ==23652== by 0x5214873: timerSourceDispatch(_GSource*, int (*)(void*), void*) (qeventdispatcher_glib.cpp:184) ==23652== by 0x6A32854: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2600.1) ==23652== by 0x6A36667: ??? (in /lib/libglib-2.0.so.0.2600.1) ==23652== by 0x6A36847: g_main_context_iteration (in /lib/libglib-2.0.so.0.2600.1) ==23652== by 0x5214564: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (qeventdispatcher_glib.cpp:415) ==23652== by 0x5582BE4: QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (qguieventdispatcher_glib.cpp:204) ==23652== by 0x51E4608: QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (qeventloop.cpp:149) ==23652== by 0x51E4A89: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (qeventloop.cpp:201) ==23652== by 0x51E900E: QCoreApplication::exec() (qcoreapplication.cpp:1009) ==23652== by 0x54BFE06: QApplication::exec() (qapplication.cpp:3672) ==23652== by 0x8069010: main (main.cpp:177) ==23652== ==23652== Invalid read of size 1 ==23652== at 0x50DE4C9: QMutex::lock() (qmutex.cpp:151) ==23652== by 0x408AB2C: net::SocketMonitor::add(net::BufferedSocket*) (qmutex.h:102) ==23652== by 0x4093FD6: mse::StreamSocket::startMonitoring(net::SocketReader*, net::SocketWriter*) (streamsocket.cpp:94) ==23652== by 0x40A0CFD: bt::Peer::Peer(QSharedPointer<mse::StreamSocket>, bt::PeerID const&, unsigned int, unsigned int, unsigned int, bool, bt::PeerManager*) (peer.cpp:95) ==23652== by 0x40A684C: bt::PeerManager::Private::createPeer(QSharedPointer<mse::StreamSocket>, bt::PeerID const&, unsigned int, bool) (peermanager.cpp:782) ==23652== by 0x40A8069: bt::PeerManager::peerAuthenticated(bt::Authenticate*, QWeakPointer<bt::PeerConnector>, bool) (peermanager.cpp:294) ==23652== by 0x40B1E47: bt::PeerConnector::Private::authenticationFinished(bt::Authenticate*, bool) (peerconnector.cpp:138) ==23652== by 0x40B240E: bt::PeerConnector::authenticationFinished(bt::Authenticate*, bool) (peerconnector.cpp:123) ==23652== by 0x4098A14: bt::Authenticate::onFinish(bool) (authenticate.cpp:170) ==23652== by 0x4098357: bt::Authenticate::handshakeReceived(bool) (authenticate.cpp:206) ==23652== by 0x4097596: bt::AuthenticateBase::onReadyRead() (authenticatebase.cpp:143) ==23652== by 0x409800E: bt::Authenticate::onReadyRead() (authenticate.cpp:145) ==23652== by 0x409AC07: bt::AuthenticationMonitor::handleData() (authenticationmonitor.cpp:136) ==23652== by 0x409ADCA: bt::AuthenticationMonitor::update() (authenticationmonitor.cpp:111) ==23652== by 0x806B390: kt::Core::update() (core.cpp:1043) ==23652== by 0x8073F40: kt::Core::qt_metacall(QMetaObject::Call, int, void**) (core.moc:164) ==23652== by 0x51EB8C9: QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) (qmetaobject.cpp:237) ==23652== by 0x51FE6AC: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3280) ==23652== by 0x52501E6: QTimer::timeout() (moc_qtimer.cpp:134) ==23652== by 0x52041CD: QTimer::timerEvent(QTimerEvent*) (qtimer.cpp:271) ==23652== by 0x51F8503: QObject::event(QEvent*) (qobject.cpp:1183) ==23652== by 0x54C0FDB: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4396) ==23652== by 0x54C704D: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:3798) ==23652== by 0x807A4AB: kt::App::notify(QObject*, QEvent*) (app.cpp:97) ==23652== by 0x51E5B3A: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:732) ==23652== by 0x5217AD5: QTimerInfoList::activateTimers() (qcoreapplication.h:215) ==23652== by 0x5214873: timerSourceDispatch(_GSource*, int (*)(void*), void*) (qeventdispatcher_glib.cpp:184) ==23652== by 0x6A32854: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2600.1) ==23652== by 0x6A36667: ??? (in /lib/libglib-2.0.so.0.2600.1) ==23652== by 0x6A36847: g_main_context_iteration (in /lib/libglib-2.0.so.0.2600.1) ==23652== by 0x5214564: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (qeventdispatcher_glib.cpp:415) ==23652== by 0x5582BE4: QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (qguieventdispatcher_glib.cpp:204) ==23652== by 0x51E4608: QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (qeventloop.cpp:149) ==23652== by 0x51E4A89: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (qeventloop.cpp:201) ==23652== by 0x51E900E: QCoreApplication::exec() (qcoreapplication.cpp:1009) ==23652== by 0x54BFE06: QApplication::exec() (qapplication.cpp:3672) ==23652== by 0x8069010: main (main.cpp:177) ==23652== Address 0x1 is not stack'd, malloc'd or (recently) free'd ==23652== ==23652== ==23652== HEAP SUMMARY: ==23652== in use at exit: 6,075,061 bytes in 90,830 blocks ==23652== total heap usage: 442,262 allocs, 351,432 frees, 76,249,449 bytes allocated ==23652== ==23652== LEAK SUMMARY: ==23652== definitely lost: 45,217 bytes in 514 blocks ==23652== indirectly lost: 1,012,511 bytes in 3,578 blocks ==23652== possibly lost: 4,308,730 bytes in 73,769 blocks ==23652== still reachable: 708,603 bytes in 12,969 blocks ==23652== suppressed: 0 bytes in 0 blocks ==23652== Rerun with --leak-check=full to see details of leaked memory ==23652== ==23652== For counts of detected and suppressed errors, rerun with: -v ==23652== Use --track-origins=yes to see where uninitialised values come from ==23652== ERROR SUMMARY: 36 errors from 3 contexts (suppressed: 336 from 13)
Was this with a crash ?
Yes. It crashed and called DrKonqi to submit the crash report. That's where the backtrace above came from.
> I did not get this version as an Ubuntu package, I compiled it from source, but > there were no problems with the compile/install. Did you also compile and install libktorrent 1.1 ?
Yes, I compiled and installed libktorrent 1.1 first.
Is an older version of libktorrent still installed ?
Yes. I have the 1.0.5 libktorrent installed. It is the official ubuntu package, so it is not in /usr/local. When I compiled the new version of libktorrent and ktorrent itself I made sure the path setting was /usr/local when I ran cmake for both of them. That should prevent any confusion, correct?
Things could get hairy with the plugins. Try uninstalling libktorrent 1.0.5, and see what happens.
Looks like that fixes the problem.