Bug 250929 - sysutils/lsof consumes all swap space
Summary: sysutils/lsof consumes all swap space
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Larry Rosenman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-07 16:15 UTC by Sigi
Modified: 2020-11-30 18:34 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ler)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sigi 2020-11-07 16:15:40 UTC
Hi,

lsof without parameters consumes swap until full. 
System: 12.2-STABLE FreeBSD 12.2-STABLE r366130 GENERIC  amd64
lsof: rebuilt with portmaster. 
RAM 16GB, swap increased to 32GB just for fun. Still kills other services during periodic/weekly with its behavior.

Oct 31 05:01:59 myservername kernel: pid 5909 (mysqld), jid 0, uid 88, was killed: out of swap space
Oct 31 05:02:09 myservername kernel: pid 33760 (mongod), jid 0, uid 975, was killed: out of swap space
Oct 31 05:02:24 myservername kernel: pid 30034 (netdata), jid 0, uid 302, was killed: out of swap space
Oct 31 05:03:03 myservername kernel: pid 2873 (lsof), jid 0, uid 0, was killed: out of swap space
Oct 31 05:03:04 myservername kernel: pid 3338 (clamd), jid 0, uid 106, was killed: out of swap space
Oct 31 05:03:05 myservername kernel: pid 51377 (named), jid 0, uid 53, was killed: out of swap space
Nov  2 03:35:00 myservername kernel: pid 2427 (mysqld), jid 0, uid 88, was killed: out of swap space
Nov  2 03:35:19 myservername kernel: pid 53224 (lsof), jid 0, uid 0, was killed: out of swap space
Nov  7 04:56:36 myservername kernel: pid 2737 (netdata), jid 0, uid 302, was killed: out of swap space
Nov  7 04:57:25 myservername kernel: pid 3179 (mongod), jid 0, uid 975, was killed: out of swap space
Nov  7 04:57:40 myservername kernel: pid 63601 (mysqld), jid 0, uid 88, was killed: out of swap space
Nov  7 04:57:54 myservername kernel: pid 55095 (lsof), jid 0, uid 0, was killed: out of swap space
Nov  7 04:57:56 myservername kernel: pid 1212 (named), jid 0, uid 53, was killed: out of swap space
Nov  7 11:34:01 myservername kernel: pid 76164 (lsof), jid 0, uid 0, was killed: out of swap space
Nov  7 12:33:39 myservername kernel: pid 44701 (lsof), jid 0, uid 0, was killed: out of swap space

Had occasionally some output:
lsof: WARNING: name cache hash chain too long

and maaaany syslogs like
kernel: swap_pager_getswapspace(18): failed
Comment 1 Frank Leonhardt 2020-11-30 18:00:09 UTC
Doesn't it just! It ate through 32Gb of RAM and a 4Gb swap file for me - took a remote server out in the process.

The first time I ran it, nothing was displayed for several minutes so I broke out of it and tried again with the option for "non-blocking" system calls. Some while later it was "Thankyou and goodnight" from FreeBSD 12.2-RELEASE. Having driven 100 miles to find out what happened, I looked in the logs and it was clear the swap space had been eaten.

The only other thing running was nsfd, and I had cp in the background copying data to a small (400Gb) ZFS dataset - booted of UFS.
Comment 2 Cy Schubert freebsd_committer 2020-11-30 18:34:23 UTC
Can you provide uname -a output please.