Moving/Deleting files crashes Deluged

General support for problems installing or using Deluge
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Moving/Deleting files crashes Deluged

Post by Spadge »

Hi all.

I've picked up a new problem somewhere along the line, possibly during my upgrade to FreeBSD9. Or maybe it's the clearing out of gtk dependencies since switching over to an install from ports rather than building my own Deluge from Git.

Whenever files are moved by Deluge on completion to another dir specified in a label, or when files are deleted from within Deluge, it crashes and I have to restart the daemon. Weirdest thing is that files moving from Downloading location to default Completed location do not have this effect.

Any pointers on what could cause this? And how to fix it?

FreeBSD 9.0-RELEASE #0
libtorrent-rasterbar-0.15.9
py27-libtorrent-rasterbar-0.15.9
deluge-1.3.3,1

Thanks for any help.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Moving/Deleting files crashes Deluged

Post by Cas »

Hard crashes like that are potentially libtorrent related. Do you have an errors in logs? If you can repeat, it would best to get a backtrace.
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Re: Moving/Deleting files crashes Deluged

Post by Spadge »

Sorry for the delay getting back - I've been trying to catch it crashing .

There is nothing in the logs, and I turned on the full debug mode too.

The only thing I can see going on is a message coming up on the cmd line saying "Fatal Python error: PyEval_RestoreThread: NULL tstate" as it crashed just now.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Moving/Deleting files crashes Deluged

Post by Cas »

Just to clarify is it deluge-gtk crashing or deluged?

You will need to run which ever one is crashing in gdb and get a backtrace .
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Re: Moving/Deleting files crashes Deluged

Post by Spadge »

It's deluged crashing, running headless in FreeBSD9, installed from ports.

I'm almost prepared to put money on it being the unchecked "Enable GUI and gtk dep (GUI files always installed)" option that's doing it. Probably cos of some gnome filesystem doohickey.
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Re: Moving/Deleting files crashes Deluged

Post by Spadge »

I've not had a chance to run deluged in gdb yet - learning curve climbing required and I've just been too busy with real life to think about starting to work out how to do it.

One thing I have noticed is that when a torrent completes and the label rules move it out to another dir, the torrent goes into ERROR mode and says it can't find the file it just moved. It's still looking in the uncompleted download folder.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Moving/Deleting files crashes Deluged

Post by Cas »

Spadge wrote:I've not had a chance to run deluged in gdb yet
Its actually quite straightforward to run deluged in gdb:.

Code: Select all

gdb --args python /usr/bin/deluged -d
(gdb) run
#After crash
(gdb) bt
Spadge wrote: One thing I have noticed is that when a torrent completes and the label rules move it out to another dir, the torrent goes into ERROR mode and says it can't find the file it just moved. It's still looking in the uncompleted download folder.
That's weird.
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Re: Moving/Deleting files crashes Deluged

Post by Spadge »

After much battling with gdb and python, I've finally managed to get deluged to run in gdb.

Easiest way?

$ service deluged start
$ gdb python `cat /var/run/deluged/pid`
(gdb) c

Now I just need to wait for it to crash with the usual "Fatal Python error: PyEval_RestoreThread: NULL tstate"
I bet the problem is in here
I bet the problem is in here
Python27_Config.jpg (51.04 KiB) Viewed 7816 times
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Re: Moving/Deleting files crashes Deluged

Post by Spadge »

And finally, the moment you have all been waiting for ...

Code: Select all

(gdb) c
Continuing.
Fatal Python error: PyEval_RestoreThread: NULL tstate

Program received signal SIGABRT, Aborted.
[Switching to Thread 2d007400 (LWP 102317/python2.7)]
0x000000002cbf034c in thr_kill () from /lib/libc.so.7
(gdb) bt
#0  0x000000002cbf034c in thr_kill () from /lib/libc.so.7
#1  0x000000002cc894cc in abort () from /lib/libc.so.7
#2  0x000000000049f01e in Py_FatalError ()
#3  0x000000000047aee9 in PyEval_RestoreThread ()
#4  0x0000000032e3def8 in allow_threading<libtorrent::big_number (libtorrent::torrent_handle::*)() const, libtorrent::big_number>::operator()<libtorrent::torrent_handle> () from /usr/local/lib/python2.7/site-packages/libtorrent.so
#5  0x0000000032e3dd03 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<allow_threading<libtorrent::big_number (libtorrent::torrent_handle::*)() const, libtorrent::big_number>, boost::python::default_call_policies, boost::mpl::vector2<libtorrent::big_number, libtorrent::torrent_handle&> > >::operator() () from /usr/local/lib/python2.7/site-packages/libtorrent.so
#6  0x0000000033e8ad3b in boost::python::objects::function::call ()
   from /usr/local/lib/libboost_python.so
