You are not logged in.

#1 2014-05-19 17:23:52

a821
Member
From: Berlin, Germany
Registered: 2012-10-31
Posts: 33

[SOLVED] rtorrent 0.9.4-1 writes wrong process name.

Hi,

I noticed that rtorrent 0.9.4-1 writes the wrong process name in /proc/<pid>/status. It writes "main" instead of "rtorrent". That means that when I use an utility such as pgrep to get the PID of rtorrent it fails.

$ ps ax | grep -v grep | grep rtorrent
23123 ?        Ss     0:04 tmux new -d -s rtorrent rtorrent
23124 pts/2    Ssl+   0:11 rtorrent
$ pgrep rtorrent
$

It should have shown 23124 (btw, I run rtorrent in a detached tmux session, running rtorrent in a terminal doesn't change anything). Here I see that pgrep works and if I used "main" as a pattern I get the expected PID.

$ pgrep tmux
23123
$ pgrep main
23124
$ head /proc/23124/status
Name:   main
State:  S (sleeping)
Tgid:   23124
Ngid:   0
Pid:    23124
PPid:   23123
TracerPid:      0
Uid:    1000    1000    1000    1000
Gid:    100     100     100     100
FDSize: 512
$ pacman -Q rtorrent libtorrent
rtorrent 0.9.4-1
libtorrent 0.13.4-1

If I downgrade rtorrent/libtorrent to 0.9.3-2/0.13.3-2 the problem dissapears and everything works as expected.It's not a big issue, but I needed to change one line in a script I use to check whether rtorrent is running and start it if not. Can somebody confirm this or what am I doing wrong?

Last edited by a821 (2014-06-30 07:47:42)


I'm too lazy to compose a signature

Offline

#2 2014-05-19 18:18:57

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,012

Re: [SOLVED] rtorrent 0.9.4-1 writes wrong process name.

Yes same happens here. pkill rtorrent does nothing but pkill main kills rtorrent.


You're just jealous because the voices only talk to me.

Offline

#3 2014-05-25 21:16:54

pyroscope
Member
Registered: 2011-03-11
Posts: 32
Website

Re: [SOLVED] rtorrent 0.9.4-1 writes wrong process name.

Likely related to

* Added thread names using pthread_setname_np.

And indeed the libtorrent threads are called "main" and "disk".

Offline

#4 2014-06-30 07:46:56

a821
Member
From: Berlin, Germany
Registered: 2012-10-31
Posts: 33

Re: [SOLVED] rtorrent 0.9.4-1 writes wrong process name.

Hi,

Sorry for the delayed response... Here is a short update: I had some free time to look at this again and following pyroscope's hint (thread names) I realized that the issue had been already fixed upstream when I reported it (I only checked the "open issues" section and missed the "closed issues" in rtorrent's github site... it was here. Sorry about that).

At the end I patched rtorrent/libtorrent myself using the commits 8e69930 and 425d5fd which fix the issue. I guess we'll have to wait to the next release. (I guess the git versions in AUR should work as well, but I didn't try them).

Bye.


I'm too lazy to compose a signature

Offline

Board footer

Powered by FluxBB