Bug 317009 - Ktorrent corrupts its torrent data then crashes on start
Summary: Ktorrent corrupts its torrent data then crashes on start
Status: RESOLVED NOT A BUG
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: 4.1.3
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-19 07:39 UTC by rifter0x0000
Modified: 2013-04-18 17:06 UTC (History)
0 users

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 rifter0x0000 2013-03-19 07:39:34 UTC
Application: ktorrent (4.1.3)
KDE Platform Version: 4.8.5 (4.8.5)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-38-generic x86_64
Distribution: Ubuntu 12.04.2 LTS

-- Information about the crash:
- What I was doing when the application crashed:
Started ktorrent

- Custom settings of the application:

I can supply ~/.kde/share/config/ktorrentrc or whatever settings file is proper

-- System info:
rifter@leviathan:~$ ktorrent -v
Qt: 4.8.1
KDE Development Platform: 4.8.5 (4.8.5)
KTorrent: 4.1.3
rifter@leviathan:~$ uname -a
Linux leviathan 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
rifter@leviathan:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
rifter@leviathan:~$ 

--More full description
Apparently sometimes ktorrent corrupts the data in ~/.kde/share/apps/ktorrent/tor{somenumber] .  When this happens, the next time ktorrent is loaded it will crash. The only prescription I have ever found is to just delete/move that entire directory tree and start over from scratch with no memory of past torrents, which is  a big blunt instrument.
This has happened several times over the course of my use of ktorrent.  The last time, it had gotten really bad about not shutting down properly on its own. I'd shut it down, the gui would disappear, but ktorrent would still be running unless I killed it.  One day I rebooted without having gone through this process and when I came back ktorrent crashed like this.  I had a LOT of torrents in there, too.
But I moved the directory and started over. There are no instructions for reimporting from before, there is no suggested for figuring out one file that is wrong, just "move ~/.kde/share/apps/ktorrent and restart."
I consider it a bug that ktorrent crashes when it encounters bad data there, that it puts bad data tehre, and that it doesn't have more verbose output that would at least tell you what dirrectory under there broke things.  
This time, I had not been having that problem - ktorrent had been closing pretty normally. Then one day I closed ktorrent because it was eating up a bunch of swap, and when I reopened it it crashed. I can attach the log but there doesn't seem to be anything helpful in there.
When I start over I have to go back and look at my incomplete folder and try and  figure out what .torrent file corresponds to them so I can at least get those back in.  I guess if they were from magnet links there would not be any solution at all except to hope to remember where those were.
There may  have been another bug report for this, but I could not find one for sure. BUG#306876 looked similar but it was marked as a duplicate of a bug that did not say anything about ktorrent at all. This is, however, a very common problem and it would be nice not to ahve to start all over every time, or get better information about why these crashes happen.

The crash can be reproduced every time.

-- Backtrace:
Application: KTorrent (ktorrent), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f44c2256780 (LWP 10141))]

