Closed johnmaguire closed 1 year ago
I created a 1 TB swap to get past the OOM. rtorrent kept increasing its memory usage until it was using ~36 GB of swap and somewhere between 20 and 24 GB of physical RAM. It spawned a child pid that it's wait4'ing on. That child pid is now looping, calling close() on an incrementing fd, with each call returning "-1 EBADF (Bad file descriptor)":
Using strace -f
I was able to get the following:
[pid 261570] brk(0x56077553f000) = 0x56077553f000
[pid 261570] brk(0x560775540000) = 0x560775540000
[pid 261570] brk(0x560775541000) = 0x560775541000
[pid 261570] uname({sysname="Linux", nodename="76d161d4ee0b", ...}) = 0
[pid 261570] getpid() = 431
[pid 261570] brk(0x560775542000) = 0x560775542000
[pid 261570] brk(0x560775543000) = 0x560775543000
[pid 261570] brk(0x560775544000) = 0x560775544000
[pid 261570] brk(0x560775545000) = 0x560775545000
[pid 261570] brk(0x560775546000) = 0x560775546000
[pid 261570] brk(0x560775547000) = 0x560775547000
[pid 261570] open("/config/rtorrent/rtorrent.rc", O_RDONLY) = 14
[pid 261570] brk(0x560775548000) = 0x560775548000
[pid 261570] read(14, "################################"..., 1023) = 1023
[pid 261570] brk(0x560775549000) = 0x560775549000
[pid 261570] read(14, "fg.confdir), \"\\\" &&\",\\\n \"mkdi"..., 1023) = 1023
[pid 261570] rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
[pid 261570] fork(strace: Process 266134 attached
<unfinished ...>
[pid 266134] gettid( <unfinished ...>
[pid 261570] <... fork resumed>) = 434
[pid 266134] <... gettid resumed>) = 434
[pid 266134] rt_sigprocmask(SIG_SETMASK, [], <unfinished ...>
[pid 261570] rt_sigprocmask(SIG_SETMASK, [], <unfinished ...>
[pid 266134] <... rt_sigprocmask resumed>NULL, 8) = 0
[pid 261570] <... rt_sigprocmask resumed>NULL, 8) = 0
[pid 266134] open("/dev/null", O_RDWR <unfinished ...>
[pid 261570] wait4(434, <unfinished ...>
[pid 266134] <... open resumed>) = 15
[pid 266134] dup2(15, 0) = 0
[pid 266134] dup2(15, 1) = 1
[pid 266134] dup2(15, 2) = 2
[pid 266134] prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1073741816, rlim_max=1073741816}) = 0
[pid 266134] close(3) = 0
[pid 266134] close(4) = 0
[pid 266134] close(5) = 0
[pid 266134] close(6) = 0
[pid 266134] close(7) = 0
[pid 266134] close(8) = 0
[pid 266134] close(9) = 0
[pid 266134] close(10) = 0
[pid 266134] close(11) = 0
[pid 266134] close(12) = 0
[pid 266134] close(13) = 0
[pid 266134] close(14) = 0
[pid 266134] close(15) = 0
[pid 266134] close(16) = -1 EBADF (Bad file descriptor)
[pid 266134] close(17) = -1 EBADF (Bad file descriptor)
[pid 266134] close(18) = -1 EBADF (Bad file descriptor)
[pid 266134] close(19) = -1 EBADF (Bad file descriptor)
[pid 266134] close(20) = -1 EBADF (Bad file descriptor)
[pid 266134] close(21) = -1 EBADF (Bad file descriptor)
[pid 266134] close(22) = -1 EBADF (Bad file descriptor)
[pid 266134] close(23) = -1 EBADF (Bad file descriptor)
[pid 266134] close(24) = -1 EBADF (Bad file descriptor)
[pid 266134] close(25) = -1 EBADF (Bad file descriptor)
This continues forever.
Okay, this was caused by the same issue as #1213. I'm not sure where that error was seen, but it wasn't in my logs. Thanks @Moret84 for sharing the solution. Here's the docker-compose.yml equivalent I used:
services:
rtorrent:
# ...
ulimits:
nofile:
soft: 65536
hard: 65536
Hi there -
I'm trying to run rtorrent inside a Docker container (I'm using the linuxserver/rutorrent image still), which has been working great for me for years. Recently, following a reboot, rtorrent gets oom-killed every time it tries to start.
I have plenty of RAM available, as seen with rtorrent off:
IIUC, about 8,214 torrents:
journal logs:
strace results, without running under s6-setuidgid:
The final mmap call hangs for a couple seconds before the process is killed. Any pointers would be greatly appreciated.