This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[git] ktorrent locking up multiple times a day

Tags: None
(comma "," separated)
imported4-Tomasu
Registered Member
Posts
302
Karma
0
Hi, been noticing this for some time, and its just been getting worse, but ktorrent is locking up solid. I grabbed a full backtrace:

Code: Select all
(gdb) thread apply all bt

Thread 9 (Thread 0x7f8ef10be700 (LWP 21530)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f8f01764563 in QMutexPrivate::wait (this=0x7f8eec1344a0, timeout=-1) at thread/qmutex_unix.cpp:84
#2  0x00007f8f0175fe05 in QMutex::lock (this=0x7f8eec10fd40) at thread/qmutex.cpp:205
#3  0x00007f8f03da9ce1 in relock (this=0x7f8eec10fcf0) at /usr/include/qt4/QtCore/qmutex.h:120
#4  QMutexLocker (this=0x7f8eec10fcf0) at /usr/include/qt4/QtCore/qmutex.h:102
#5  utp::Connection::close (this=0x7f8eec10fcf0) at /home/moose/build/ktorrent-git/libktorrent/src/utp/connection.cpp:579
#6  0x00007f8f03daf865 in utp::OutputQueue::send (this=0x19d39b8, sock=0x1b05dd0) at /home/moose/build/ktorrent-git/libktorrent/src/utp/outputqueue.cpp:68
#7  0x00007f8f03ce1913 in net::ServerSocket::qt_metacall (this=0x1b05dd0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7f8ef10bd560)
    at /home/moose/build/ktorrent-git/libktorrent/build/src/moc_serversocket.cpp:77
#8  0x00007f8f018672e6 in QMetaObject::activate (sender=0x1b04780, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff)
    at kernel/qobject.cpp:3295
#9  0x00007f8f018b3e5e in QSocketNotifier::activated (this=0x7f8eec1344ec, _t1=20) at .moc/release-shared/moc_qsocketnotifier.cpp:89
#10 0x00007f8f0186e143 in QSocketNotifier::event (this=0x1b04780, e=0x7f8ef10bdbf0) at kernel/qsocketnotifier.cpp:317
#11 0x00007f8f0097b32c in QApplicationPrivate::notify_helper (this=0x19c5dd0, receiver=0x1b04780, e=0x7f8ef10bdbf0) at kernel/qapplication.cpp:4302
#12 0x00007f8f0098180b in QApplication::notify (this=0x7fffd1e270a0, receiver=0x1b04780, e=0x7f8ef10bdbf0) at kernel/qapplication.cpp:4185
#13 0x000000000043c6ba in kt::App::notify (this=0x7f8eec1344ec, receiver=0x80, event=0x1) at /home/moose/build/ktorrent-git/ktorrent/ktorrent/app.cpp:97
#14 0x00007f8f0185409c in QCoreApplication::notifyInternal (this=0x7fffd1e270a0, receiver=0x1b04780, event=0x7f8ef10bdbf0) at kernel/qcoreapplication.cpp:726
#15 0x00007f8f0187da6a in sendEvent (source=0x19c8780) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#16 socketNotifierSourceDispatch (source=0x19c8780) at kernel/qeventdispatcher_glib.cpp:110
#17 0x00007f8efc1866f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#18 0x00007f8efc18a568 in ?? () from /lib/libglib-2.0.so.0
#19 0x00007f8efc18a71c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#20 0x00007f8f0187d6b3 in QEventDispatcherGlib::processEvents (this=0x1aff6f0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#21 0x00007f8f018529c2 in QEventLoop::processEvents (this=<value optimized out>, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece.
) at kernel/qeventloop.cpp:149
#22 0x00007f8f01852d9c in QEventLoop::exec (this=0x7f8ef10bde20, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece.
) at kernel/qeventloop.cpp:201
#23 0x00007f8f0176277b in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:487
#24 0x00007f8f01764e15 in QThreadPrivate::start (arg=0x1b033a0) at thread/qthread_unix.cpp:248
#25 0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#26 0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#27 0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7f8ef18bf700 (LWP 21531)):
#0  0x00007f8effd3a113 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=500) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8f03cffe3c in net::Poll::poll (this=0x7f8ef18bed80, timeout=<value optimized out>) at /home/moose/build/ktorrent-git/libktorrent/src/net/poll.cpp:99
#2  0x00007f8f03d696c3 in dht::RPCServer::Private::run (this=0x1b17b90) at /home/moose/build/ktorrent-git/libktorrent/src/dht/rpcserver.cpp:95
#3  0x00007f8f01764e15 in QThreadPrivate::start (arg=0x1b17b90) at thread/qthread_unix.cpp:248
#4  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f8edef9c700 (LWP 21541)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:211
---Type <return> to continue, or q <return> to quit---
#1  0x00007f8ee37b3f41 in ?? () from /usr/lib/libxine.so.1
#2  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#3  0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f8edf79d700 (LWP 21542)):
#0  0x00007f8effd3a113 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8efc18a2c9 in ?? () from /lib/libglib-2.0.so.0
#2  0x00007f8efc18a71c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#3  0x00007f8f0187d6b3 in QEventDispatcherGlib::processEvents (this=0x8f9d3b0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#4  0x00007f8f018529c2 in QEventLoop::processEvents (this=<value optimized out>, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece.
) at kernel/qeventloop.cpp:149
#5  0x00007f8f01852d9c in QEventLoop::exec (this=0x7f8edf79cdc0, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece.
) at kernel/qeventloop.cpp:201
#6  0x00007f8f0176277b in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:487
#7  0x00007f8ee3a10400 in ?? () from /usr/lib/qt4/plugins/phonon_backend/phonon_xine.so
#8  0x00007f8f01764e15 in QThreadPrivate::start (arg=0x8f1a290) at thread/qthread_unix.cpp:248
#9  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#10 0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f8edcaba700 (LWP 21546)):
#0  0x00007f8effd3a113 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=333) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8edc0b58d5 in ?? () from /usr/lib/xine/plugins/1.29/xineplug_ao_out_alsa.so
#2  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#3  0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f8edc0b0700 (LWP 21547)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f8ee37c4aab in ?? () from /usr/lib/libxine.so.1
#2  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#3  0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f8ed8ead700 (LWP 21571)):
#0  0x00007f8effd3a113 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8f03cffe3c in net::Poll::poll (this=0x8d0d7e0, timeout=<value optimized out>) at /home/moose/build/ktorrent-git/libktorrent/src/net/poll.cpp:99
#2  0x00007f8f03cfbce0 in net::DownloadThread::waitForSocketReady (this=0x8d0d7d0) at /home/moose/build/ktorrent-git/libktorrent/src/net/downloadthread.cpp:128
#3  0x00007f8f03cfbdb6 in net::DownloadThread::update (this=0x7f8ed4001ba0) at /home/moose/build/ktorrent-git/libktorrent/src/net/downloadthread.cpp:48
#4  0x00007f8f03cfc899 in net::NetworkThread::run (this=0x8d0d7d0) at /home/moose/build/ktorrent-git/libktorrent/src/net/networkthread.cpp:48
#5  0x00007f8f01764e15 in QThreadPrivate::start (arg=0x8d0d7d0) at thread/qthread_unix.cpp:248
#6  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#7  0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