Thread 5 (Thread 0x7f44acdfc700 (LWP 10143)):
#0  __pthread_mutex_lock (mutex=0x7f44a0000a60) at pthread_mutex_lock.c:64
#1  0x00007f44b9cc35a1 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f44b9c87851 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f44b9c87f5b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f44b9c88164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f44bfa67426 in QEventDispatcherGlib::processEvents (this=0x7f44a00008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007f44bfa36c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007f44bfa36ed7 in QEventLoop::exec (this=0x7f44acdfbe00, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007f44bf935fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#9  0x00007f44bf938fcb in QThreadPrivate::start (arg=0x1539c80) at thread/qthread_unix.cpp:298
#10 0x00007f44bb4d9e9a in start_thread (arg=0x7f44acdfc700) at pthread_create.c:308
#11 0x00007f44be111cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f44a7fff700 (LWP 10144)):
#0  0x00007f44be106303 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f44c1d611aa in net::Poll::poll (this=0x7f44a7ffecd0, timeout=<optimized out>) at ../../src/net/poll.cpp:99
#2  0x00007f44c1dc393b in dht::RPCServer::Private::run (this=0x1548a30) at ../../src/dht/rpcserver.cpp:95
#3  0x00007f44bf938fcb in QThreadPrivate::start (arg=0x1548a30) at thread/qthread_unix.cpp:298
#4  0x00007f44bb4d9e9a in start_thread (arg=0x7f44a7fff700) at pthread_create.c:308
#5  0x00007f44be111cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f44ad5fd700 (LWP 10145)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f449b613dec in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x00007f449b613f19 in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x00007f44bb4d9e9a in start_thread (arg=0x7f44ad5fd700) at pthread_create.c:308
#4  0x00007f44be111cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f4499672700 (LWP 10146)):
#0  0x00007f44be106303 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f44b9c88036 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f44b9c88164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f44bfa67426 in QEventDispatcherGlib::processEvents (this=0x7f44a8002800, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f44bfa36c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f44bfa36ed7 in QEventLoop::exec (this=0x7f4499671e00, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f44bf935fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f44bf938fcb in QThreadPrivate::start (arg=0x1440050) at thread/qthread_unix.cpp:298
#8  0x00007f44bb4d9e9a in start_thread (arg=0x7f4499672700) at pthread_create.c:308
#9  0x00007f44be111cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f44c2256780 (LWP 10141)):
[KCrash Handler]
#6  0x00007f44be054425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f44be057b8b in __GI_abort () at abort.c:91
#8  0x00007f44be09239e in __libc_message (do_abort=2, fmt=0x7f44be199e3f "*** %s ***: %s terminated\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:201
#9  0x00007f44be128807 in __GI___fortify_fail (msg=0x7f44be199dd6 "buffer overflow detected") at fortify_fail.c:32
#10 0x00007f44be127700 in __GI___chk_fail () at chk_fail.c:29
#11 0x00007f44be1287be in __fdelt_chk (d=<optimized out>) at fdelt_chk.c:26
#12 0x00007f44c0beb13a in QNativeSocketEnginePrivate::nativeSelect (this=0x7ad2170, timeout=-1, checkRead=<optimized out>, checkWrite=<optimized out>, selectForRead=0x7fff003e10ae, selectForWrite=0x7fff003e10af) at socket/qnativesocketengine_unix.cpp:1103
#13 0x00007f44c0be91f8 in QNativeSocketEngine::waitForReadOrWrite (this=0x6caa9a0, readyToRead=0x7fff003e10ae, readyToWrite=0x7fff003e10af, checkRead=true, checkWrite=<optimized out>, msecs=-1, timedOut=0x0) at socket/qnativesocketengine.cpp:1000
#14 0x00007f44c0be0b1f in QAbstractSocket::waitForBytesWritten (this=0x6d2d4e0, msecs=-1) at socket/qabstractsocket.cpp:1949
#15 0x00007f44c0f1be12 in KIO::SocketConnectionBackend::sendCommand (this=0x6738970, task=...) at ../../kio/kio/connection.cpp:298
#16 0x00007f44c0f1d1ef in sendnow (data=..., _cmd=85, this=0x6d39300) at ../../kio/kio/connection.cpp:509
#17 KIO::Connection::sendnow (this=0x6d39300, _cmd=85, data=...) at ../../kio/kio/connection.cpp:497
#18 0x00007f44c0f1e5a6 in dequeue (this=<optimized out>) at ../../kio/kio/connection.cpp:78
#19 KIO::ConnectionPrivate::dequeue (this=0x7485ea0) at ../../kio/kio/connection.cpp:71
#20 0x00007f44c0febd44 in KIO::Slave::accept (this=0x6d3a7f0) at ../../kio/kio/slave.cpp:116
#21 0x00007f44bfa4c281 in QMetaObject::activate (sender=0x6d38f10, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3547
#22 0x00007f44bfa4c281 in QMetaObject::activate (sender=0x7485240, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3547
#23 0x00007f44bfa4c281 in QMetaObject::activate (sender=0x6cae990, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3547
#24 0x00007f44bff4419a in KLocalSocketServer::incomingConnection (this=0x6cae990, descriptor=1151) at ../../kdecore/network/klocalsocket.cpp:212
#25 0x00007f44bffb624b in KLocalSocketServerPrivate::processSocketActivity (this=0x74863e0) at ../../kdecore/network/klocalsocket_unix.cpp:394
#26 0x00007f44bfa4c281 in QMetaObject::activate (sender=0x74857b0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff003e16e0) at kernel/qobject.cpp:3547
#27 0x00007f44bfa992fe in QSocketNotifier::activated (this=<optimized out>, _t1=1144) at .moc/release-shared/moc_qsocketnotifier.cpp:103
#28 0x00007f44bfa5560b in QSocketNotifier::event (this=0x74857b0, e=0x7fff003e1d30) at kernel/qsocketnotifier.cpp:317
#29 0x00007f44bedba894 in notify_helper (e=0x7fff003e1d30, receiver=0x74857b0, this=0x1449450) at kernel/qapplication.cpp:4559
#30 QApplicationPrivate::notify_helper (this=0x1449450, receiver=0x74857b0, e=0x7fff003e1d30) at kernel/qapplication.cpp:4531
#31 0x00007f44bedbf713 in QApplication::notify (this=0x7fff003e1fb0, receiver=0x74857b0, e=0x7fff003e1d30) at kernel/qapplication.cpp:4420
#32 0x0000000000439a21 in kt::App::notify (this=<optimized out>, receiver=<optimized out>, event=<optimized out>) at ../../ktorrent/app.cpp:99
#33 0x00007f44bfa37e9c in QCoreApplication::notifyInternal (this=0x7fff003e1fb0, receiver=0x74857b0, event=0x7fff003e1d30) at kernel/qcoreapplication.cpp:876
#34 0x00007f44bfa66a97 in sendEvent (event=0x7fff003e1d30, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#35 socketNotifierSourceDispatch (source=0x1426c70) at kernel/qeventdispatcher_glib.cpp:110
#36 0x00007f44b9c87d53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007f44b9c880a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007f44b9c88164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007f44bfa673bf in QEventDispatcherGlib::processEvents (this=0x13f2b30, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#40 0x00007f44bee62d5e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#41 0x00007f44bfa36c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#42 0x00007f44bfa36ed7 in QEventLoop::exec (this=0x7fff003e1f40, flags=...) at kernel/qeventloop.cpp:204
#43 0x00007f44bfa3bf67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#44 0x0000000000428452 in main (argc=1, argv=0x7fff003e2e28) at ../../ktorrent/main.cpp:177

This bug may be a duplicate of or related to bug 306876.

Possible duplicates by query: bug 315658, bug 315194, bug 314085, bug 313361, bug 311748.

Reported using DrKonqi
Comment 1 Joris Guisson 2013-04-18 17:06:21 UTC
Do not increase the maximum amount of open filedescriptors beyond the default value of 1024, Qt cannot handle this.