You are not logged in.

#1 Yesterday 19:18:42

mjd119
Member
Registered: 2020-05-07
Posts: 119

rtorrent - segmentation fault on startup

I get this error when I start up rtorrent now:

Caught Segmentation fault, dumping stack:
rtorrent(+0x50474) [0x646bcec08474]
/usr/lib/libc.so.6(+0x3dcd0) [0x70019b44bcd0]
/usr/lib/libtorrent.so.24(_ZN7torrent17TrackerController5closeEi+0x10) [0x70019ba72860]
/usr/lib/libtorrent.so.24(+0xa461c) [0x70019ba8e61c]
/usr/lib/libtorrent.so.24(+0x2e487) [0x70019ba18487]
rtorrent(+0x567f7) [0x646bcec0e7f7]
rtorrent(+0x497db) [0x646bcec017db]
/usr/lib/libtorrent.so.24(_ZN7torrent5utils6Thread10event_loopEPS1_+0x189) [0x70019ba5ad99]
rtorrent(+0x46424) [0x646bcebfe424]
/usr/lib/libc.so.6(+0x27488) [0x70019b435488]
/usr/lib/libc.so.6(__libc_start_main+0x8c) [0x70019b43554c]
rtorrent(+0x48805) [0x646bcec00805]

My configuration file stored at /etc/rtorrent.conf looks like this:

#############################################################################
# This is an (old) example resource file for rTorrent.
# Copy to ~/.rtorrent.rc and enable/modify the options as needed.
# Remember to uncomment the options you wish to enable.
#
# See 'rtorrent.rc-example' for a newer, basic configuration.
#
#   Sample: https://github.com/rakshasa/rtorrent/wi … G-Template
# Complete: https://rtorrent-docs.readthedocs.io/en … d-ref.html
#   Useful: https://rtorrent-docs.readthedocs.io/en … cases.html
#   Manual: https://rtorrent-docs.readthedocs.io/en/latest/
#  Convert: https://github.com/rakshasa/rtorrent/wi … list-(WIP)
# Handbook: https://media.readthedocs.org/pdf/rtorr … t-docs.pdf
#     File: https://github.com/rakshasa/rtorrent/bl … torrent.rc
#############################################################################

# Maximum and minimum number of peers to connect to per torrent.
#
#throttle.min_peers.normal.set = 40
#throttle.max_peers.normal.set = 100

# Same as above but for seeding completed torrents.
# "-1" = same as downloading.
#
#throttle.min_peers.seed.set = 10
#throttle.max_peers.seed.set = 50

# Maximum number of simultaneous uploads per torrent.
#
#throttle.max_uploads.set = 15

# Global upload and download rate in KiB.
# "0" for unlimited.
#
# Uncommented by mjd119 to allow unlimited download/upload rates (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
throttle.global_down.max_rate.set_kb = 0
throttle.global_up.max_rate.set_kb = 0

# Default directory to save the downloaded torrents.
#
# Set download directory so we can run rtorrent as a system service (mjd119) from https://dominicm.com/rtorrent-bittorren … rch-linux/
directory.default.set = /mnt/downloads/rtorrent

# Default session directory. Make sure you don't run multiple instance
# of rTorrent using the same session directory. Perhaps using a
# relative path?
#
# Set session directory so we can run rtorrent as a system service (mjd119) from https://dominicm.com/rtorrent-bittorren … rch-linux/
session.path.set = /mnt/downloads/rtorrent/.session
# Adjust the interval when session data is saved (now every 2 hours instead of every 20 minutes)
schedule2 = session_save, 1200, 7200, ((session.save))