---Type <return> to continue, or q <return> to quit---
Thread 2 (Thread 0x7f8ed3fff700 (LWP 21572)):
#0  0x00007f8effd3a113 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8f03cffe3c in net::Poll::poll (this=0x8d0de60, timeout=<value optimized out>) at /home/moose/build/ktorrent-git/libktorrent/src/net/poll.cpp:99
#2  0x00007f8f03cfb386 in net::UploadThread::waitForSocketsReady (this=0x8d0de50) at /home/moose/build/ktorrent-git/libktorrent/src/net/uploadthread.cpp:129
#3  0x00007f8f03cfb466 in net::UploadThread::update (this=0x7f8ed4000ae0) at /home/moose/build/ktorrent-git/libktorrent/src/net/uploadthread.cpp:45
#4  0x00007f8f03cfc899 in net::NetworkThread::run (this=0x8d0de50) at /home/moose/build/ktorrent-git/libktorrent/src/net/networkthread.cpp:48
#5  0x00007f8f01764e15 in QThreadPrivate::start (arg=0x8d0de50) at thread/qthread_unix.cpp:248
#6  0x00007f8efce6c8ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#7  0x00007f8effd4502d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f8f04219760 (LWP 21526)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f8f01764563 in QMutexPrivate::wait (this=0x19d2fe0, timeout=-1) at thread/qmutex_unix.cpp:84
#2  0x00007f8f0175fde5 in QMutex::lock (this=0x19d39c8) at thread/qmutex.cpp:167
#3  0x00007f8f03dafd99 in relock (this=0x19d39b8, data=<value optimized out>, conn=<value optimized out>) at /usr/include/qt4/QtCore/qmutex.h:120
#4  QMutexLocker (this=0x19d39b8, data=<value optimized out>, conn=<value optimized out>) at /usr/include/qt4/QtCore/qmutex.h:102
#5  utp::OutputQueue::add (this=0x19d39b8, data=<value optimized out>, conn=<value optimized out>) at /home/moose/build/ktorrent-git/libktorrent/src/utp/outputqueue.cpp:40
#6  0x00007f8f03da3c06 in utp::UTPServer::sendTo (this=0x1b04410, conn=<value optimized out>, data=...) at /home/moose/build/ktorrent-git/libktorrent/src/utp/utpserver.cpp:380
#7  0x00007f8f03da9814 in utp::Connection::sendPacket (this=0x7f8eec10fcf0, type=<value optimized out>, p_ack_nr=<value optimized out>)
    at /home/moose/build/ktorrent-git/libktorrent/src/utp/connection.cpp:346
