crashes when removing torrent permantely

Bug #291414 reported by Reptile
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qBittorrent
Fix Released
Medium
Christophe Dumez

Bug Description

Often when deleting a torrent with the "permanent" option, the program will crash and disappear.

Using a fresh install of Ubuntu Intrepid.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I tried to reproduce this bug but I couldn't. I permanently deleted several torrent (finished and unfinished). It did not crash.

It may be caused by the torrents themselves. Could you please provide me with a torrent that makes qBT crash?
Other solution is that it is a compilation problem (Are you using my packages or compiling yourself?)

Changed in qbittorrent:
assignee: nobody → hydr0g3n
status: New → Incomplete
Revision history for this message
Reptile (achapman) wrote :

I used the 64bit package created by the people at getdeb.net.

The crashing is random,. sometimes it's fine and sometimes it's not. I would say 1 in 3 or 1 in 4 attempts at deleting permanently result in the client poofing out.

I can try and compile it myself and report back again.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

This would be great. Simply do not forget to enable debug before compiling (by setting DEBUG=1 instead of DEBUG=0 in src/src.pro).

Revision history for this message
Reptile (achapman) wrote :

ok, compiled the latest source and it still crashes. Crashes every 3rd or 4th torrent.

Removing this on hard drive: /media/02-media/01-downloads//xxxxxx Log
deleteThread called
torrent is not in download list, nothing to delete
We have 18 children
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/01.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/02.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/03.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/04.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/05.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/06.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/07.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/08.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/09.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/10.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/11.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/12.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/13.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/14.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/15.flac
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/F.log
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/F.m3u
We have 0 children
trying to remove file: /media/02-media/01-downloads//xxxxxx Log/F.cue
trying to remove directory: /media/02-media/01-downloads//xxxxxx Log
subDeleteThread successfuly deleted
QThread: Destroyed while thread is still running
Segmentation fault

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Good :)

Could you please do the following?

$ sudo apt-get install gdb
$ gdb src/qbittorrent (adapt path if necessary)
$ gdb> run

then make qbittorrent crash. Once it crashes, type the following:

$ gdb> bt 25

And provide me with the output. Please :)

This will make sure I find the exact location of the problem. thanks in advance.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I have an idea that may fix it. Could you try to uncomment:
// wait();

in src/deleteThread.h:45 ?

Then recompile and test.

Revision history for this message
Reptile (achapman) wrote :

Yeah I think this might have fixed it. I've deleted a bunch now and no poof-outs :D

I'll get back with the debug log if it crashes again.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Ok. I'm marking it as fixed. Do not hesitate to reopen the bug report if you experience it again.

Thanks a lot for reporting this. Too bad nobody reported it before final though.

Changed in qbittorrent:
status: Incomplete → Fix Committed
Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I'm applying the patch to Ubuntu package too. I asked debian maintainer to do the same.

Changed in qbittorrent:
milestone: none → 1.2.1
Revision history for this message
Langsdorf (hendrikrohn) wrote :

same for me here (ubuntu 8.10, qbittorrent 1.2.4.0.rc4, ubuntu/debian package):
permanent delete sometimes crashes qbittorent after deleting

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

v1.2.1 was just released.

Changed in qbittorrent:
importance: Undecided → Medium
status: Fix Committed → Fix Released
Revision history for this message
Francois Thunus (thunus) wrote :

I'm afraid the bug seems to still exist. I'm using 1.3.3 vanilla debian squeeze package from debian repository, and experienced the same problem.
What I did:
1) use the search to locate various torrent
2) add to download list
3) verify torrent properties
4) after downloading enough to assess the file, stop torrent and remove permanently from disk

If you repeat the operation several times (in quite rapid, admittedly, succession), qbt crashes.
Since some torrent descriptions are not clear, I do this often to locate _the_ torrent that will yield what I want, and I have experienced the problem 5 times so far.
Cheers

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Could you please tun qbittorrent in a term and paste the output when it crashes ?

Revision history for this message
Francois Thunus (thunus) wrote : Re: [Bug 291414] Re: crashes when removing torrent permantely

On Sun, 24 May 2009, Christophe Dumez wrote:

> Could you please tun qbittorrent in a term and paste the output when it
> crashes ?
ok. will do and try to crash it again :-)

----

Today's quote:

A verdade é só uma mentira inverídica...

Revision history for this message
Francois Thunus (thunus) wrote :

