Problems with latest coreutils (6.5)
Hi, I have problems with ls in the latest coreutils, it segfaults when doing ls -l in a directory containing a file with an "unknown" uid: root@islay(1:580)~> touch foo root@islay(1:581)~> ls -l total 136 drwxr-xr-x 5 root root 120 2005-05-21 16:28 GNUstep drwxr-xr-x 2 root root 304 2006-11-01 16:58 bin -rw-r--r-- 1 root root 124296 2004-10-29 23:02 capture.tgz lrwxrwxrwx 1 root root 13 2005-02-14 16:12 el -> /home/tom/el/ -rw-r--r-- 1 root root 0 2006-11-21 19:17 foo -rw-r--r-- 1 root root 147 2006-11-19 11:49 revdep.txt -rw-r--r-- 1 root root 7487 2006-11-18 17:44 revdep.txt~ root@islay(1:582)~> chown 500.500 foo root@islay(1:583)~> ls -l Segmentation fault root@islay(1:584)~> pkgadd -u /usr/ports/core/coreutils/coreutils#6.4-1.pkg.tar.gz root@islay(1:585)~> ls -l total 136 drwxr-xr-x 5 root root 120 2005-05-21 16:28 GNUstep drwxr-xr-x 2 root root 304 2006-11-01 16:58 bin -rw-r--r-- 1 root root 124296 2004-10-29 23:02 capture.tgz lrwxrwxrwx 1 root root 13 2005-02-14 16:12 el -> /home/tom/el/ -rw-r--r-- 1 500 500 0 2006-11-21 19:17 foo -rw-r--r-- 1 root root 147 2006-11-19 11:49 revdep.txt -rw-r--r-- 1 root root 7487 2006-11-18 17:44 revdep.txt~ root@islay(1:586)~> I can reproduce this on at least three (all that I've tried) machines, so it is not just something wrong with my machine. As you can see the problem does not exist in coreutils 6.4. Before diving into a debugging session it would be good to know if anyone else has this problem, or if it is something in my setup. -- Hälsningar/Best regards, Tom ________________________________________________________________________ Tom Rindborg Phone: +46-8-599 984 40 Stockholm, Sweden MailTo:Tom.Rindborg@fatburen.org "If you have to hate, hate gently."
*Tom Rindborg:
Hi,
I have problems with ls in the latest coreutils, it segfaults when doing ls -l in a directory containing a file with an "unknown" uid:
It's gid, actually. Unknown uid should work fine, but not as expected. A quick patch (copy-paste from the uid-function): --- coreutils-6.5/lib/idcache.c 2006-11-07 15:42:11.000000000 +0100 +++ coreutils-6.5/lib/idcache.c.new 2006-11-21 20:11:00.000000000 +0100 @@ -142,7 +142,7 @@ return tail->name; grent = getgrgid (gid); - name = grent ? grent->gr_name : NULL; + name = grent ? grent->gr_name : ""; tail = xmalloc (offsetof (struct userid, name) + strlen (name) + 1); tail->id.g = gid; strcpy (tail->name, name); -- Robert Bauck Hamar Der er to regler for suksess: 1. Fortell aldri alt du vet. – Roger H. Lincoln
On Tue, 21 Nov 2006, Robert Bauck Hamar wrote:
*Tom Rindborg:
Hi,
I have problems with ls in the latest coreutils, it segfaults when doing ls -l in a directory containing a file with an "unknown" uid:
It's gid, actually. Unknown uid should work fine, but not as expected. A quick patch (copy-paste from the uid-function):
--- coreutils-6.5/lib/idcache.c 2006-11-07 15:42:11.000000000 +0100 +++ coreutils-6.5/lib/idcache.c.new 2006-11-21 20:11:00.000000000 +0100 @@ -142,7 +142,7 @@ return tail->name; grent = getgrgid (gid); - name = grent ? grent->gr_name : NULL; + name = grent ? grent->gr_name : ""; tail = xmalloc (offsetof (struct userid, name) + strlen (name) + 1); tail->id.g = gid; strcpy (tail->name, name);
Thanks for investigating, and you are right, this certainly does not work as expected... ;-) Investigating a little further this seems to be a known problem: http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00152.html I will stay with 6.4 for the time being awaiting a fix. -- Hälsningar/Best regards, Tom ________________________________________________________________________ Tom Rindborg Phone: +46-8-599 984 40 Stockholm, Sweden MailTo:Tom.Rindborg@fatburen.org "If you have to hate, hate gently."
On Tue, 21 Nov 2006 21:27:34 +0100 (CET) Tom Rindborg wrote:
On Tue, 21 Nov 2006, Robert Bauck Hamar wrote:
*Tom Rindborg:
Hi,
I have problems with ls in the latest coreutils, it segfaults when doing ls -l in a directory containing a file with an "unknown" uid:
It's gid, actually. Unknown uid should work fine, but not as expected. A quick patch (copy-paste from the uid-function):
--- coreutils-6.5/lib/idcache.c 2006-11-07 15:42:11.000000000 +0100 +++ coreutils-6.5/lib/idcache.c.new 2006-11-21 20:11:00.000000000 +0100 @@ -142,7 +142,7 @@ return tail->name; grent = getgrgid (gid); - name = grent ? grent->gr_name : NULL; + name = grent ? grent->gr_name : ""; tail = xmalloc (offsetof (struct userid, name) + strlen (name) + 1); tail->id.g = gid; strcpy (tail->name, name);
Thanks for investigating, and you are right, this certainly does not work as expected... ;-)
Investigating a little further this seems to be a known problem:
http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00152.html
I will stay with 6.4 for the time being awaiting a fix.
Patch got committed to Arch's CVS just a little while ago, here's the link: http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/*checkout*/base/coreutils/ls.patch?rev=HEAD&cvsroot=Current&only_with_tag=CURRENT&content-type=text/plain -- ~predatorfreak GnuPG Public key: http://pred.dcaf-security.org/dcafsec-pub-gpgkey.asc
On Tue, Nov 21, 2006 at 07:31:46PM +0100, Tom Rindborg wrote:
Hi,
Hello Tom,
I have problems with ls in the latest coreutils, it segfaults when doing ls -l in a directory containing a file with an "unknown" uid:
Thanks for your bug report. I've just applied and committed the published patch [1]. regards Juergen [1] http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00153.html -- Juergen Daubert | mailto:jue@jue.li Korb, Germany | http://jue.li/crux
Thanks for your bug report. I've just applied and committed the published patch [1].
regards Juergen
[1] http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00153.html
The coreutils-team has released [1] a replacement for 6.5. [1] http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00191.html Cheers -- Fredrik Rinnestam
participants (5)
-
Brett Goulder
-
Fredrik Rinnestam
-
Juergen Daubert
-
Robert Bauck Hamar
-
Tom Rindborg