Bug#212541: marked as done (libc6: Group with many users makes processes loop and consume all memory)
Your message dated Fri, 31 Oct 2003 10:17:13 -0500
with message-id <20031031151713.GA32614@nevyn.them.org>
and subject line Now closed in unstable
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 24 Sep 2003 08:49:57 +0000
>From sgybas@debian.org Wed Sep 24 03:49:55 2003
Return-path: <sgybas@debian.org>
Received: from sunflower.provective.de [62.96.68.209]
by master.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1A25LP-00077o-00; Wed, 24 Sep 2003 03:49:55 -0500
Received: from localhost ([127.0.0.1])
by sunflower.provective.de with esmtp (Exim 4.22)
id 1A25LO-0007bs-GF
for submit@bugs.debian.org; Wed, 24 Sep 2003 10:49:54 +0200
Received: from sunflower.provective.de ([127.0.0.1])
by localhost (sunflower.provective.de [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 29194-03 for <submit@bugs.debian.org>;
Wed, 24 Sep 2003 10:49:54 +0200 (CEST)
Received: from pd9e6184f.dip.t-dialin.net ([217.230.24.79] helo=debian.org)
by sunflower.provective.de with asmtp (Exim 4.22)
id 1A25LN-0007bl-Ao
for submit@bugs.debian.org; Wed, 24 Sep 2003 10:49:53 +0200
Message-ID: <3F715AB2.8010101@debian.org>
Date: Wed, 24 Sep 2003 10:49:54 +0200
From: Stefan Gybas <sgybas@debian.org>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213
X-Accept-Language: en, de
MIME-Version: 1.0
To: submit@bugs.debian.org
Subject: libc6: Group with many users makes processes loop and consume all
memory
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-2.8 required=4.0
tests=BAYES_70,HAS_PACKAGE,RCVD_IN_NJABL
version=2.53-bugs.debian.org_2003_9_21
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_9_21 (1.174.2.15-2003-03-30-exp)
Package: libc6
Version: 2.3.2-8
Severity: critical
Tags: sarge sid
When I create a group with a lot of users some processes loop trying to
parse /etc/group and consume all available memory until they are killed.
You can reproduce this the following way:
# (echo -n testgrp1:x:65530:; for i in `seq 92`; do echo -n user$i,;
done; echo root) >> /etc/group
# grep testgrp1 /etc/group | wc
1 1 657
Then try to change the group of a file to a group that does not exist:
# touch /tmp/grptest1
# strace chgrp doesnotexist /tmp/grptest1 2>strace.log
The process is consuming all CPU time and using more and more memory.
strace.log shows that it is always repeating these steps:
open("/etc/group", O_RDONLY) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
_llseek(3, 0, [0], SEEK_CUR) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=2879, ...}) = 0
mmap2(NULL, 2879, PROT_READ, MAP_SHARED, 3, 0) = 0x40016000
_llseek(3, 2879, [2879], SEEK_SET) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=2879, ...}) = 0
munmap(0x40016000, 2879) = 0
close(3) = 0
When the group does exist, chgrp works fine. If you remove the root user
from the testgrp1 it also works again:
# chgrp testgrp1 /tmp/grptest1
# vi /etc/group # remove root from testgrp1
# grep testgrp1 /etc/group | wc
1 1 652
# chgrp doesnotexist /tmp/grptest1
chgrp: invalid group name `doesnotexist'
The problem doesn't seem to be the number of users in a group, it looks
like it's the length of a line in /etc/group. For example, creating a
group with 26 long user names also triggers the problem:
# (echo -n testgrp2:x:65531:; for i in `seq 26`; do echo -n
someusersmighthaveaprettylongname$i,; done; echo root) >> /etc/group
# grep testgrp2 /etc/group | wc
1 1 949
Removing the "someusersmighthaveaprettylongname26" user also makes the
problem disappear:
# grep testgrp2 /etc/group | wc
1 1 913
The problem is not only triggered in chgrp, but also in ls, tar, mysql
and other programs that might look up non existing groups in /etc/group:
# touch /tmp/grptest2
# chgrp 65532 /tmp/grptest2
Add a long line to /etc/group (as above), gid 65532 must not exist:
# ls -l
I can reproduce this on a testing machine running
kernel-image-2.4.22-1-k7 and libc6 2.3.2-7 and also on an unstable
system running kernel 2.4.22-3um (User Mode Linux) and libc6 2.3.2-8.
The problem did not occur with glibc 2.3.1 which has been in testing before.
(Serverity critical because it breaks the whole system and might cause
data loss if the kernel's OOM handler kills the "wrong" processes.)
---------------------------------------
Received: (at 208428-done) by bugs.debian.org; 31 Oct 2003 15:17:14 +0000
>From drow@crack.them.org Fri Oct 31 09:17:14 2003
Return-path: <drow@crack.them.org>
Received: from nevyn.them.org [66.93.172.17]
by master.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1AFb1V-0000wj-00; Fri, 31 Oct 2003 09:17:13 -0600
Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian))
id 1AFb1V-0008Ul-3y; Fri, 31 Oct 2003 10:17:13 -0500
Date: Fri, 31 Oct 2003 10:17:13 -0500
From: Daniel Jacobowitz <dan@debian.org>
To: 208428-done@bugs.debian.org, 212541-done@bugs.debian.org
Subject: Now closed in unstable
Message-ID: <20031031151713.GA32614@nevyn.them.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.1i
Delivered-To: 208428-done@bugs.debian.org
X-Spam-Status: No, hits=0.0 required=4.0
tests=none
version=2.53-bugs.debian.org_2003_10_31
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_10_31 (1.174.2.15-2003-03-30-exp)
These bugs were fixed in glibc 2.3.2.ds1-1 in experimental, and now in
2.3.2.ds1-8 in unstable.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
Reply to: