rtorrent crash

Created on 7 Sep 2015  路  13Comments  路  Source: rakshasa/rtorrent

Hello,

I started rtorrent this morning and received the following error:

Caught internal_error: SocketFd::close() called on an invalid file descriptor
/usr/lib/libtorrent.so.18(_ZN7torrent14internal_error10initializeERKSs+0x202) [0x7fd820e8cc02]
rtorrent(_ZN7torrent14internal_errorC2EPKc+0x3e) [0x44bfee]
/usr/lib/libtorrent.so.18(+0xba084) [0x7fd820f17084]
/usr/lib/libtorrent.so.18(+0x92e98) [0x7fd820eefe98]
/usr/lib/libtorrent.so.18(+0x8c294) [0x7fd820ee9294]
rtorrent() [0x49fa2b]
rtorrent() [0x4b7025]
rtorrent() [0x4bb80e]
/usr/lib/libtorrent.so.18(+0xb4c6f) [0x7fd820f11c6f]
/usr/lib/libtorrent.so.18(+0x2c2ba) [0x7fd820e892ba]
/usr/lib/libtorrent.so.18(_ZN7torrent11thread_base10event_loopEPS0_+0x15a) [0x7fd820ed74da]
rtorrent() [0x411bbb]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fd81fa53ec5]
rtorrent() [0x412304]

I am at a loss...any ideas?

Thank you!

Most helpful comment

Both rtorrent and libtorrent built on feature-bind.
By trial and error i found that:

network.port_range.set = 51413-51413

Same (equal) ports cause this crash.
Setting:

network.port_range.set = 51413-51414

Makes rtorrent happy again.

All 13 comments

Same here:-

Caught internal_error: SocketFd::close() called on an invalid file descriptor
/lib64/libtorrent.so.19(_ZN7torrent14internal_error10initializeERKSs+0x215) [0x7f1aebe88ea5]
/usr/bin/rtorrent(_ZN7torrent14internal_errorC2EPKc+0x4e) [0x44d3be]
/lib64/libtorrent.so.19(+0xbbd74) [0x7f1aebf14d74]
/lib64/libtorrent.so.19(+0x942ae) [0x7f1aebeed2ae]
/lib64/libtorrent.so.19(+0x8df84) [0x7f1aebee6f84]
/usr/bin/rtorrent() [0x4a1a9b]
/usr/bin/rtorrent() [0x4b9335]
/usr/bin/rtorrent() [0x4bdb1e]
/lib64/libtorrent.so.19(+0xb684f) [0x7f1aebf0f84f]
/lib64/libtorrent.so.19(+0x2c472) [0x7f1aebe85472]
/lib64/libtorrent.so.19(_ZN7torrent11thread_base10event_loopEPS0_+0x15a) [0x7f1aebed4d7a]
/usr/bin/rtorrent() [0x411b7f]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f1aeae76af5]
/usr/bin/rtorrent() [0x4122c5]

For anyone who stumbled upon this:
I had the same stacktrace and got it to work by reducing network.max_open_files.set from 1024 down to 1008. No idea why it's this odd number, anything higher and it will crash on startup.

Not all fd's are managed by 'network.max_open_files', so it needs to be a bit lower than ulimit.

$ rtorrent 
Caught internal_error: SocketFd::close() called on an invalid file descriptor
/usr/local/lib/libtorrent.so.19(_ZN7torrent14internal_error10initializeERKSs+0x198) [0x76dcff30]
rtorrent(_ZN7torrent14internal_errorC1EPKc+0x34) [0x51f10]
/usr/local/lib/libtorrent.so.19(+0xab318) [0x76e53318]
/usr/local/lib/libtorrent.so.19(+0xaa9f4) [0x76e529f4]
/usr/local/lib/libtorrent.so.19(_ZN7torrent17ConnectionManager11listen_openEtt+0x14) [0x76dcd008]
rtorrent() [0xaed80]
rtorrent() [0x50d90]
rtorrent() [0x1e0a0]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0x76ad3294]

In my .rtorrent.rc: network.max_open_files.set = 1008

$ ulimit -u
7336

any suggestions?

You're showing max user processes, not open files. Use 'ulimit -n'.

Hi @rakshasa,

$ ulimit -n
65536

This only stopped working once I was able to build rtorrent on the feature-branch. Were there any changes to the code that prevent it from opening with an existing configuration?

Hi!
I set network.max_open_files = 8, but it does not work...
Any ideas?

Rakshasa's BitTorrent client version 0.9.6. git -b feature-bind

ulimit -u
14328

ulimit -n
2048

It's "network.max_open_files.set".

Also as feature-bind is a WIP branch I've yet to review it for potential leaks of file descriptors.

I got mine working with this:

max_peers = 512
max_uploads = 512
download_rate = 0
upload_rate = 0
network.max_open_files.set = 512
network.http.max_open.set = 256
pieces.memory.max.set = 28000M
network.xmlrpc.size_limit.set = 4M
network.max_open_sockets.set = 1024
throttle.global_up.max_rate.set_kb = 0
throttle.global_down.max_rate.set_kb = 0
pieces.preload.type.set = 1
pieces.preload.min_size.set = 262144
pieces.preload.min_rate.set = 5120
network.send_buffer.size.set = 4M
network.receive_buffer.size.set = 128K

It's "network.max_open_files.set" it also does not work, I tried
@jungle-boogie - amazing! it worked!
Thanks guys!

Both rtorrent and libtorrent built on feature-bind.
By trial and error i found that:

network.port_range.set = 51413-51413

Same (equal) ports cause this crash.
Setting:

network.port_range.set = 51413-51414

Makes rtorrent happy again.

Was this page helpful?
0 / 5 - 0 ratings