On Sun, 24 May 2009, Christophe Dumez wrote:

> Could you please tun qbittorrent in a term and paste the output when it
> crashes ?

galileo:~$ qbittorrent
terminate called after throwing an instance of
'libtorrent::invalid_handle'
   what(): invalid torrent handle used
Abandon
galileo:~$

----

Today's quote:

I still maintain the point that designing a monolithic kernel in 1991 is a
fundamental error. Be thankful you are not my student. You would not get a
high grade for such a design :-)
   -- Andrew Tanenbaum to Linus Torvalds

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I see, I will have to catch this exception.

Changed in qbittorrent:
status: Fix Released → New
Revision history for this message
Langsdorf (hendrikrohn) wrote :

just for information: after the fix it worked and still works for me without any crashes, also for deleting multiple files
ubuntu 8.04, 8.10 and 9.04, acer-laptop

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

François Thunus > Are you still able to reproduce this?

If so, could you please follow the gdb steps I posted above to tell me where exactly it crashes? I cannot find where I does not check for invalid torrents.

Changed in qbittorrent:
milestone: 1.2.1 → none
status: New → Incomplete
Revision history for this message
Francois Thunus (thunus) wrote :

I'll re-check with gdb, but it happened again yesterday with 1.4.0
Cheers

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Francois> Could you make sure you use latest libtorrent-rasterbar (v0.14.5) and it would also help if you could use a more recent qbittorrent (v1.5.1 preferrably).

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I see in your previous comment that you experienced invalid_handle problems. I worked on this in v1.5.x so it is likely that it is fixed but I'm waiting on your confirmation though.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Francois> Are you using Ubuntu Jaunty v9.04? If so, I have just built up-to-date packages on my PPA:

https://launchpad.net/~hydr0g3n/+archive/ppa

Revision history for this message
Francois Thunus (thunus) wrote :

Chris, I'm using Debian Squeeze (unstable). Today the same thing happened again: erase several torrents permanently quickly (5 in all), and qb crashes. I'm using 1.5.1 direct from the Squeeze repository.
However, congratulation, the search sort is way faster :-)
sorry for the bad news. Will try to reproduce again under gdb or at least from terminal.
Cheers

Revision history for this message
Francois Thunus (thunus) wrote :

one more precision: the scenario is always the same: I select several torrent from search, start downloading one, preview from another terminal, pause torrent, erase permanently. so the torrent has no more than a couple of megs, just what I need to identify the file. The crash occurs after 5-6 deletion in rapid sequence.
Cheers

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Ok, I found the problem. I have a possible race condition when you pause then delete the torrent very quickly. I will fix it in svn. In the meantime, don't pause it and delete it directly :) Thanks a lot for the report.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Ok. This is fixed in SVN.

Changed in qbittorrent:
milestone: none → 1.5.3
status: Incomplete → Fix Committed
Revision history for this message
TBerk (bayareaberk-yahoo) wrote :

I just stopped a completed torrent (it was uploading at the time) and this caused qBt to crash (close). Upon restarting I find the completed file gone from the list and also deleted from the 'temp' directory.

I am using qBittorrent 1.5.2, newly installed after removing all previous versions.
OS = Ubunto Studio 9.04.

berk

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

When you say "stopped", you mean "paused" or "deleted"?

I have just tried to pause a seeding torrent and I did not experience any crash. No problem either with deleting a seeding torrent. Could you help me reproduce the problem?

Changed in qbittorrent:
status: Fix Committed → Fix Released
Revision history for this message
Francois Thunus (thunus) wrote :

Just happened again. Still exists in 1.5.2 under Debian Squeeze
Cheers

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Well, this was fixed in v1.5.3, not v1.5.2. So I'm not suprised :p

Revision history for this message
Alienation (miguel-andrade) wrote :

It is happening in v1.5.6. It happened to me twice, but I'm not shure what caused:

$ qbittorrent
terminate called after throwing an instance of 'libtorrent::invalid_handle'
  what(): invalid torrent handle used

For a quickfix, delete ~.config/qBittorrent/qBittorrent-resume.conf

At least you can have the program running again without loosing your settings.

Miguel

Changed in qbittorrent:
status: Fix Released → Incomplete
Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

If you can reproduce the crash in gdb and send me the backtrace, I'm confident I can fix it. Would it be possible for you?

Changed in qbittorrent:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.