In some cases 'userdel -r' allocate infinite amount of memory and then fail. This is long standing bug as I saw this behavior years ago so I think it is not introduced by recent patches. # userdel -r kp & # ps xaumOT | grep userde[l] (repeated) root 20333 28.0 39.6 450484 406740 pts/1 - 09:34 0:06 userdel -r kp root 20333 27.7 45.8 513536 469840 pts/1 - 09:34 0:07 userdel -r kp root 20333 27.9 51.0 567848 524064 pts/1 - 09:34 0:08 userdel -r kp ... malloc(664) failed #
Created attachment 118542 [details] strace of infinite loop in 'userdel -r kp' The bug does not depend on '-r' switch.
Hm. When I manually deleted this user I found that there was no record in the /etc/gshadow file. Maybe this was lost when the system has been moved to another machine or so.
I can't reproduce it. I deleted(userdel) user foo after group foo had been removed from /etc/gshadow and I got "userdel: error removing shadow group entry" but user foo was removed properly.
Did u have two lines begining with same group name in /etc/group? example: #/etc/group groupa:x:998:user1,user2 groupa:x:998:user3,user4 #/etc/passwd user4:x:1773:998::/wic/home/user4:/bin/bash "$userdel user4" spin in infinite loop now.