#7  0x0000000033e8cffa in boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke ()
   from /usr/local/lib/libboost_python.so
#8  0x0000000033e930de in boost::function0<void>::operator() ()
   from /usr/local/lib/libboost_python.so
#9  0x0000000033e92e65 in boost::python::handle_exception_impl ()
   from /usr/local/lib/libboost_python.so
#10 0x0000000033e8ccaf in function_call ()
   from /usr/local/lib/libboost_python.so
#11 0x000000000041d4f9 in PyObject_Call ()
#12 0x000000000047e03c in PyEval_EvalFrameEx ()
#13 0x000000000047b9a1 in PyEval_EvalCodeEx ()
#14 0x00000000004d4fdb in PyFunction_SetClosure ()
#15 0x000000000041d4f9 in PyObject_Call ()
#16 0x000000000048010a in PyEval_EvalFrameEx ()
#17 0x0000000000482552 in _PyEval_SliceIndex ()
#18 0x000000000047de28 in PyEval_EvalFrameEx ()
#19 0x0000000000482552 in _PyEval_SliceIndex ()
#20 0x000000000047de28 in PyEval_EvalFrameEx ()
#21 0x000000000047b9a1 in PyEval_EvalCodeEx ()
#22 0x00000000004825c8 in _PyEval_SliceIndex ()
#23 0x000000000047de28 in PyEval_EvalFrameEx ()
#24 0x000000000047b9a1 in PyEval_EvalCodeEx ()
#25 0x00000000004d4fdb in PyFunction_SetClosure ()
#26 0x000000000041d4f9 in PyObject_Call ()
---Type <return> to continue, or q <return> to quit---
#27 0x0000000000420be3 in PyMethod_New ()
#28 0x000000000041d4f9 in PyObject_Call ()
#29 0x000000000045dda6 in _PyObject_SlotCompare ()
#30 0x0000000000455e54 in _PyType_Lookup ()
#31 0x000000000041d4f9 in PyObject_Call ()
#32 0x000000000047e03c in PyEval_EvalFrameEx ()
#33 0x000000000047b9a1 in PyEval_EvalCodeEx ()
#34 0x00000000004825c8 in _PyEval_SliceIndex ()
#35 0x000000000047de28 in PyEval_EvalFrameEx ()
#36 0x000000000047b9a1 in PyEval_EvalCodeEx ()
#37 0x000000000047b1b6 in PyEval_EvalCode ()
#38 0x000000000049fe9e in PyRun_FileExFlags ()
#39 0x000000000049f8a0 in PyRun_SimpleFileExFlags ()
#40 0x000000000041490f in Py_Main ()
#41 0x0000000000413e6f in main ()
(gdb) 
Thanks
Spadge
Seeder
Seeder
Posts: 111
Joined: Sat Dec 13, 2008 4:17 pm

Re: Moving/Deleting files crashes Deluged

Post by Spadge »

Also, last bits from the deluged server logs:

Code: Select all

[ERROR   ] 19:01:01 rpcserver:303 Exception calling RPC request: '[i]lengthy hash[/i]'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/deluge-1.3.4-py2.7.egg/deluge/core/rpcserver.py", line 298, in dispatch
    ret = self.factory.methods[method](*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/deluge-1.3.4-py2.7.egg/deluge/core/core.py", line 435, in get_torrents_status
    status_dict[torrent_id] = self.get_torrent_status(torrent_id, keys, diff)
  File "/usr/local/lib/python2.7/site-packages/deluge-1.3.4-py2.7.egg/deluge/core/core.py", line 417, in get_torrent_status
    status = self.torrentmanager[torrent_id].get_status(keys, diff)
  File "/usr/local/lib/python2.7/site-packages/deluge-1.3.4-py2.7.egg/deluge/core/torrentmanager.py", line 277, in __getitem__
    return self.torrents[torrent_id]
KeyError: '[i]same lengthy hash as above[/i]'
Post Reply