Summary: | Ktorrent 2.2.1 Crash on exit Sig 11 | ||
---|---|---|---|
Product: | [Applications] ktorrent | Reporter: | John Aylward <johnjaylward> |
Component: | general | Assignee: | Joris Guisson <joris.guisson> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | berg.foss, rasasi78 |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
John Aylward
2007-07-24 04:55:11 UTC
I am able to load and unload the plugins fine withing ktorrent. I tested each of the plugins I had loaded, and the one that segfaults on exit is the UPnP one. It's probably related to the fix to close the ports on the router. Can't reproduce it, can you compile with debug enabled (./configure --enable-debug=full) ? The backtrace is with debug full enabled. is there another tool I can use to get you more information other than the one built into KDE? I found some info on using gdb here are the results: (the "Program exited normally." message was passed just after ktorrent stared up, not on shutdown) gdb `which ktorrent` GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu"... (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /usr/bin/ktorrent (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) ---Type <return> to continue, or q <return> to quit--- (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread 47119247346224 (LWP 18084)] kbuildsycoca running... kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] Program exited normally. (gdb) kdevelop (core): [virtual void DDockWindow::removeWidget(QWidget*)] kdevelop (core): [virtual void DDockWindow::removeWidget(QWidget*)] kdevelop (core): [virtual void DDockWindow::removeWidget(QWidget*)] kdevelop (core): [virtual void DDockWindow::removeWidget(QWidget*)] kdevelop (core): [virtual void DDockWindow::removeWidget(QWidget*)] ICE default IO error handler doing an exit(), pid = 18100, errno = 0 oops, I didn't run it with the UPnP plugin installed, sorry about that, here is the result with the plugin running on exit gdb `which ktorrent` GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu"... (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run --nofork Starting program: /usr/bin/ktorrent --nofork (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) ---Type <return> to continue, or q <return> to quit--- (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread 47020804188720 (LWP 18115)] kbuildsycoca running... kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] kdevelop (core): [virtual void DDockWindow::addWidget(const QString&, QWidget*, bool)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 47020804188720 (LWP 18115)] 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00002ac3ddb64a4d in kt::PluginManager::unloadAll () from /usr/lib64/libktorrent-2.2.1.so #2 0x00000000004640a8 in ?? () #3 0x00002ac3de64836d in KMainWindow::shuttingDown () from /usr/kde/3.5/lib64/libkdeui.so.4 #4 0x00002ac3de77722d in KMainWindow::qt_invoke () from /usr/kde/3.5/lib64/libkdeui.so.4 #5 0x00002ac3ddf0093e in KParts::MainWindow::qt_invoke () from /usr/kde/3.5/lib64/libkparts.so.2 #6 0x00000000004788ad in ?? () #7 0x00000000004684f1 in ?? () #8 0x00002ac3dfa0d5bc in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #9 0x00002ac3dfa0e263 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #10 0x00002ac3dec57eb2 in KApplication::qt_emit () from /usr/kde/3.5/lib64/libkdecore.so.4 #11 0x00002ac3dec57ed9 in KUniqueApplication::qt_emit () from /usr/kde/3.5/lib64/libkdecore.so.4 #12 0x0000000000462d39 in ?? () #13 0x00002ac3dfa0d573 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #14 0x00002ac3dfa0e263 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #15 0x00002ac3df9cb772 in QEventLoop::enterLoop () from /usr/qt/3/lib64/libqt-mt.so.3 #16 0x00002ac3df9cb5a2 in QEventLoop::exec () from /usr/qt/3/lib64/libqt-mt.so.3 #17 0x00000000004632e2 in ?? () #18 0x00002ac3e2329374 in __libc_start_main () from /lib/libc.so.6 #19 0x000000000042eb59 in ?? () #20 0x00007fffcd147f78 in ?? () #21 0x0000000000000000 in ?? () here is my configure line (from the gentoo package): ./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-knetwork --with-x --enable-mitshm --with-xinerama --with-qt-dir=/usr/qt/3 --enable-mt --with-qt-libraries=/usr/qt/3/lib64 --disable-dependency-tracking --enable-debug=full --with-debug --enable-final --with-arts --enable-libsuffix=64 --with-extra-includes=/usr/kde/3.5/include --with-extra-libs=/usr/kde/3.5/lib64 --libdir=/usr/lib64 --build=x86_64-pc-linux-gnu Could you add --enable-debug=full to those options, with this we actually get the file and line where this crash is. it's already there, that's why I'm not sure what you mean it's right after --disable-dependency-tracking and before --with-debug --enable-final Not --with-debug, but --enable-debug=full See also http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports So are you saying I should have then --enable-debug=full and NOT have the --with-debug? does the --with-debug flag change how the --enable-debug=full flag works? If you actually look at the configure line I provided you'll see that both are present. If that's a problem then let me know, but I don't see how it is. Either way I'm not getting lines numbers. just for fun, here's an example of one of the ktorrent files being compiled: /bin/sh ../../libtool --silent --tag=CXX --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../apps/ktorrent -I./../../libktorrent -I/usr/kde/3.5/include -I/usr/qt/3/include -I. -I/usr/kde/3.5/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -fno-builtin -g3 -fno-inline -march=athlon64 -O1 -pipe -msse3 -ggdb -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -fexceptions -c -o ktpartfileimportplugin_la.all_cpp.lo ktpartfileimportplugin_la.all_cpp.cpp All the debugging options are there (-g3 and -ggdb) OK, the problem was that Gentoo was stripping the libs, I found a doc on how to disable that, and now here is a proper backtrace :) Using host libthread_db library "/lib/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread 47373883050544 (LWP 3649)] [KCrash handler] #5 0x0000000000000000 in ?? () #6 0x00002b1612da6b66 in kt::PluginManager::unloadAll (this=0x9c0360, save=false) at pluginmanager.cpp:184 #7 0x0000000000466063 in KTorrentCore::onExit (this=0x9bedf0) at ktorrentcore.cpp:603 #8 0x0000000000469100 in KTorrent::queryExit (this=0x739cc0) at ktorrent.cpp:587 #9 0x00002b161388636d in KMainWindow::shuttingDown () from /usr/kde/3.5/lib64/libkdeui.so.4 #10 0x00002b16139b522d in KMainWindow::qt_invoke () from /usr/kde/3.5/lib64/libkdeui.so.4 #11 0x00002b161313e93e in KParts::MainWindow::qt_invoke () from /usr/kde/3.5/lib64/libkparts.so.2 #12 0x000000000047cd3b in DMainWindow::qt_invoke (this=0x739cc0, _id=71, _o=0x7fff97f07710) at dmainwindow.moc:138 #13 0x000000000046e012 in KTorrent::qt_invoke (this=0x739cc0, _id=71, _o=0x7fff97f07710) at ktorrent.moc:220 #14 0x00002b1614c4b5bc in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #15 0x00002b1614c4c263 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #16 0x00002b1613e95eb2 in KApplication::qt_emit () from /usr/kde/3.5/lib64/libkdecore.so.4 #17 0x00002b1613e95ed9 in KUniqueApplication::qt_emit () from /usr/kde/3.5/lib64/libkdecore.so.4 #18 0x0000000000467cab in KTorrentApp::qt_emit (this=0xb48100, _id=0, _o=0x51) at ktorrentapp.moc:82 #19 0x00002b1614c4b573 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #20 0x00002b1614c4c263 in QObject::activate_signal () from /usr/qt/3/lib64/libqt-mt.so.3 #21 0x00002b1614c09772 in QEventLoop::enterLoop () from /usr/qt/3/lib64/libqt-mt.so.3 #22 0x00002b1614c095a2 in QEventLoop::exec () from /usr/qt/3/lib64/libqt-mt.so.3 #23 0x00000000004682dd in main (argc=7, argv=0x7fff97f07b98) at main.cpp:179 That's interesting, it crashes when we delete the WaitJob. SVN commit 692284 by guisson: Fix crash at exit caused by deleting a WaitJob, which was already deleted by itself. BUG: 148155 M +0 -2 apps/ktorrent/ktorrentcore.cpp M +6 -2 libktorrent/pluginmanager.cpp --- branches/extragear/kde3/network/ktorrent/apps/ktorrent/ktorrentcore.cpp #692283:692284 @@ -593,9 +593,7 @@ qman->onExit(job); // wait for completion of stopped events if (job->needToWait()) - { WaitJob::execute(job); - } else delete job; --- branches/extragear/kde3/network/ktorrent/libktorrent/pluginmanager.cpp #692283:692284 @@ -125,12 +125,14 @@ p->shutdown(wjob); if (wjob->needToWait()) bt::WaitJob::execute(wjob); + else + delete wjob; } catch (Error & err) { Out(SYS_GEN|LOG_NOTICE) << "Error when unloading plugin: " << err.toString() << endl; } - delete wjob; + gui->removePluginGui(p); p->unload(); @@ -174,14 +176,16 @@ p->shutdown(wjob); i++; } + if (wjob->needToWait()) bt::WaitJob::execute(wjob); + else + delete wjob; } catch (Error & err) { Out(SYS_GEN|LOG_NOTICE) << "Error when unloading all plugins: " << err.toString() << endl; } - delete wjob; // then unload them bt::PtrMap<QString,Plugin>::iterator i = plugins.begin(); Wouldn't the proper way to handle the delete to do it in the function that called the new, instead of in the execute method? I haven't done c++ work in a long time, but I thought a function isn't supposed to delete something it didn't create. KIO::Job's call deleteLater in their emitResult function, when the WaitJob is executed emitResult will get called, so there is no need to delete it manually. When the WaitJob is not executed we must delete it, because we never get to emitResult so the job does not commit suicide. Wether or not this is proper, is a different debate, but that is the way KIO::Job's work. *** Bug 148345 has been marked as a duplicate of this bug. *** *** Bug 148662 has been marked as a duplicate of this bug. *** |