# Added by mjd119 to set default permission modification of the downloaded files (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
system.umask.set = 002
# Watch a directory for new torrents, and stop those that have been
# deleted.
#
schedule2 = watch_directory,5,5,load.normal=./watch/*.torrent
# Watch directories from Debian rtorrent install (mjd119)
method.insert = cfg.music_watch_dir, private|const|string, (cat, "/media/matt/Backup/Music (Backup)/FLAC (Backup)/")
method.insert = cfg.p_watch_dir, private|const|string, (cat, "/media/matt/X18/")

schedule = watch_directory_music,5,5,"load.normal=/mnt/downloads/rtorrent/watch_music/*.torrent,d.directory.set=(cfg.music_watch_dir),d.custom1.set=Sorted_Music"

schedule = watch_directory_tv,5,5,"load.normal=/mnt/downloads/rtorrent/watch_tv/*.torrent,d.directory.set=/media/matt/Linux/TV/,d.custom1.set=Sorted_TV"

schedule = watch_directory_movies,5,5,"load.start=/mnt/downloads/rtorrent/watch_movies/*.torrent,d.directory.set=/media/matt/Linux/Movies/,d.custom1.set=Sorted_Movies"

schedule = watch_directory_p,5,5,"load.normal=/mnt/downloads/rtorrent/watch_p/*.torrent,d.directory.set=(cfg.p_watch_dir),d.custom1.set=Sorted_P"

schedule = watch_directory_games,5,5,"load.start=/mnt/downloads/rtorrent/watch_games/*.torrent,d.directory.set=/media/matt/Backup/Games/,d.custom1.set=Sorted_Games"

schedule = watch_directory_software,5,5,"load.start=/mnt/downloads/rtorrent/watch_software/*.torrent,d.directory.set=/media/matt/Backup/Software/,d.custom1.set=Sorted_Software"

# Close torrents when disk-space is low.
#
#schedule2 = low_diskspace,5,60,close_low_diskspace=100M

# The IP address reported to the tracker.
#
#network.local_address.set = 127.0.0.1
#network.local_address.set = rakshasa.no

# The IP address the listening socket and outgoing connections is
# bound to.
#
#network.bind_address.set = 127.0.0.1
#network.bind_address.set = rakshasa.no

# Port range to use for listening.
#
# Changed by mjd119 (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
#network.port_range.set = 49164-49164
network.port_range.set = 46539-46539
# Start opening ports at a random position within the port range.
#
# Uncommented by mjd119 to prevent selecting a random port (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
network.port_random.set = no

# Check hash for finished torrents. Might be useful until the bug is
# fixed that causes lack of disk-space not to be properly reported.
#
#pieces.hash.on_completion.set = no

# Set whether the client should try to connect to UDP trackers.
#
# Uncommented by mjd119 to allow UDP trackers (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
trackers.use_udp.set = yes

# Alternative calls to bind and IP that should handle dynamic IP's.
#
#schedule2 = ip_tick,0,1800,ip=rakshasa
#schedule2 = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plain-text to RC4 encryption after the encrypted handshake.
#
# Uncommented by mjd119 to enable encryption (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
# Uncommented by mjd119 to only enable DHT when needed (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
dht.mode.set = auto

# UDP port to use for DHT.
#
#dht.port.set = 6881

# Enable peer exchange (for torrents not marked private).
#
# Uncommented by mjd119 to enable PEX protocol (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
protocol.pex.set = yes
#protocol.pex.set = no #Setting option no is good for private trackers https://redacted.ch/forums.php?action=v … eadid=4529

# Set download list layout style ("full", "compact").
#
#ui.torrent_list.layout.set = "full"

# Run rTorrent as a daemon, controlled via XMLRPC.
#
#system.daemon.set = false

# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC)
# Use a IP socket with scgi_port, or a Unix socket with scgi_local.
# schedule can be used to set permissions on the unix socket.
#
#network.scgi.open_port = "127.0.0.1:5000"
#network.scgi.open_local = (cat,(session.path),/rpc.sock)
#schedule2 = socket_chmod, 0, 0, "execute.nothrow=chmod,770,(cat,(session.path),/rpc.sock)"

# Added by mjd119 to allow communication between rtorrent and the web interface (from https://dominicm.com/rutorrent-web-inte … ch-linux/)
# Guide uses localhost instead of 127.0.0.1, changing it to 127.0.0.1 to match $scgi_host in /etc/webapps/rutorrent/conf/config.php fixed it
scgi_port = 127.0.0.1:5000
# Added by mjd119 to fix "Hash check on download completion found bad chunks, consider using \'safe_sync\'." issue
pieces.sync.always_safe.set=1

I run rtorrent as a service and the service file looks like this:

# # Service file for rtorrent added by mjd119 (from https://dominicm.com/rtorrent-bittorren … ch-linux/)
# [Unit]
# Description=rTorrent Daemon
# After=network.target
# After = mnt-downloads.mount
#
# [Service]
# Type=forking
# KillMode=control-group
# User=rtorrent
# ExecStartPre=/usr/bin/bash -c "if test -e /mnt/downloads/rtorrent/.session/rtorrent.lock && test -z `pidof rtorrent`;
                                then rm -f /mnt/downloads/rtorrent/.session/rtorrent.lock; fi
                                while true ; do date ; natpmpc -a 1 0 udp 60 -g 10.2.0.1 && natpmpc -a 1 0 tcp 60 -g 10.2.0.1
                                || { echo -e "ERROR with natpmpc command \a" ; break ; } ; sleep 45 ; done"
# ExecStart=/usr/bin/tmux new-session -c /mnt/downloads/rtorrent -s rtorrent -n rtorrent -d 'rtorrent -n -o import=/etc/rtorrent.conf'
# ExecStop=/usr/bin/bash -c "/usr/bin/tmux rt send-keys -t rtorrent C-q && while pidof rtorrent > /dev/null; do sleep 0.5; done"
# Restart=on-failure
#
# [Install]
# WantedBy=multi-user.target

The issue started when I tried to run

import=/etc/rtorrent.conf

while my session was running since I wanted to update the listening port for port forwarding. I get crashes when I start up from the command line manually as well.
When I run

rtorrent -n -o import=/etc/rtorrent.conf

from my terminal I get this output:

rtorrent: Could not lock session directory: "/mnt/downloads/rtorrent/.session/", held by "arch:+43452".

Last edited by mjd119 (Yesterday 20:25:50)

Offline

#2 Today 08:13:07

seth
Member
Registered: 2012-09-03
Posts: 62,433

Re: rtorrent - segmentation fault on startup

Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.

https://github.com/rakshasa/rtorrent/issues/1437

Offline

Board footer

Powered by FluxBB