Bug 1716382

Summary: systemd generates 52Gb process when nis added to nsswhich.conf
Product: [Fedora] Fedora Reporter: Bernard Piette <b.m.a.g.piette>
Component: nss_nisAssignee: Matej Mužila <mmuzila>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 30CC: fedoraproject, fjanus, igeorgex, jimbodie, john.kissane, jonied, leif, mmuzila, phil_g, rkudyba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-22 10:50:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
requested files in a zip none

Description Bernard Piette 2019-06-03 11:39:47 UTC
*Description of problem:

When I configure nis and try to login with one of the nis served account (at the console or using ssh), a 52Gb systemd process hogs the computer and makes it unusable for more than 15 minutes. When I remove the nis configuration from /etc/nsswhich.conf, then the computers works (but login with the nis account don't work of course)

top produces the following line: 

  1216 root      20   0   52.2g  23.7g   4772 R 100.0  76.0   0:07.56 (systemd)

* Version-Release number of selected component (if applicable):

The installation is Fedora 30 x86_64 server selecting the package sets "Domain Membership" "Hardware support for Server Systems" and "Editors".

Installed all the latest patches (on 3 June 2019)

I then installed nss_nis3.0-9.fc30.x86_64.rpm ypbind-2.5-4.fc30.x86_64.rpm and yp-tools-4.2.3-4.fc30.x86_64.rpm. 

/etc/nsswhich.conf : I have modified the following entries:
passwd:      nis files 
shadow:      nis files
group:       nis files 

/etc/yp.conf: (I have 3 NIS servers)
domain maths.durham.ac.uk server plato2
domain maths.durham.ac.uk server shannon
domain maths.durham.ac.uk server plato1

/etc/pam.d/password-auth: I have modified the following line:

password    sufficient    pam_unix.so try_first_pass use_authtok nullok sha512 shadow nis

systemctl enable ypbind
systemctl start ypbind

Reboot the system and try to login.

* How reproducible:

  This is systematic. 

* Steps to Reproduce:
Configure as described above. Reboot the system and login with a NIS username.
Login in with a local account produced the same problem except when login in as root.
Disabling selinux does not make any difference.

Actual results:
Server hogs because of huge process. 

Expected results:
Login in.

Additional info:
It is not no clear to me if the problems comes from nss_nis, systemd, pam or even glibc. I do not get any error messages in the log files. 

I initially discovered the problem after installing over 10000 RPMs and then the system was failing to boot properly as the huge process was created before filesystems where remotely installed.

Comment 1 Bernard Piette 2019-06-03 13:32:53 UTC
I have just seen the following bug : https://bugzilla.redhat.com/show_bug.cgi?id=1705641

This iseems to be the same bug. The people reporting the problem are also using nis. I have also seen this on 4 different types of PCs. 3 with 63GB ram (+32 GB swap) and one with 16Gb RAM and 50Gb Swap.

Disabling NIS in nsswhich.conf always fixes the problem.

Comment 3 Bernard Piette 2019-06-03 15:24:48 UTC
Many thanks for the suggestion.

I had tried it on a complex system, but I have tried it again on a clean one (i.e. the configuration I described in my first post) and the problem subsist.

The output of top is :

 70 root      20   0       0      0      0 R  12.3   0.0   0:10.95 kswapd0                                                            
 8926 root      20   0   52.2g  30.5g     20 D   5.4  97.6   0:18.78 (systemd) 

As a work around, I have also tried to set some memory limit in  /etc/systemd/system.conf . This might also given us a clue of what the memory is used for.

DefaultLimitDATA=11G
DefaultLimitSTACK=11G 
DefaultLimitAS=11G

but then the system fails to start properly as several services crash in the boot process.

Thanks for your help.

Bernard

Comment 4 Leif Hedstrom 2019-06-03 21:39:28 UTC
Awesome, as per the other issue, I ran "authselect select nis --force", and now I get this:

 1382 root      20   0   52.2g  30.7g     20 R  43.2  97.9   0:24.61 (systemd)


Lovely.

Comment 5 Leif Hedstrom 2019-06-03 22:00:37 UTC
(In reply to Leif Hedstrom from comment #4)
> Awesome, as per the other issue, I ran "authselect select nis --force", and
> now I get this:
> 
>  1382 root      20   0   52.2g  30.7g     20 R  43.2  97.9   0:24.61
> (systemd)
> 



So I am seeing a small change, whereas before, when a process grows out of bounds like this, it eventually dies, and never recovers (at least not for me). However, not it seems that e.g. distccd will recover after the initial failure, where it consumes all memory and crashes. Maybe that's why people think it's "fixed", because it'd only happen for a few minutes during startup, and then it seems to hit a functional state.

Comment 6 Bernard Piette 2019-06-06 07:03:52 UTC
I have done further tests and I find that the problem occurs each time a deamon that needs to consult a nis table is started. By reducing the number of nis entries in nsswhich.conf, one reduces the number of instances when systemd generates huge processes.

For example is hosts has a nis entry in nsswhich.conf , resolved uses 52,2 GB of ram, but if nis is removed, then it works fine.

Comment 7 Matej Mužila 2019-06-06 13:20:09 UTC
Using NIS to resolve hosts while specifying NIS servers by domain name is dangerous. As stated in man page (yp.conf(5)):

    "hostname can either be an IP address or the system's DNS name.
     If it is the system's DNS name, this name needs to be resolveable
     without the help of NIS, before NIS is used."

The problem is, that if NIS is used to determine IP address of NIS server,
it leads to endless recursion.

Example:
========
Providing that hosts entry in /etc/nsswitch.conf is in format (or simillar)
"hosts: nis dns files" and nis servers are specified by domain names:

If we want to resolve hostname example.com, the first service tried to resolve this
hostname is NIS. In order to get entry for example.com from NIS server, the NIS client
needs to get IP of the NIS server. To get IP of NIS server, its domain name needs
to be resolved. According to /etc/nsswitch the first service tried to resolve domain
name of NIS server is NIS. So NIS is used to resolve address of NIS server...

---

If the hosts entry in /etc/nsswitch.conf is in format "hosts: dns files  nis ...", it does not
mean that it is safe. The problem can occur if hostname of NIS server is not resolvable
by DNS or files.

Upstream of Linux-NIS recommends to use DNS to distribute hosts instead of using NIS.

Comment 8 Bernard Piette 2019-06-06 13:33:45 UTC
I understand your point, but this is not what I was trying to do.
My nis servers are in the hosts files and I use dns to resolve other names. I just use the example of using nis for hosts to illustrate the nss - nis problem.

As things stands, nis is totally unusable under Fedora 30, even is you only use nis for passwd shadow and group.

Comment 9 Leif Hedstrom 2019-06-06 17:20:30 UTC
Same here, I don't use NIS on the host lookups at all, and that much said, I put the IP of the NIS master/slaves in the yp.conf. And yes, I only use NIS for user information (passed, shadow, group and auto mount).

Comment 10 Leif Hedstrom 2019-06-06 17:30:08 UTC
I don't want to seem rude, but since this reproduces so easily, and is completely crippling for anyone using NIS, how is this not a critical issue to try to fix? If it's a systemd issue, do we need to take it upstream into the systemd team? Often times (always ...) I wish I could run Fedora without systemd....

Comment 11 Bernard Piette 2019-06-07 06:51:32 UTC
I fully agree with you. The problem seems to come from systemd, nss or the interface between the two (but it could be a kernel issue too).

Comment 12 Filip Januš 2019-10-11 10:49:08 UTC
Hello,
I tried to reproduce it according to Bernard's description, but without success. Always runs server and client fine without consuming amount of memory. Can somebody post here some more specific information how this behavior occur and mainly how to reproduce it.

Comment 13 Johannes Niediek 2019-11-04 12:47:27 UTC
I still have the exact same problem described by Bernard.

Filip, could you specify the versions of kernel, nis, systemd, yp that you use?
Thank you
Johannes

Comment 14 Filip Januš 2019-11-04 19:47:26 UTC
Operating System: Fedora 30 (Thirty)
CPE OS Name: cpe:/o:fedoraproject:fedora:30
Kernel: Linux 5.0.9-301.fc30.x86_64
Architecture: x86-64


yp-tools-4.2.3-4.fc30.x86_64
nss_nis-3.0-9.fc30.x86_64
ypbind-2.5-4.fc30.x86_64
ypserv-4.1-1.fc30.x86_64

systemd 241 (v241-7.gita2eaa1c.fc30)

Comment 15 RobbieTheK 2019-11-15 16:10:43 UTC
Our Dell PowerEdge R740 with 64 GB of RAM is full of out of memory errors related to systemd. We do run NIS but I'm not seeing any nss_nis references in the OOM's nor straces, which I've included below. We are on  5.3.11-300.fc31.x86_64. As per the suggestion at https://bugzilla.redhat.com/show_bug.cgi?id=1705641#c24, I did set LimitNOFILE=1024 in /usr/lib/systemd/system/ypbind.service. I haven't tried the https://bugzilla.redhat.com/show_bug.cgi?id=1716382#c3 suggestions as I didn't want to run into any issues on a reboot. Is there anything else I can provide?

rpm -q nss_nis
nss_nis-3.1-2.fc31.x86_64
rpm -q systemd
systemd-243-4.gitef67743.fc31.x86_64
rpm -q ypbind
ypbind-2.6.1-1.fc31.x86_64
rpm -q yp-tools
yp-tools-4.2.3-6.fc31.x86_64

Nov 14 16:49:58 kernel: (systemd) invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
Nov 14 16:49:58 kernel: CPU: 0 PID: 3874 Comm: (systemd) Tainted: P           OE     5.3.11-300.fc31.x86_64 #1
Nov 14 16:49:58 kernel: Hardware name: Dell Inc. PowerEdge R740/00WGD1, BIOS 2.3.10 08/15/2019
Nov 14 16:49:58 kernel: Call Trace:
Nov 14 16:49:58 kernel: dump_stack+0x66/0x90
Nov 14 16:49:58 kernel: dump_header+0x4a/0x1e2
Nov 14 16:49:58 kernel: oom_kill_process.cold+0xb/0x10
Nov 14 16:49:58 kernel: out_of_memory+0x24d/0x4a0
Nov 14 16:49:58 kernel: __alloc_pages_slowpath+0xb09/0xe00
Nov 14 16:49:58 kernel: __alloc_pages_nodemask+0x2ee/0x340
Nov 14 16:49:58 kernel: pagecache_get_page+0xb4/0x370
Nov 14 16:49:58 kernel: filemap_fault+0x683/0x9f0
Nov 14 16:49:58 kernel: ? __mod_lruvec_state+0x3f/0xe0
Nov 14 16:49:58 kernel: ? page_add_file_rmap+0xe3/0x220
Nov 14 16:49:58 kernel: ? alloc_set_pte+0x123/0x6a0
Nov 14 16:49:58 kernel: ? file_fdatawait_range+0x20/0x20
Nov 14 16:49:58 kernel: ? _cond_resched+0x15/0x30
Nov 14 16:49:58 kernel: __xfs_filemap_fault+0x6d/0x200 [xfs]
Nov 14 16:49:58 kernel: __do_fault+0x36/0x180
Nov 14 16:49:58 kernel: __handle_mm_fault+0x1089/0x1ab0
Nov 14 16:49:58 kernel: ? __switch_to_asm+0x34/0x70
Nov 14 16:49:58 kernel: handle_mm_fault+0xc4/0x1e0
Nov 14 16:49:58 kernel: do_user_addr_fault+0x1c4/0x440
Nov 14 16:49:58 kernel: do_page_fault+0x31/0x110
Nov 14 16:49:58 kernel: page_fault+0x3e/0x50
Nov 14 16:49:58 kernel: RIP: 0033:0x7f7610e39706
Nov 14 16:49:58 kernel: Code: Bad RIP value.
Nov 14 16:49:58 kernel: RSP: 002b:00007ffe5b50a0b0 EFLAGS: 00010246
Nov 14 16:49:58 kernel: RAX: 0000000000000000 RBX: 00007f64ccb4d050 RCX: 000000003ffffff8
Nov 14 16:49:58 kernel: RDX: 00007f5c04000010 RSI: 0000000000000000 RDI: 00007f64ccb4d020
Nov 14 16:49:58 kernel: RBP: 0000556a9defbfd0 R08: 00007f5c04000010 R09: 0000000000000000
Nov 14 16:49:58 kernel: R10: 0000000000000022 R11: 0000000000000246 R12: 0000556a9ddeafb0
Nov 14 16:49:58 kernel: R13: 0000000000000004 R14: 00007ffe5b50a160 R15: 00007f6803fffe90
Nov 14 16:49:58 kernel: Mem-Info:
Nov 14 16:49:58 kernel: active_anon:15224064 inactive_anon:897193 isolated_anon:32#012 active_file:223 inactive_file:144 isolated_file:0#012 unevictable:0 dirty:0 writeback:45 unstable:0#012 slab_reclaimable:13834 slab_unreclaimable:32459#012 mapped:88 shmem:3 pagetables:44286 bounce:0#012 free:56576 free_pcp:309 free_cma:0
Nov 14 16:49:58 kernel: Node 0 active_anon:30154328kB inactive_anon:1779952kB active_file:464kB inactive_file:308kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:64kB dirty:0kB writeback:140kB shmem:8kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? yes
Nov 14 16:49:58 kernel: Node 1 active_anon:30741928kB inactive_anon:1808820kB active_file:428kB inactive_file:268kB unevictable:0kB isolated(anon):128kB isolated(file):0kB mapped:288kB dirty:0kB writeback:40kB shmem:4kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? yes
Nov 14 16:49:58 kernel: Node 0 DMA free:15872kB min:20kB low:32kB high:44kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15972kB managed:15888kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
Nov 14 16:49:58 kernel: lowmem_reserve[]: 0 1391 31604 31604 31604
Nov 14 16:49:58 kernel: Node 0 DMA32 free:122812kB min:1964kB low:3388kB high:4812kB active_anon:1324228kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:1521664kB managed:1456128kB mlocked:0kB kernel_stack:0kB pagetables:2592kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
Nov 14 16:49:58 kernel: lowmem_reserve[]: 0 0 30212 30212 30212
Nov 14 16:49:58 kernel: Node 0 Normal free:42464kB min:42644kB low:73580kB high:104516kB active_anon:28830100kB inactive_anon:1779952kB active_file:280kB inactive_file:256kB unevictable:0kB writepending:140kB present:31457280kB managed:30937496kB mlocked:0kB kernel_stack:3192kB pagetables:85944kB bounce:0kB free_pcp:740kB local_pcp:0kB free_cma:0kB
Nov 14 16:49:58 kernel: lowmem_reserve[]: 0 0 0 0 0
Nov 14 16:49:58 kernel: Node 1 Normal free:45156kB min:45480kB low:78472kB high:111464kB active_anon:30742292kB inactive_anon:1808944kB active_file:64kB inactive_file:32kB unevictable:0kB writepending:40kB present:33554432kB managed:33003192kB mlocked:0kB kernel_stack:2232kB pagetables:88608kB bounce:0kB free_pcp:496kB local_pcp:0kB free_cma:0kB
Nov 14 16:49:58 kernel: lowmem_reserve[]: 0 0 0 0 0
Nov 14 16:49:58 kernel: Node 0 DMA: 0*4kB 0*8kB 0*16kB 0*32kB 2*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15872kB
Nov 14 16:49:58 kernel: Node 0 DMA32: 5*4kB (UM) 3*8kB (UM) 5*16kB (UM) 4*32kB (UM) 3*64kB (U) 2*128kB (U) 3*256kB (UM) 3*512kB (UM) 1*1024kB (U) 0*2048kB 29*4096kB (M) = 122812kB
Nov 14 16:49:58 kernel: Node 0 Normal: 94*4kB (UME) 84*8kB (UME) 73*16kB (UME) 58*32kB (UME) 45*64kB (UME) 20*128kB (UME) 11*256kB (UE) 7*512kB (UE) 6*1024kB (UME) 10*2048kB (M) 0*4096kB = 42536kB
Nov 14 16:49:58 kernel: Node 1 Normal: 169*4kB (UME) 95*8kB (UE) 124*16kB (UME) 137*32kB (UME) 22*64kB (UME) 16*128kB (UME) 7*256kB (UME) 4*512kB (UME) 2*1024kB (UM) 2*2048kB (UM) 6*4096kB (UM) = 45820kB
Nov 14 16:49:58 kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
Nov 14 16:49:58 kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Nov 14 16:49:58 kernel: Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
Nov 14 16:49:58 kernel: Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Nov 14 16:49:58 kernel: 5837 total pagecache pages
Nov 14 16:49:58 kernel: 5543 pages in swap cache
Nov 14 16:49:58 kernel: Swap cache stats: add 23150823, delete 23144509, find 13484/34767
Nov 14 16:49:58 kernel: Free swap  = 0kB
Nov 14 16:49:58 kernel: Total swap = 23441404kB
Nov 14 16:49:58 kernel: 16637337 pages RAM
Nov 14 16:49:58 kernel: 0 pages HighMem/MovableOnly
Nov 14 16:49:58 kernel: 284161 pages reserved
Nov 14 16:49:58 kernel: 0 pages cma reserved
Nov 14 16:49:58 kernel: 0 pages hwpoisoned
Nov 14 16:49:58 kernel: Tasks state (memory values in pages):
Nov 14 16:49:58 kernel: [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
Nov 14 16:49:58 kernel: [    797]     0   797    19748        3   143360      301          -250 systemd-journal
Nov 14 16:49:58 kernel: [    822]     0   822     7831        0    86016      719         -1000 systemd-udevd
Nov 14 16:49:58 kernel: [   1116]    32  1116     2706        0    61440      185             0 rpcbind
Nov 14 16:49:58 kernel: [   1120]     0  1120     1567        1    57344      126             0 rpc.idmapd
Nov 14 16:49:58 kernel: [   1121]     0  1121    59933        0    98304      418             0 ModemManager
Nov 14 16:49:58 kernel: [   1127]     0  1127    83461        3   163840     5299             0 firewalld
Nov 14 16:49:58 kernel: [   1132]     0  1132    19853        0    53248       92             0 irqbalance
Nov 14 16:49:58 kernel: [   1134]     0  1134      628        1    40960       28             0 mcelog
Nov 14 16:49:58 kernel: [   1136]     0  1136    78039        0   106496      263             0 rngd
Nov 14 16:49:58 kernel: [   1137]     0  1137   170870        0   925696      252             0 rsyslogd
Nov 14 16:49:58 kernel: [   1138]     0  1138     2701        0    65536      386             0 smartd
Nov 14 16:49:58 kernel: [   1142]   994  1142    34432        7   180224    12509             0 chronyd
Nov 14 16:49:58 kernel: [   1145]     0  1145   114812        1   131072      517             0 abrtd
Nov 14 16:49:58 kernel: [   1163]     0  1163    76477        0    90112      291             0 ypbind
Nov 14 16:49:58 kernel: [   1178]    81  1178    67187        0    57344      196          -900 dbus-broker-lau
Nov 14 16:49:58 kernel: [   1179]    81  1179     1467        1    49152      278          -900 dbus-broker
Nov 14 16:49:58 kernel: [   1182]     0  1182   190544        0   376832      460             0 abrt-dump-journ
Nov 14 16:49:58 kernel: [   1183]     0  1183   192621        0   737280      484             0 abrt-dump-journ
Nov 14 16:49:58 kernel: [   1184]     0  1184   192592        0   655360      476             0 abrt-dump-journ
Nov 14 16:49:58 kernel: [   1195]     0  1195    65979        0    98304      190             0 gssproxy
Nov 14 16:49:58 kernel: [   1207]   997  1207   490034        0   282624     7884             0 polkitd
Nov 14 16:49:58 kernel: [   1241]     0  1241   134749       37   159744      715             0 NetworkManager
Nov 14 16:49:58 kernel: [   1620]     0  1620     3002        0    61440      223         -1000 sshd
Nov 14 16:49:58 kernel: [   1628]    29  1628    15470        3   155648    12472             0 rpc.statd
Nov 14 16:49:58 kernel: [   1638]     0  1638     9642        4   114688     6354             0 rpc.mountd
Nov 14 16:49:58 kernel: [   1690]     0  1690      915        1    49152       45             0 atd
Nov 14 16:49:58 kernel: [   1693]     0  1693    10206        9   118784     6642             0 sendmail
Nov 14 16:49:58 kernel: [   1711]    51  1711    10061        3   122880     6548             0 sendmail
Nov 14 16:49:58 kernel: [   1713]     0  1713    11613        0   135168     6484             0 systemd-logind
Nov 14 16:49:58 kernel: [   1723]     0  1723    54363        0    61440      231             0 crond
Nov 14 16:49:58 kernel: [   1919]     0  1919   213016        0   262144    12774             0 automount
Nov 14 16:49:58 kernel: [   1939]     0  1939    10038        0   118784     6444             0 sshd
Nov 14 16:49:58 kernel: [   1963]  7263  1963    16716        0   172032    12639             0 sshd
Nov 14 16:49:58 kernel: [   1968]  7263  1968    62661        1   139264     6666             0 bash
Nov 14 16:49:58 kernel: [   3204]  7264  3204    62397        0   114688     6437             0 screen
Nov 14 16:49:58 kernel: [   3205]  7264  3205    62641        1   131072     6637             0 bash
Nov 14 16:49:58 kernel: [   3281]  7264  3281   117378     2228   294912    10869             0 jupyter-noteboo
Nov 14 16:49:58 kernel: [   3350]     0  3350    16708        0   172032    12605             0 sshd
Nov 14 16:49:58 kernel: [   3375]  7264  3375    16754       40   172032    12609             0 sshd
Nov 14 16:49:58 kernel: [   3420]  7263  3420    62365       13   126976     6413             0 screen
Nov 14 16:49:58 kernel: [   3421]  7263  3421    62684        3   135168     6667             0 bash
Nov 14 16:49:58 kernel: [   3580]     0  3580    53925        0    49152       31             0 agetty
Nov 14 16:49:58 kernel: [   3614]  7263  3614    62295        0   135168     6329             0 screen
Nov 14 16:49:58 kernel: [   3864]     0  3864    16709        0   167936    12607             0 sshd
Nov 14 16:49:58 kernel: [   3874]     0  3874 27306220 16112974 174817280  5681517             0 (systemd)
Nov 14 16:49:58 kernel: [   3883]  7264  3883    16741        1   167936    12624             0 sshd
Nov 14 16:49:58 kernel: [   3888]  7264  3888    62628        1   143360     6634             0 bash
Nov 14 16:49:58 kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0-1,global_oom,task_memcg=/user.slice/user-7264.slice/user,task=(systemd),pid=3874,uid=0
Nov 14 16:49:58 kernel: Out of memory: Killed process 3874 ((systemd)) total-vm:109224880kB, anon-rss:64451896kB, file-rss:0kB, shmem-rss:0kB
Nov 14 16:49:58 systemd[1]: user: A process of this unit has been killed by the OOM killer.
[root@kudyba]# less /var/log/messages
[root@kudyba]# nano oom.txt
  GNU nano 4.3                                                                                        oom.txt                                                                                        Modified
Nov 14 16:49:58 kernel: [   3580]     0  3580    53925        0    49152       31             0 agetty
Nov 14 16:49:58 kernel: [   3614]  7263  3614    62295        0   135168     6329             0 screen
Nov 14 16:49:58 kernel: [   3864]     0  3864    16709        0   167936    12607             0 sshd
Nov 14 16:49:58 kernel: [   3874]     0  3874 27306220 16112974 174817280  5681517             0 (systemd)
Nov 14 16:49:58 kernel: [   3883]  7264  3883    16741        1   167936    12624             0 sshd
Nov 14 16:49:58 kernel: [   3888]  7264  3888    62628        1   143360     6634             0 bash
Nov 14 16:49:58 kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0-1,global_oom,task_memcg=/user.slice/user-xxxx.slice/user,task=(systemd),pid=3874,uid>
Nov 14 16:49:58 kernel: Out of memory: Killed process 3874 ((systemd)) total-vm:109224880kB, anon-rss:64451896kB, file-rss:0kB, shmem-rss:0kB
Nov 14 16:49:58 systemd[1]: user: A process of this unit has been killed by the OOM killer.
Nov 14 16:50:02 kernel: oom_reaper: reaped process 3874 ((systemd)), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Nov 14 16:50:02 systemd[1]: user: Failed with result 'timeout'.
Nov 14 16:50:02 systemd[1]: Failed to start User Manager for UID 7264.
Nov 14 16:50:03 systemd[1]: user: Consumed 1min 38.765s CPU time.
Nov 14 16:50:04 systemd[1]: Started Session 6 of user newuser.
Nov 14 16:50:07 systemd-logind[1713]: Session 6 logged out. Waiting for processes to exit.

As of this moment the load it back to 0. I've provided 2 straces below for the systemd-uded and systemd-journald active processes.

strace: Process 822 attached: systemd-udevd
epoll_wait(9, [{EPOLLIN, {u32=11, u64=11}}], 10, -1) = 1
read(11, "\1\0\0\0\0\0\0\0", 8)         = 8
socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 14
getsockopt(14, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
setsockopt(14, SOL_SOCKET, SO_SNDBUF, [8388608], 4) = 0
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
sendmsg(14, {msg_name={sa_family=AF_UNIX, sun_path="/run/systemd/notify"}, msg_namelen=22, msg_iov=[{iov_base="WATCHDOG=1", iov_len=10}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 10
close(14)                               = 0
timerfd_settime(11, TFD_TIMER_ABSTIME, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=66838, tv_nsec=916684000}}, NULL) = 0
epoll_wait(9, [{EPOLLIN, {u32=11, u64=11}}], 10, -1) = 1
read(11, "\1\0\0\0\0\0\0\0", 8)         = 8
socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 14
getsockopt(14, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
setsockopt(14, SOL_SOCKET, SO_SNDBUF, [8388608], 4) = 0
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
sendmsg(14, {msg_name={sa_family=AF_UNIX, sun_path="/run/systemd/notify"}, msg_namelen=22, msg_iov=[{iov_base="WATCHDOG=1", iov_len=10}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 10
close(14)                               = 0
timerfd_settime(11, TFD_TIMER_ABSTIME, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=66958, tv_nsec=916684000}}, NULL) = 0
epoll_wait(9, [{EPOLLIN, {u32=11, u64=11}}], 10, -1) = 1
read(11, "\1\0\0\0\0\0\0\0", 8)         = 8
socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 14
getsockopt(14, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
setsockopt(14, SOL_SOCKET, SO_SNDBUF, [8388608], 4) = 0
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
sendmsg(14, {msg_name={sa_family=AF_UNIX, sun_path="/run/systemd/notify"}, msg_namelen=22, msg_iov=[{iov_base="WATCHDOG=1", iov_len=10}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 10
close(14)                               = 0
timerfd_settime(11, TFD_TIMER_ABSTIME, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=67078, tv_nsec=916684000}}, NULL) = 0
epoll_wait(9,

strace -p 797 systemd-journald
strace: Process 797 attached
epoll_wait(7, [{EPOLLIN, {u32=3403640768, u64=94758972125120}}], 37, -1) = 1
read(15, "\1\0\0\0\0\0\0\0", 8)         = 8
epoll_ctl(7, EPOLL_CTL_ADD, 14, {EPOLLOUT, {u32=3403651088, u64=94758972135440}}) = 0
timerfd_settime(15, TFD_TIMER_ABSTIME, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=67258, tv_nsec=916684000}}, NULL) = 0
epoll_wait(7, [{EPOLLOUT, {u32=3403651088, u64=94758972135440}}], 37, -1) = 1
sendto(14, "WATCHDOG=1", 10, MSG_DONTWAIT, NULL, 0) = 10
epoll_ctl(7, EPOLL_CTL_DEL, 14, NULL)   = 0
epoll_wait(7,

Every user that logs on always gets the failed status:
systemctl --failed
  UNIT                   LOAD   ACTIVE SUB    DESCRIPTION
● user      loaded failed failed User Manager for UID xxxx
● user      loaded failed failed User Manager for UID yyyy
● user      loaded failed failed User Manager for UID zzzz

Are there any other options in config files that can be set to work around this? Is https://github.com/systemd/systemd/pull/13359 related?

Comment 16 Filip Januš 2019-11-18 10:17:42 UTC
Please can you provide Your whole files: /etc/nsswhich.conf, /etc/yp.conf, /etc/hosts, /etc/pam.d/password-auth ?

Comment 17 RobbieTheK 2019-11-18 14:59:32 UTC
Created attachment 1637343 [details]
requested files in a zip

hosts
nsswitch.conf
password-auth
yp.conf

Comment 18 Filip Januš 2019-11-25 15:53:21 UTC
Thank you for your response, but I am not able to reproduce still this behavior. Are you able to run strace on process which consume memory?

Comment 19 RobbieTheK 2019-11-25 16:13:20 UTC
(In reply to Filip Januš from comment #18)
> Thank you for your response, but I am not able to reproduce still this
> behavior. Are you able to run strace on process which consume memory?

I put a strace previously here: https://bugzilla.redhat.com/show_bug.cgi?id=1764811

And I can reproduce this each time. Here's a strace of systemd
298648 root      20   0   52.2g   4.5g   4772 R  85.0   7.2   0:03.98 (systemd) 

strace -p 298648
strace: Process 298648 attached
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getpid()                                = 298648
setsockopt(5, SOL_IP, IP_RECVERR, [1], 4) = 0
ioctl(5, FIONBIO, [1])                  = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
sendto(5, "]\323\377\206\0\0\0\0\0\0\0\2\0\1\206\240\0\0\0\4\0\0\0\3\0\0\0\0\0\0\0\0"..., 92, 0, {sa_family=AF_INET, sin_port=htons(111), sin_addr=inet_addr("150.108.64.52")}, 16) = 92
poll([{fd=5, events=POLLIN}], 1, 15000) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "]\323\377\206\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\023150."..., 8800, 0, NULL, NULL) = 48
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
close(5)                                = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
getsockname(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getpid()                                = 298648
bind(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getpid()                                = 298648
setsockopt(5, SOL_IP, IP_RECVERR, [1], 4) = 0
ioctl(5, FIONBIO, [1])                  = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
close(4)                                = 0
close(3)                                = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
sendto(5, "]\323\357,\0\0\0\0\0\0\0\2\0\1\206\244\0\0\0\2\0\0\0\3\0\0\0\0\0\0\0\0"..., 80, 0, {sa_family=AF_INET, sin_port=htons(944), sin_addr=inet_addr("150.108.64.52")}, 16) = 80
poll([{fd=5, events=POLLIN}], 1, 15000) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "]\323\357,\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\237"..., 8800, 0, NULL, NULL) = 192
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
close(5)                                = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
openat(AT_FDCWD, "/etc/default/nss", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/sys/kernel/ngroups_max", O_RDONLY) = 3
read(3, "65536\n", 31)                  = 6
close(3)                                = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
openat(AT_FDCWD, "/etc/group", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=1098, ...}) = 0
read(3, "root:x:0:\nbin:x:1:\ndaemon:x:2:\ns"..., 4096) = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
lseek(3, 0, SEEK_CUR)                   = 1098
read(3, "", 4096)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/var/yp/binding/divscimath.3", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=140, ...}) = 0
read(3, "\0\0\0\1\0\0\0\3udp\0\0\0\0\1\0\0\0\1\0\0\0\4inet\0\0\0\3"..., 4096) = 140
openat(AT_FDCWD, "/etc/netconfig", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=767, ...}) = 0
read(4, "#\n# The network configuration fi"..., 4096) = 767
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
getsockname(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getpid()                                = 298648
bind(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getpid()                                = 298648
setsockopt(5, SOL_IP, IP_RECVERR, [1], 4) = 0
ioctl(5, FIONBIO, [1])                  = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
sendto(5, "]\323\311\27\0\0\0\0\0\0\0\2\0\1\206\240\0\0\0\4\0\0\0\3\0\0\0\0\0\0\0\0"..., 92, 0, {sa_family=AF_INET, sin_port=htons(111), sin_addr=inet_addr("150.108.64.52")}, 16) = 92
poll([{fd=5, events=POLLIN}], 1, 15000) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "]\323\311\27\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\023150."..., 8800, 0, NULL, NULL) = 48
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
close(5)                                = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
getsockname(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getpid()                                = 298648
bind(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(5, SOL_SOCKET, SO_TYPE, [2], [4]) = 0
getpid()                                = 298648
setsockopt(5, SOL_IP, IP_RECVERR, [1], 4) = 0
ioctl(5, FIONBIO, [1])                  = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
close(4)                                = 0
close(3)                                = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
close(5)                                = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
openat(AT_FDCWD, "/etc/netconfig", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=767, ...}) = 0
read(3, "#\n# The network configuration fi"..., 4096) = 767
openat(AT_FDCWD, "/etc/services", O_RDONLY|O_CLOEXEC) = 4
lseek(4, 0, SEEK_CUR)                   = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=692241, ...}) = 0
read(4, "# /etc/services:\n# $Id: services"..., 4096) = 4096
lseek(4, 0, SEEK_CUR)                   = 4096
read(4, "deWeb HTTP\nhttp            80/ud"..., 4096) = 4096
close(4)                                = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=124, ...}) = 0
openat(AT_FDCWD, "/etc/hosts", O_RDONLY|O_CLOEXEC) = 4
lseek(4, 0, SEEK_CUR)                   = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=247, ...}) = 0
read(4, "127.0.0.1   localhost localhost."..., 4096) = 247
lseek(4, 0, SEEK_CUR)                   = 247
read(4, "", 4096)                       = 0
close(4)                                = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
getsockname(4, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getsockopt(4, SOL_SOCKET, SO_TYPE, [1], [4]) = 0
getsockname(4, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
getpid()                                = 298648
bind(4, {sa_family=AF_INET, sin_port=htons(752), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
mmap(NULL, 4294967296, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3d3c000000
mmap(NULL, 51539607552, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f313c000000
+++ killed by SIGKILL +++

Comment 20 Filip Januš 2019-11-26 11:00:28 UTC
thanks for strace, now I would need some more detail information like output from pstack/gstack are you able to provide this type of information?

Comment 21 RobbieTheK 2019-11-26 14:46:25 UTC
(In reply to Filip Januš from comment #20)
> thanks for strace, now I would need some more detail information like output
> from pstack/gstack are you able to provide this type of information?

Sure hope this helps:

pstack 323642
#0  0x00007f4b49b2c7ab in pthread_cond_init@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f4b48268c26 in clnt_dg_create () from /lib64/libtirpc.so.3
#2  0x00007f4b48268fa2 in clnt_tli_create () from /lib64/libtirpc.so.3
#3  0x00007f4b4826ffb3 in getclnthandle () from /lib64/libtirpc.so.3
#4  0x00007f4b48270b8e in __rpcb_findaddr_timed () from /lib64/libtirpc.so.3
#5  0x00007f4b48269175 in clnt_tp_create_timed () from /lib64/libtirpc.so.3
#6  0x00007f4b48269329 in clnt_create_timed () from /lib64/libtirpc.so.3
#7  0x00007f4b48296f5b in yp_bind_client_create_v3 () from /lib64/libnsl.so.2
#8  0x00007f4b4829768b in __yp_bind.part.0 () from /lib64/libnsl.so.2
#9  0x00007f4b48297a75 in do_ypcall () from /lib64/libnsl.so.2
#10 0x00007f4b48297c4d in do_ypcall_tr () from /lib64/libnsl.so.2
#11 0x00007f4b4829855c in yp_match () from /lib64/libnsl.so.2
#12 0x00007f4b482b42c0 in _nss_nis_getpwuid_r () from /lib64/libnss_nis.so.2
#13 0x00007f4b4a2ac593 in getpwuid_r@@GLIBC_2.2.5 () from /lib64/libc.so.6
#14 0x00007f4b4a2abc4b in getpwuid () from /lib64/libc.so.6
#15 0x00007f4b49ff5a21 in get_user_creds () from /usr/lib/systemd/libsystemd-shared-243.so
#16 0x000055b68fb14de0 in exec_child.constprop ()
#17 0x000055b68fba4704 in exec_spawn ()
#18 0x000055b68fb6d53d in service_spawn ()
#19 0x000055b68fb72945 in service_enter_start ()
#20 0x000055b68fb72ef8 in service_start.lto_priv ()
#21 0x000055b68fb9b2d4 in job_perform_on_unit.lto_priv ()
#22 0x000055b68fb80112 in manager_dispatch_run_queue ()
#23 0x00007f4b49f91042 in source_dispatch () from /usr/lib/systemd/libsystemd-shared-243.so
#24 0x00007f4b49f914ad in sd_event_dispatch () from /usr/lib/systemd/libsystemd-shared-243.so
#25 0x00007f4b49f91638 in sd_event_run () from /usr/lib/systemd/libsystemd-shared-243.so
#26 0x000055b68fbbf164 in invoke_main_loop.lto_priv ()
#27 0x000055b68fb0cc97 in main ()

gstack 323642&
[1] 323666
[root@newerdos ~]# #0  0x00007f4b49b2c7af in pthread_cond_init@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f4b48268c26 in clnt_dg_create () from /lib64/libtirpc.so.3
#2  0x00007f4b48268fa2 in clnt_tli_create () from /lib64/libtirpc.so.3
#3  0x00007f4b4826ffb3 in getclnthandle () from /lib64/libtirpc.so.3
#4  0x00007f4b48270b8e in __rpcb_findaddr_timed () from /lib64/libtirpc.so.3
#5  0x00007f4b48269175 in clnt_tp_create_timed () from /lib64/libtirpc.so.3
#6  0x00007f4b48269329 in clnt_create_timed () from /lib64/libtirpc.so.3
#7  0x00007f4b48296f5b in yp_bind_client_create_v3 () from /lib64/libnsl.so.2
#8  0x00007f4b4829768b in __yp_bind.part.0 () from /lib64/libnsl.so.2
#9  0x00007f4b48297a75 in do_ypcall () from /lib64/libnsl.so.2
#10 0x00007f4b48297c4d in do_ypcall_tr () from /lib64/libnsl.so.2
#11 0x00007f4b4829855c in yp_match () from /lib64/libnsl.so.2
#12 0x00007f4b482b42c0 in _nss_nis_getpwuid_r () from /lib64/libnss_nis.so.2
#13 0x00007f4b4a2ac593 in getpwuid_r@@GLIBC_2.2.5 () from /lib64/libc.so.6
#14 0x00007f4b4a2abc4b in getpwuid () from /lib64/libc.so.6
#15 0x00007f4b49ff5a21 in get_user_creds () from /usr/lib/systemd/libsystemd-shared-243.so
#16 0x000055b68fb14de0 in exec_child.constprop ()
#17 0x000055b68fba4704 in exec_spawn ()
#18 0x000055b68fb6d53d in service_spawn ()
#19 0x000055b68fb72945 in service_enter_start ()
#20 0x000055b68fb72ef8 in service_start.lto_priv ()
#21 0x000055b68fb9b2d4 in job_perform_on_unit.lto_priv ()
#22 0x000055b68fb80112 in manager_dispatch_run_queue ()
#23 0x00007f4b49f91042 in source_dispatch () from /usr/lib/systemd/libsystemd-shared-243.so
#24 0x00007f4b49f914ad in sd_event_dispatch () from /usr/lib/systemd/libsystemd-shared-243.so
#25 0x00007f4b49f91638 in sd_event_run () from /usr/lib/systemd/libsystemd-shared-243.so
#26 0x000055b68fbbf164 in invoke_main_loop.lto_priv ()
#27 0x000055b68fb0cc97 in main ()


And just to reiterate, this happens every time with a NIS user and I've shared the out of memory (OOM) errors before but happy to do so again.

I noticed in the strace above some "No such file or directory" could those be contributing to this issue?

Comment 22 RobbieTheK 2019-12-09 20:24:58 UTC
Is there anything else I can provide?

Comment 23 Filip Januš 2019-12-16 15:02:47 UTC
Message "No such file or directory" I didn't find problematic, because if it was critical issue, it should exit with some error message, but here it runs forward and this "problematic" socket was closed. I was wondering about this issue and I tried to create nis-network on machines which dispose huge amount of memory. But all my effort ends up with same result. Everything works fine without weird process. Did you try to reproduce this issue in some virtual environment?

Comment 24 RobbieTheK 2019-12-16 15:34:15 UTC
(In reply to Filip Januš from comment #23)
> Did you try to reproduce this issue in
> some virtual environment?

No I'm just logging in via ssh from another server that is in NIS and working fine. 

Just did some more testing. One server had/has NSCD enabled and running. No memory spike, no systemd spike in utilization. On the servers where nscd was disabled/not running, both had the systemd spike and slow login. So as a work around, I've enabled/started nscd on the other servers. Or is this the solution (rather than a workaround)?

Comment 25 Jim Bodie 2019-12-16 22:18:17 UTC
(In reply to RobbieTheK from comment #24)
> 
> No I'm just logging in via ssh from another server that is in NIS and
> working fine. 
> 
> Just did some more testing. One server had/has NSCD enabled and running. No
> memory spike, no systemd spike in utilization. On the servers where nscd was
> disabled/not running, both had the systemd spike and slow login. So as a
> work around, I've enabled/started nscd on the other servers. Or is this the
> solution (rather than a workaround)?

Here's an extra data point for you all.  I saw this problem in Fedora 30 and I now see it in Fedora 31.  Based on comment #24, I installed and started nscd and the problem went away for me too!  Thank you RobbieTheK for the tip.

Comment 26 JM 2019-12-17 16:04:16 UTC
Can't confirm this. nscd (with enable-cache group yes) is enabled and the problem is still there. My workaround is to disable (for nis) the most services and this way the memory spikes are gone. In the moment only automount, group, shadow, passwd is enabled for nis.

Comment 27 Filip Januš 2020-01-28 13:26:16 UTC
I tried to find some solution, but without working reproducer I can't test my ideas. I found some potentially problematic parts of code. Now I would like to test if the bug still persist after install this package. 

https://fjanus.fedorapeople.org/libnsl2-1.2.0-5.20180605git4a062cf.fc30.x86_64.rpm. 

Is he somebody able to test it?
But I would like point out that this isn't final fix even if it would work.

Comment 28 Phil! Gold 2020-01-31 16:04:09 UTC
I'm running Fedora 31 and have the same problem[0].  Installing Filip Januš's libnsl2 RPM did not fix anything.  (I installed the RPM and then rebooted the system.  After it came back up, all of the user-changing services I tried (colord, mariadb, user@<uid>) exhibited the same behavior (running continuously, using 100% of one CPU core, continually increasing memory usage until killed).)


[0] Oddly, only on two of my 18 systems using Fedora 31 and NIS.  On the others, I get a different error that seems more in line with systemd issue #12702 (https://github.com/systemd/systemd/issues/12702)

Comment 29 Filip Januš 2020-02-03 07:48:59 UTC
Thanks a lot for Your feedback, so it wasn't right way. So please can you provide output of weird process from pmap? Or if some were able to create virtual machine image or docker image with odd process consuming GBs of memory, it would be very helpful.

Comment 30 John Kissane 2020-02-04 09:58:09 UTC
Just run into this issue when installing Fedora 30 on a high spec Dell PC - 64Gb Ram & Intel I7 CPU. systemd looks to try an consume all memory so PC is unusable. We use NIS so similar environment.


  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                  
 6987 root      20   0  104.2g  53.4g   4612 R  99.7  85.3   0:16.59 (systemd)          

The strange thing is that I haven't encountered this on lower spec PC's built using the same kickstart script. 

Another bug mentioned enable nscd as a possible fix so I'm going to try that next -    https://bugzilla.redhat.com/show_bug.cgi?id=1705641

Comment 31 Filip Januš 2020-04-22 10:50:51 UTC

*** This bug has been marked as a duplicate of bug 1705641 ***

Comment 32 Thomas Clark 2020-06-18 19:53:47 UTC
I just did a fresh install of F32 on an Intel NUC 10. The moment I ran authselect select nis, I began to see exactly what others in the two related bug threads have seen--high system load, long delays, and systemd eating up all 32 GB of RAM.  The bug still exists in F32.