#8  0x00007f8f03da9c35 in utp::Connection::sendPackets (this=0x7f8eec10fcf0) at /home/moose/build/ktorrent-git/libktorrent/src/utp/connection.cpp:454
#9  0x00007f8f03da9d09 in utp::Connection::close (this=0x7f8eec10fcf0) at /home/moose/build/ktorrent-git/libktorrent/src/utp/connection.cpp:584
#10 0x00007f8f03dad252 in utp::UTPSocket::close (this=0x7f8eec14e7d0) at /home/moose/build/ktorrent-git/libktorrent/src/utp/utpsocket.cpp:68
#11 0x00007f8f03dad3dc in utp::UTPSocket::~UTPSocket (this=0x19d302c, __in_chrg=<value optimized out>) at /home/moose/build/ktorrent-git/libktorrent/src/utp/utpsocket.cpp:47
#12 0x00007f8f03cf723d in net::BufferedSocket::~BufferedSocket (this=0x7f8eec132640, __in_chrg=<value optimized out>)
    at /home/moose/build/ktorrent-git/libktorrent/src/net/bufferedsocket.cpp:65
#13 0x00007f8f03d0245c in mse::StreamSocket::~StreamSocket (this=0x7f8eec002c40, __in_chrg=<value optimized out>)
    at /home/moose/build/ktorrent-git/libktorrent/src/mse/streamsocket.cpp:85
