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

ktorrent crashes soon after start [up to 563115]

Tags: None
(comma "," separated)
snap
Registered Member
Posts
20
Karma
0
Today, ktorrent suddenly started to crash with an older version [>=559475 don't know anymore] occasionally after I added a new torrent to the download list (was it the reason? i don't know, after i removed that torrent the problem wasn't gone). Another reason could be, that another torrent downloaded chunks from files i don't wanted (looks like that it downloaded chunks which are splitted between files, but no one of them were selected for download).

I decided to update to svn [563115] but the problem still exists.

Anyway, here is the backtrace with help of gdb:

Code: Select all
#0  0x00002af8d469756c in memcpy () from /lib/libc.so.6
#1  0x00002af8d04c0f71 in bt::PacketWriter::sendChunk () from /usr/kde/3.5/lib64/libktorrent.so.0
#2  0x00002af8d04bf4f3 in bt::PeerUploader::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#3  0x00002af8d04abf76 in bt::Uploader::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#4  0x00002af8d04b0475 in bt::TorrentControl::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#5  0x000000000042f5e9 in KTorrentCore::update (this=0x84a810) at ktorrentcore.cpp:465
#6  0x0000000000430730 in KTorrentCore::qt_invoke (this=0x84a810, _id=4, _o=0x7fffff9d6500)
    at ktorrentcore.moc:228
#7  0x00002af8d23c2cb9 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3
#8  0x00002af8d23c3434 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3
#9  0x00002af8d23e02e5 in QTimer::event () from /usr/qt/3/lib64/libqt-mt.so.3
#10 0x00002af8d2365add in QApplication::internalNotify () from /usr/qt/3/lib64/libqt-mt.so.3
#11 0x00002af8d2365e80 in QApplication::notify () from /usr/qt/3/lib64/libqt-mt.so.3
#12 0x00002af8d16c40da in KApplication::notify () from /usr/kde/3.5/lib64/libkdecore.so.4
#13 0x00002af8d235a234 in QEventLoop::activateTimers () from /usr/qt/3/lib64/libqt-mt.so.3
#14 0x00002af8d2317ba8 in QEventLoop::processEvents () from /usr/qt/3/lib64/libqt-mt.so.3
#15 0x00002af8d237a3a1 in QEventLoop::enterLoop () from /usr/qt/3/lib64/libqt-mt.so.3
#16 0x00002af8d237a2f5 in QEventLoop::exec () from /usr/qt/3/lib64/libqt-mt.so.3
#17 0x000000000041c78e in main (argc=3, argv=0x7fffff9d6d68) at main.cpp:115
George
Moderator
Posts
5421
Karma
1

Sun Jul 16, 2006 7:01 pm
This is upload related, I can see where it goes wrong, I'll build in a safety check (though that doesn't address the root cause, seeing that this shouldn't happen)

EDIT: now it shouldn't crash anymore, I will take a look at border chunks of 2 excluded files, and see how we handle these.
snap
Registered Member
Posts
20
Karma
0

Sun Jul 16, 2006 7:19 pm
it still shoots itself with the same(?) backtrace.

Code: Select all
#0  0x00002b109379f56c in memcpy () from /lib/libc.so.6
#1  0x00002b108f5c8f71 in bt::PacketWriter::sendChunk () from /usr/kde/3.5/lib64/libktorrent.so.0
#2  0x00002b108f5c74f3 in bt::PeerUploader::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#3  0x00002b108f5b3f76 in bt::Uploader::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#4  0x00002b108f5b8475 in bt::TorrentControl::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#5  0x000000000042f5e9 in KTorrentCore::update (this=0x84a730) at ktorrentcore.cpp:465
#6  0x0000000000430730 in KTorrentCore::qt_invoke (this=0x84a730, _id=4, _o=0x7fffffa19400)
    at ktorrentcore.moc:228
#7  0x00002b10914cacb9 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3
#8  0x00002b10914cb434 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3
#9  0x00002b10914e82e5 in QTimer::event () from /usr/qt/3/lib64/libqt-mt.so.3
#10 0x00002b109146dadd in QApplication::internalNotify () from /usr/qt/3/lib64/libqt-mt.so.3
#11 0x00002b109146de80 in QApplication::notify () from /usr/qt/3/lib64/libqt-mt.so.3
#12 0x00002b10907cc0da in KApplication::notify () from /usr/kde/3.5/lib64/libkdecore.so.4
#13 0x00002b1091462234 in QEventLoop::activateTimers () from /usr/qt/3/lib64/libqt-mt.so.3
#14 0x00002b109141fba8 in QEventLoop::processEvents () from /usr/qt/3/lib64/libqt-mt.so.3
#15 0x00002b10914823a1 in QEventLoop::enterLoop () from /usr/qt/3/lib64/libqt-mt.so.3
#16 0x00002b10914822f5 in QEventLoop::exec () from /usr/qt/3/lib64/libqt-mt.so.3
#17 0x000000000041c78e in main (argc=3, argv=0x7fffffa19c68) at main.cpp:115
George
Moderator
Posts
5421
Karma
1

Sun Jul 16, 2006 7:23 pm
OK, I think I fixed the root cause of the problem.
snap
Registered Member
Posts
20
Karma
0

Sun Jul 16, 2006 7:29 pm
somehow, the problem persists (same backtrace)
George
Moderator
Posts
5421
Karma
1

Sun Jul 16, 2006 7:37 pm
OK, can you recompile with debug enabled :

./configure --enable-debug=full

Then we can see some more info (the function arguments for memcpy would be interesting)

EDIT: don't forget to do a clean first and a make install
snap
Registered Member
Posts
20
Karma
0

Sun Jul 16, 2006 7:55 pm
Code: Select all
./configure --enable-debug=full --prefix=$KDEDIRS
make clean
make
root: make install
kbuildsycoca
gdb
(gdb) file /usr/bin/ktorrent
(gdb) run --debug --nofork
error
(gdb) backtrace
(gdb) backtrace full


but it does not show a backtrace with arguments, only "No symbol table info available."

somehow i got it wrong but don't know where

EDIT: here a plain memory output of the stack (hopefully, i forget always which registers are for what at the stack), if this helps:

Code: Select all
(gdb) x/128 0x7fffffb537d8
0x7fffffb537d8: 0x54f85f71      0x00002b87      0x00ca5710      0x00000000
0x7fffffb537e8: 0x584a8d2d      0x00002b87      0x0127aa70      0x00000000
0x7fffffb537f8: 0x01191710      0x00000000      0x01191720      0x00000000
0x7fffffb53808: 0x00cc3cf0      0x00000000      0xffb53870      0x00007fff
0x7fffffb53818: 0x00000000      0x00000000      0x01222850      0x00000000
0x7fffffb53828: 0x54f844f3      0x00002b87      0x0127aa30      0x00000000
0x7fffffb53838: 0x00000000      0x00002b87      0x0124e8c0      0x00000000
0x7fffffb53848: 0x00000000      0x00000000      0x00000000      0x00000000
0x7fffffb53858: 0x00000000      0x00000000      0x0127ab50      0x00000000
0x7fffffb53868: 0x00862730      0x00000000      0x550f8270      0x00002b87
0x7fffffb53878: 0x000016f5      0x00000000      0x00004000      0x00000064
0x7fffffb53888: 0x0124e8c0      0x00000000      0x00cc0010      0x00000000
0x7fffffb53898: 0x00d52d60      0x00000000      0x0000000b      0x00000000
0x7fffffb538a8: 0x0000003d      0x00000000      0xffb53a30      0x00007fff
0x7fffffb538b8: 0x00466050      0x00000000      0x00861688      0x00000000
0x7fffffb538c8: 0x54f70f76      0x00002b87      0x00000000      0x00000000
0x7fffffb538d8: 0x00ca5e00      0x00000000      0x00861688      0x00000000
0x7fffffb538e8: 0x54f75475      0x00002b87      0x011079e0      0x00000000
0x7fffffb538f8: 0x00858e10      0x00000000      0xffb53920      0x00007fff
0x7fffffb53908: 0x00438012      0x00000000      0x00862730      0x00000000
0x7fffffb53918: 0xffb53950      0x00007fff      0x00861688      0x00000000
0x7fffffb53928: 0x004352c3      0x00000000      0x00ca5e00      0x00000000
0x7fffffb53938: 0x00000000      0x00000000      0x00858e10      0x00000000
0x7fffffb53948: 0x00861620      0x00000000      0xffb539c0      0x00007fff
0x7fffffb53958: 0x004376e0      0x00000000      0x00863630      0x00000000
0x7fffffb53968: 0x006d48b0      0x00000002      0xffb539c0      0x00007fff
0x7fffffb53978: 0x00424e34      0x00000000      0x01250da0      0x00000000
0x7fffffb53988: 0x00000015      0x00000001      0xffb53a30      0x00007fff
0x7fffffb53998: 0xffb53a30      0x00007fff      0x006d3550      0x00000004
0x7fffffb539a8: 0x00861620      0x00000000      0x00862730      0x00000000
0x7fffffb539b8: 0x00861688      0x00000000      0x5744ef30      0x00002b87
0x7fffffb539c8: 0x56e87cb9      0x00002b87      0xffb53a60      0x00007fff


Edit2:

AMD Opteron in 64bit mode

Edit3:

hope that gathers all information:

Code: Select all
(gdb) bt
#0  0x00002b875915c56c in memcpy () from /lib/libc.so.6
#1  0x00002b8754f85f71 in bt::PacketWriter::sendChunk () from /usr/kde/3.5/lib64/libktorrent.so.0
#2  0x00002b8754f844f3 in bt::PeerUploader::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#3  0x00002b8754f70f76 in bt::Uploader::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#4  0x00002b8754f75475 in bt::TorrentControl::update () from /usr/kde/3.5/lib64/libktorrent.so.0
#5  0x00000000004352c3 in KTorrentCore::update (this=0x861620) at ktorrentcore.cpp:465
#6  0x00000000004376e0 in KTorrentCore::qt_invoke (this=0x861620, _id=4, _o=0x7fffffb53a30)
    at ktorrentcore.moc:228
#7  0x00002b8756e87cb9 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3
#8  0x00002b8756e88434 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3
#9  0x00002b8756ea52e5 in QTimer::event () from /usr/qt/3/lib64/libqt-mt.so.3
#10 0x00002b8756e2aadd in QApplication::internalNotify () from /usr/qt/3/lib64/libqt-mt.so.3
#11 0x00002b8756e2ae80 in QApplication::notify () from /usr/qt/3/lib64/libqt-mt.so.3
#12 0x00002b87561890da in KApplication::notify () from /usr/kde/3.5/lib64/libkdecore.so.4
#13 0x00002b8756e1f234 in QEventLoop::activateTimers () from /usr/qt/3/lib64/libqt-mt.so.3
#14 0x00002b8756ddcba8 in QEventLoop::processEvents () from /usr/qt/3/lib64/libqt-mt.so.3
#15 0x00002b8756e3f3a1 in QEventLoop::enterLoop () from /usr/qt/3/lib64/libqt-mt.so.3
#16 0x00002b8756e3f2f5 in QEventLoop::exec () from /usr/qt/3/lib64/libqt-mt.so.3
#17 0x000000000041e5ec in main (argc=3, argv=0x7fffffb542a8) at main.cpp:115
(gdb) info frame
Stack level 0, frame at 0x7fffffb537e0:
 rip = 0x2b875915c56c in memcpy; saved rip 0x2b8754f85f71
 called by frame at 0x7fffffb53830
 Arglist at 0x7fffffb537d0, args:
 Locals at 0x7fffffb537d0, Previous frame's sp is 0x7fffffb537e0
 Saved registers:
  rip at 0x7fffffb537d8
(gdb) x /16 $rsp
0x7fffffb537d8: 0x54f85f71      0x00002b87      0x00ca5710      0x00000000
0x7fffffb537e8: 0x584a8d2d      0x00002b87      0x0127aa70      0x00000000
0x7fffffb537f8: 0x01191710      0x00000000      0x01191720      0x00000000
0x7fffffb53808: 0x00cc3cf0      0x00000000      0xffb53870      0x00007fff
(gdb)
George
Moderator
Posts
5421
Karma
1

Mon Jul 17, 2006 8:19 am
I have made some other improvements, they should catch invalid stuff making it into memcpy.

Btw, seeing that there is no difference between the debug and release version backtraces, are you sure that you do not have 2 versions of KT installed. (maybe configure defaults to a different prefix then /usr on your system)
snap
Registered Member
Posts
20
Karma
0

Mon Jul 17, 2006 12:31 pm
there are a lot of possible reasons for that problem. One could be that my gdb is to old, another that i use for everything (except ktorrent svn) heavily optimizing flags, which can kill a lot of debug informations (i think use of registers instead of stack is one of them). I will try to update my gdb, check if the flags are really disabled for ktorrent svn and make a new build after killing everything which looks like ktorrent :D.

EDIT: killed 2 versions of ktorrent (but both were the same o.O') and made everything how said/told. At the moment it runs smooth. If it does not crash the next 20 minutes that problem should be gone.
snap
Registered Member
Posts
20
Karma
0

Mon Jul 17, 2006 4:29 pm
problem is gone. Is there something visible on the logviewer if the problem gets encountered?
George
Moderator
Posts
5421
Karma
1

Mon Jul 17, 2006 7:28 pm
snap wrote:problem is gone. Is there something visible on the logviewer if the problem gets encountered?


Something gets printed out, but it seems that in your case it was something like a mismatch between the ktorrent executable and libktorrent.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]