Summary: | Ktorrent crashes and gives error SIGABRT at startup | ||
---|---|---|---|
Product: | [Applications] ktorrent | Reporter: | William Lee <sales> |
Component: | general | Assignee: | Joris Guisson <joris.guisson> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | erik.sohns |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
William Lee
2007-02-15 22:03:12 UTC
Version ? V 2.1. I read all the other similar (ktorrent+SIGABRT) postings and saw that many were resolved via newer versions. Thanks, by the way, for responding so quickly, it is appreciated! SVN commit 634518 by guisson: Make sure all exceptions are caught when a ChunkDownload is loaded from disk. This will prevent bug 141758 from happening. BUG: 141758 M +7 -2 chunkdownload.cpp M +1 -1 chunkdownload.h M +20 -4 downloader.cpp --- trunk/extragear/network/ktorrent/libktorrent/torrent/chunkdownload.cpp #634517:634518 @@ -374,9 +374,12 @@ } } - void ChunkDownload::load(File & file,ChunkDownloadHeader & hdr) + bool ChunkDownload::load(File & file,ChunkDownloadHeader & hdr) { // read pieces + if (hdr.num_bits == 0) + return false; + pieces = BitSet(hdr.num_bits); Array<Uint8> data(pieces.getNumBytes()); file.read(data,pieces.getNumBytes()); @@ -385,7 +388,8 @@ if (hdr.buffered) { // if it's a buffered chunk, load the data to - file.read(chunk->getData(),chunk->getSize()); + if (file.read(chunk->getData(),chunk->getSize()) != chunk->getSize()) + return false; } for (Uint32 i = 0;i < pieces.getNumBits();i++) @@ -393,6 +397,7 @@ piece_queue.remove(i); updateHash(); + return true; } Uint32 ChunkDownload::bytesDownloaded() const --- trunk/extragear/network/ktorrent/libktorrent/torrent/chunkdownload.h #634517:634518 @@ -135,7 +135,7 @@ * Load from a File * @param file The File */ - void load(File & file,ChunkDownloadHeader & hdr); + bool load(File & file,ChunkDownloadHeader & hdr); /** * Cancel all requests. --- trunk/extragear/network/ktorrent/libktorrent/torrent/downloader.cpp #634517:634518 @@ -540,11 +540,27 @@ { ChunkDownload* cd = new ChunkDownload(c); current_chunks.insert(hdr.index,cd); - cd->load(fptr,hdr); - downloaded += cd->bytesDownloaded(); + bool ret = false; + try + { + ret = cd->load(fptr,hdr); + } + catch (...) + { + ret = false; + } + + if (!ret) + { + delete cd; + } + else + { + downloaded += cd->bytesDownloaded(); - if (tmon) - tmon->downloadStarted(cd); + if (tmon) + tmon->downloadStarted(cd); + } } } *** Bug 139607 has been marked as a duplicate of this bug. *** +++Make sure all exceptions are caught when a ChunkDownload is loaded from disk. This will prevent bug 141758 from happening. +++ If that was for me, I don't understand it. I'll try...I didn't get any exceptions or anything other than a crash. If that was for me, would you be so kind as to dumb it down for a non-programmer? Could it be that one of the dependencies is corrupted? The only other thing that may be relevant is that I put Limewire on it, I downloaded the .rpm file and used alien to convert it to a .deb file then installed it. Again, thank you for your valuable time! It's fixed, if you really want to know what an exception is, then you should learn C++. I don't understand. If it is fixed, then why is it still crashing? What do I need to do to get my KTorrent to stop crashing? I uninstalled it from synaptic, reinstalled it, and still the same error? Help? And as far as me learning C++, I would really like to, but my contribution to the linux community is teaching Windows users how to replace their Microsoft OS. I tell them it is better supported... The fix will be included in our next release (2.1.1) |