#14 0x00007f8f03da65e8 in internalDestroy (this=<value optimized out>, data=0x7f8eec14e770) at /usr/include/qt4/QtCore/qsharedpointer_impl.h:391
#15 deref (this=<value optimized out>, data=0x7f8eec14e770) at /usr/include/qt4/QtCore/qsharedpointer_impl.h:329
#16 ~ExternalRefCount (this=<value optimized out>, data=0x7f8eec14e770) at /usr/include/qt4/QtCore/qsharedpointer_impl.h:380
#17 ~QSharedPointer (this=<value optimized out>, data=0x7f8eec14e770) at /usr/include/qt4/QtCore/qsharedpointer_impl.h:441
#18 node_destruct (this=<value optimized out>, data=0x7f8eec14e770) at /usr/include/qt4/QtCore/qlist.h:402
#19 QList<QSharedPointer<mse::StreamSocket> >::free (this=<value optimized out>, data=0x7f8eec14e770) at /usr/include/qt4/QtCore/qlist.h:646
#20 0x00007f8f03da1a9c in utp::UTPServer::handlePendingConnections (this=0x1b04410) at /home/moose/build/ktorrent-git/libktorrent/src/utp/utpserver.cpp:251
#21 0x00007f8f03ce1060 in utp::MainThreadCall::qt_metacall (this=0x1b04100, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=<value optimized out>)
    at /home/moose/build/ktorrent-git/libktorrent/build/src/moc_utpserver_p.cpp:72
#22 0x00007f8f01863e29 in QObject::event (this=0x1b04100, e=0x7f8eec002fe0) at kernel/qobject.cpp:1248
#23 0x00007f8f0097b32c in QApplicationPrivate::notify_helper (this=0x19c5dd0, receiver=0x1b04100, e=0x7f8eec002fe0) at kernel/qapplication.cpp:4302
#24 0x00007f8f0098180b in QApplication::notify (this=0x7fffd1e270a0, receiver=0x1b04100, e=0x7f8eec002fe0) at kernel/qapplication.cpp:4185
#25 0x000000000043c6ba in kt::App::notify (this=0x19d302c, receiver=0x80, event=0x1) at /home/moose/build/ktorrent-git/ktorrent/ktorrent/app.cpp:97
#26 0x00007f8f0185409c in QCoreApplication::notifyInternal (this=0x7fffd1e270a0, receiver=0x1b04100, event=0x7f8eec002fe0) at kernel/qcoreapplication.cpp:726
#27 0x00007f8f01857744 in sendEvent (receiver=0x0, event_type=<value optimized out>, data=0x1996ae0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
---Type <return> to continue, or q <return> to quit---
#28 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0x1996ae0) at kernel/qcoreapplication.cpp:1367
#29 0x00007f8f0187db73 in sendPostedEvents (s=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#30 postEventSourceDispatch (s=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:276
#31 0x00007f8efc1866f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#32 0x00007f8efc18a568 in ?? () from /lib/libglib-2.0.so.0
#33 0x00007f8efc18a71c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#34 0x00007f8f0187d6b3 in QEventDispatcherGlib::processEvents (this=0x1996200, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#35 0x00007f8f00a2b19e in QGuiEventDispatcherGlib::processEvents (this=0x19d302c, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#36 0x00007f8f018529c2 in QEventLoop::processEvents (this=<value optimized out>, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece.
) at kernel/qeventloop.cpp:149
#37 0x00007f8f01852d9c in QEventLoop::exec (this=0x7fffd1e27010, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece.
) at kernel/qeventloop.cpp:201
#38 0x00007f8f01857a2b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1003
#39 0x000000000042bc9b in main (argc=<value optimized out>, argv=<value optimized out>) at /home/moose/build/ktorrent-git/ktorrent/ktorrent/main.cpp:177


This is with git from last night.
George
Moderator
Posts
5421
Karma
1
Ah yes:

thread 1 locks
mutex A
mutex B

thread 2 locks
mutex B
mutex A

Bad timing, and you have a deadlock.

Will see if I can fix it.
imported4-Tomasu
Registered Member
Posts
302
Karma
0
George wrote:Ah yes:

thread 1 locks
mutex A
mutex B

thread 2 locks
mutex B
mutex A

Bad timing, and you have a deadlock.

Will see if I can fix it.

Thanks :)
George
Moderator
Posts
5421
Karma
1
Fix has been committed


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Google [Bot], Sogou [Bot]