Debian Bug report logs - #573940
coreutils: rm -r doesn't work on kfreebsd-i386

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <mstone@debian.org>; Source for coreutils is src:coreutils.

Reported by: Christian Marillat <marillat@debian.org>

Date: Mon, 15 Mar 2010 08:18:01 UTC

Severity: important

Found in version coreutils/8.4-2

Fixed in version coreutils/8.5-1

Done: Michael Stone <mstone@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Mon, 15 Mar 2010 08:18:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Marillat <marillat@debian.org>:
New Bug report received and forwarded. Copy sent to Michael Stone <mstone@debian.org>. (Mon, 15 Mar 2010 08:18:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Christian Marillat <marillat@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Mon, 15 Mar 2010 09:14:35 +0100
Package: coreutils
Version: 8.4-2
Severity: important

Hi,

With this version the -r option doesn't work :

$ rm -rf transcode-1.1.5        
rm: cannot remove `transcode-1.1.5/docs': Operation not permitted
rm: cannot remove `transcode-1.1.5/avilib': Operation not permitted
rm: cannot remove `transcode-1.1.5/libtcaudio': Operation not permitted
rm: cannot remove `transcode-1.1.5/filter': Operation not permitted
rm: cannot remove `transcode-1.1.5/tools': Operation not permitted
rm: cannot remove `transcode-1.1.5/export': Operation not permitted
rm: cannot remove `transcode-1.1.5/multiplex': Operation not permitted
rm: cannot remove `transcode-1.1.5/autotools': Operation not permitted



Christian

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 7.2-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages coreutils depends on:
ii  libc0.1                       2.10.2-6   Embedded GNU C Library: Shared lib

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Mon, 15 Mar 2010 08:48:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bob Proulx <bob@proulx.com>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Mon, 15 Mar 2010 08:48:07 GMT) Full text and rfc822 format available.

Message #10 received at 573940@bugs.debian.org (full text, mbox):

From: Bob Proulx <bob@proulx.com>
To: Christian Marillat <marillat@debian.org>, 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Mon, 15 Mar 2010 02:46:18 -0600
Christian Marillat wrote:
> With this version the -r option doesn't work :
> 
> $ rm -rf transcode-1.1.5        
> rm: cannot remove `transcode-1.1.5/docs': Operation not permitted
> rm: cannot remove `transcode-1.1.5/avilib': Operation not permitted
> rm: cannot remove `transcode-1.1.5/libtcaudio': Operation not permitted
> rm: cannot remove `transcode-1.1.5/filter': Operation not permitted
> rm: cannot remove `transcode-1.1.5/tools': Operation not permitted
> rm: cannot remove `transcode-1.1.5/export': Operation not permitted
> rm: cannot remove `transcode-1.1.5/multiplex': Operation not permitted
> rm: cannot remove `transcode-1.1.5/autotools': Operation not permitted

Thank you for the report.  However more information will be needed to
know if this is a bug in rm or a different problem.  Please provide
the following information.

  $ df -PT transcode-1.1.5

  $ lsattr -a transcode-1.1.5

  $ ls -la transcode-1.1.5

  $ id

Note that if an 'i' (immutable) attribute has been set then you must
use 'chattr' to remove it before being able to remove, rename or
modify the file.

Thanks
Bob




Added tag(s) moreinfo. Request was from Bob Proulx <bob@proulx.com> to control@bugs.debian.org. (Mon, 15 Mar 2010 09:18:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Mon, 15 Mar 2010 09:21:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Marillat <marillat@debian.org>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Mon, 15 Mar 2010 09:21:07 GMT) Full text and rfc822 format available.

Message #17 received at 573940@bugs.debian.org (full text, mbox):

From: Christian Marillat <marillat@debian.org>
To: Bob Proulx <bob@proulx.com>
Cc: 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Mon, 15 Mar 2010 10:17:39 +0100
Bob Proulx <bob@proulx.com> writes:

[...]

> Thank you for the report.  However more information will be needed to
> know if this is a bug in rm or a different problem.  Please provide
> the following information.
>
>   $ df -PT transcode-1.1.5

Filesystem    Type 1024-blocks      Used Available Capacity Mounted on
/dev/ad0s1     ufs     9664604   1672896   7218540      19% /

>   $ lsattr -a transcode-1.1.5

$ lsattr -a transcode-1.1.5
------------------- transcode-1.1.5/.
------------------- transcode-1.1.5/..
------------------- transcode-1.1.5/libdldarwin
------------------- transcode-1.1.5/libtcvideo
------------------- transcode-1.1.5/docs
------------------- transcode-1.1.5/ChangeLog
------------------- transcode-1.1.5/avilib
------------------- transcode-1.1.5/transcode.spec.in
------------------- transcode-1.1.5/libtcaudio
------------------- transcode-1.1.5/filter
------------------- transcode-1.1.5/Makefile.in
------------------- transcode-1.1.5/configure
------------------- transcode-1.1.5/config.h.in
------------------- transcode-1.1.5/tools
------------------- transcode-1.1.5/export
------------------- transcode-1.1.5/multiplex
------------------- transcode-1.1.5/Makefile.am
------------------- transcode-1.1.5/autotools
------------------- transcode-1.1.5/README
------------------- transcode-1.1.5/acinclude.m4
------------------- transcode-1.1.5/aclocal.m4
------------------- transcode-1.1.5/TODO
------------------- transcode-1.1.5/INSTALL
------------------- transcode-1.1.5/STYLE
------------------- transcode-1.1.5/AUTHORS
------------------- transcode-1.1.5/encode
------------------- transcode-1.1.5/testsuite
------------------- transcode-1.1.5/src
------------------- transcode-1.1.5/configure.in
------------------- transcode-1.1.5/COPYING
------------------- transcode-1.1.5/libtc
------------------- transcode-1.1.5/import
------------------- transcode-1.1.5/pvm3
------------------- transcode-1.1.5/aclib

>   $ ls -la transcode-1.1.5

total 1786
drwxr-xr-x 19 marillat marillat    1024 2009-10-31 18:41 .
drwxr-xr-x  9 marillat marillat    2048 2010-03-15 11:11 ..
-rw-r--r--  1 marillat marillat   21857 2009-10-31 17:39 acinclude.m4
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 aclib
-rw-r--r--  1 marillat marillat  279009 2009-10-31 18:40 aclocal.m4
-rw-r--r--  1 marillat marillat    4968 2009-02-21 15:34 AUTHORS
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 autotools
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 avilib
-rw-r--r--  1 marillat marillat    2495 2009-10-31 18:40 ChangeLog
-rw-r--r--  1 marillat marillat    9137 2009-10-31 18:40 config.h.in
-rwxr-xr-x  1 marillat marillat 1266525 2009-10-31 18:40 configure
-rw-r--r--  1 marillat marillat   42524 2009-10-31 17:39 configure.in
-rw-r--r--  1 marillat marillat   18007 2009-02-21 15:34 COPYING
drwxr-xr-x  6 marillat marillat    1536 2009-10-31 18:41 docs
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 encode
drwxr-xr-x  2 marillat marillat    1536 2009-10-31 18:41 export
drwxr-xr-x  9 marillat marillat    2048 2009-10-31 18:41 filter
drwxr-xr-x  5 marillat marillat    3072 2009-10-31 18:41 import
-rw-r--r--  1 marillat marillat   18652 2009-10-31 18:02 INSTALL
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 libdldarwin
drwxr-xr-x  2 marillat marillat    1024 2009-10-31 18:41 libtc
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 libtcaudio
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 libtcvideo
-rw-r--r--  1 marillat marillat     448 2009-02-21 22:01 Makefile.am
-rw-r--r--  1 marillat marillat   24847 2009-10-31 18:41 Makefile.in
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 multiplex
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 pvm3
-rw-r--r--  1 marillat marillat    2244 2009-02-21 15:34 README
drwxr-xr-x  2 marillat marillat    1024 2009-10-31 18:41 src
-rw-r--r--  1 marillat marillat   17906 2009-02-21 15:34 STYLE
drwxr-xr-x  2 marillat marillat    1024 2009-10-31 18:41 testsuite
-rw-r--r--  1 marillat marillat     107 2009-02-21 15:34 TODO
drwxr-xr-x  2 marillat marillat     512 2009-10-31 18:41 tools
-rw-r--r--  1 marillat marillat    4045 2009-02-21 15:34 transcode.spec.in

>   $ id

uid=1000(marillat) gid=1000(marillat) groups=1000(marillat),20(dialout),24(cdrom),25(floppy),29(audio),44(video),46(plugdev)

> Note that if an 'i' (immutable) attribute has been set then you must
> use 'chattr' to remove it before being able to remove, rename or
> modify the file.

FYI downgrading to 7.4-2 solve this bug.

Christian




Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Mon, 15 Mar 2010 09:54:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bob Proulx <bob@proulx.com>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Mon, 15 Mar 2010 09:54:10 GMT) Full text and rfc822 format available.

Message #22 received at 573940@bugs.debian.org (full text, mbox):

From: Bob Proulx <bob@proulx.com>
To: Christian Marillat <marillat@debian.org>, 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Mon, 15 Mar 2010 03:50:10 -0600
Christian Marillat wrote:
> Bob Proulx writes:
> > Thank you for the report.  However more information will be needed to
> > know if this is a bug in rm or a different problem.  Please provide
> > the following information.
> ...
> $ lsattr -a transcode-1.1.5

I was really expecting to see that some files were set immutable.
It is the usual cause of "Operation not permitted". :-/

The next bit of information would be to strace the command to see what
the system returns.  Could you try this and report back on what you
find?  The -e trace=file restricts the run to file related system
calls.  If that doesn't happen to show anything interesting please run
it without that restriction.  It just keeps the noise down.

  $ strace -v -e trace=file -o /tmp/rm-strace.out rm -rf transcode-1.1.5

I am expecting to see something like this:

  unlinkat(3, "somefile", 0)                    = 0

But obviously it will be something different in your case.

> FYI downgrading to 7.4-2 solve this bug.

Hmm...

Thanks,
Bob




Removed tag(s) moreinfo. Request was from Bob Proulx <bob@proulx.com> to control@bugs.debian.org. (Mon, 15 Mar 2010 09:54:11 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#573940; Package coreutils. (Mon, 15 Mar 2010 12:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stone <mstone@debian.org>:
Extra info received and forwarded to list. (Mon, 15 Mar 2010 12:15:03 GMT) Full text and rfc822 format available.

Message #29 received at 573940@bugs.debian.org (full text, mbox):

From: Michael Stone <mstone@debian.org>
To: Christian Marillat <marillat@debian.org>, 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Mon, 15 Mar 2010 08:11:32 -0400
On Mon, Mar 15, 2010 at 09:14:35AM +0100, Christian Marillat wrote:
>Kernel: kFreeBSD 7.2-1-686

And if you upgrade to the current kernel?

Mike Stone




Reply sent to Christian Marillat <marillat@debian.org>:
You have taken responsibility. (Mon, 15 Mar 2010 14:30:13 GMT) Full text and rfc822 format available.

Notification sent to Christian Marillat <marillat@debian.org>:
Bug acknowledged by developer. (Mon, 15 Mar 2010 14:30:13 GMT) Full text and rfc822 format available.

Message #34 received at 573940-done@bugs.debian.org (full text, mbox):

From: Christian Marillat <marillat@debian.org>
To: Michael Stone <mstone@debian.org>, Bob Proulx <bob@proulx.com>
Cc: 573940-done@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Mon, 15 Mar 2010 15:29:15 +0100
Michael Stone <mstone@debian.org> writes:

> On Mon, Mar 15, 2010 at 09:14:35AM +0100, Christian Marillat wrote:
>>Kernel: kFreeBSD 7.2-1-686
>
> And if you upgrade to the current kernel?

Certainly a good idea. This bug is gone.

Christian




Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Tue, 16 Mar 2010 16:15:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Wilk <jwilk@debian.org>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Tue, 16 Mar 2010 16:15:11 GMT) Full text and rfc822 format available.

Message #39 received at 573940@bugs.debian.org (full text, mbox):

From: Jakub Wilk <jwilk@debian.org>
To: 573940@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Tue, 16 Mar 2010 17:13:11 +0100
[Message part 1 (text/plain, inline)]
reopen 573940 
thanks

I dare to reopen this bug, as I believe that coreutils should support 
all kernels available in unstable (and FreeBSD 7 is one of them).

Here's the easiest way to reproduce this bug:

$ mkdir -p a/b/{c,d} 
$ rm -Rf a/
rm: cannot remove `a/b': Operation not permitted

The attachment contains ktrace output.

-- System Information:
Debian Release: squeeze/sid
 APT prefers unstable
 APT policy: (500, 'unstable')
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 7.2-1-686
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages coreutils depends on:
ii  libc0.1                       2.10.2-6   Embedded GNU C Library: Shared lib

-- 
Jakub Wilk
[kdump (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 16 Mar 2010 16:15:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#573940; Package coreutils. (Tue, 16 Mar 2010 17:03:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stone <mstone@debian.org>:
Extra info received and forwarded to list. (Tue, 16 Mar 2010 17:03:05 GMT) Full text and rfc822 format available.

Message #46 received at 573940@bugs.debian.org (full text, mbox):

From: Michael Stone <mstone@debian.org>
To: Jakub Wilk <jwilk@debian.org>, 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Tue, 16 Mar 2010 13:00:56 -0400
I will add a dependency on the newer kernel and then downgrade the bug 
to wishlist. For anything more than that, someone who actually uses and 
wants a different kfreebsd kernel will have to figure out what's going 
on. There's already been a delay of months holding up a newer coreutils 
being available for every other arch, largely due to issues on kfreebsd, 
and I just don't have the resources available to debug it. (I've spent 
hours building test vm's, waiting for builds, trying to isolate issues, 
throwing that work to the side to watch everything magically work with a 
kernel upgrade, etc.) 

Mike Stone




Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Tue, 16 Mar 2010 22:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Wilk <jwilk@debian.org>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Tue, 16 Mar 2010 22:30:06 GMT) Full text and rfc822 format available.

Message #51 received at 573940@bugs.debian.org (full text, mbox):

From: Jakub Wilk <jwilk@debian.org>
To: debian-bsd@lists.debian.org
Cc: 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Tue, 16 Mar 2010 23:28:23 +0100
[Message part 1 (text/plain, inline)]
Dear debian-bsd@ readers,

I'd like to draw your attention to this coreutils bug, which happens to 
trigger on kFreeBSD 7:

| $ mkdir -p a/b/{c,d}
| $ rm -Rf a/
| rm: cannot remove `a/b': Operation not permitted

My not entirely fruitful debugging showed that something icky happens in 
line 75 of src/remove.c:

if (st->st_size == -1 && fstatat (fd, file, st, flag) != 0)

The relevant part of ktrace output, which does make no sense at all to 
me, is:

|  2676 rm       CALL  __sysctl(0xbfbfe628,0x4,0,0xbfbfe638,0,0)
|  2676 rm       RET   __sysctl 0
|  2676 rm       CALL  __sysctl(0xbfbfe628,0x4,0xbfbfdce0,0xbfbfe638,0,0)
|  2676 rm       RET   __sysctl 0
|  2676 rm       CALL  lstat(0xbfbfe5a8,0xbfbfdc50)
|  2676 rm       NAMI  "-/b"
|  2676 rm       RET   lstat -1 errno 2 No such file or directory

(Note, that it's "-/b", not "a/b".)

Also, it might be interesting that:
- The problem goes away if coreutils is compiled with -O0.
- Despite fstatat() being not detected at configure time, rm uses the 
__fxstatat symbol.

[I'm not subscribed to the list, please cc the bug report.]

-- 
Jakub Wilk
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Thu, 18 Mar 2010 19:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Wilk <jwilk@debian.org>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Thu, 18 Mar 2010 19:33:03 GMT) Full text and rfc822 format available.

Message #56 received at 573940@bugs.debian.org (full text, mbox):

From: Jakub Wilk <jwilk@debian.org>
To: debian-bsd@lists.debian.org, 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Thu, 18 Mar 2010 20:29:34 +0100
[Message part 1 (text/plain, inline)]
* Petr Salinger <Petr.Salinger@seznam.cz>, 2010-03-18, 19:05:
>>Also, it might be interesting that:
>>- Despite fstatat() being not detected at configure time, rm uses 
>>the __fxstatat symbol.
>
>This seems to be the key point.
>
>The FreeBSD 7.x kernel does not have the *at syscalls, only limited         
>emulation is available in our glibc in this case.
>Under 8.x kernel *at syscalls are native and are used directly,
>we have runtime detection in our glibc.
>As we still want to support both kernel versions (7.x and 8.x) for 
>now, all *at syscalls are marked as stubs in glibc (see i.e. 
><gnu/stubs-32.h>). Therefore the coreutils (and any gnulib user) 
>should not use them at all.
>
>Unfortunately the *stat{,at} functions are in glibc implemented via         
>*xstat{,at} and the *stat{,at} functions are inline's  which calls 
>*xstat{,at},
>see * <sys/stat.h> on any glibc system :-(

I think this issue could be worked around, though in a ugly way. 
Wouldn't the attached patch do the trick? (Sorry, no time to test it 
properly myself.)

-- 
Jakub Wilk
[573940.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Thu, 18 Mar 2010 20:33:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Thu, 18 Mar 2010 20:33:05 GMT) Full text and rfc822 format available.

Message #61 received at 573940@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Jakub Wilk <jwilk@debian.org>
Cc: 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Thu, 18 Mar 2010 21:31:31 +0100 (CET)
> I think this issue could be worked around, though in a ugly way. 
> Wouldn't the attached patch do the trick? (Sorry, no time to test it 
> properly myself.)

Seems be fine, at least for coreutils build under 7.2 kfreebsd-amd64.
In any case, it would be improvement.

Petr




Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Fri, 26 Mar 2010 11:03:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Fri, 26 Mar 2010 11:03:06 GMT) Full text and rfc822 format available.

Message #66 received at 573940@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: 573940@bugs.debian.org
Subject: Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386
Date: Fri, 26 Mar 2010 14:05:35 +0100 (CET)
The mesage bellow didn't yet appear in this bug report, resending.
http://lists.debian.org/debian-bsd/2010/03/msg00046.html

------------
Hi all,

to provide better picture I slightly played with order of lines from 
original message.

> I'd like to draw your attention to this coreutils bug, which happens to
> trigger on kFreeBSD 7:
>
> | $ mkdir -p a/b/{c,d}
> | $ rm -Rf a/
> | rm: cannot remove `a/b': Operation not permitted

> Also, it might be interesting that:
> - Despite fstatat() being not detected at configure time, rm uses the
> __fxstatat symbol.

This seems to be the key point.

The FreeBSD 7.x kernel does not have the *at syscalls, only limited
emulation is available in our glibc in this case.
Under 8.x kernel *at syscalls are native and are used directly,
we have runtime detection in our glibc.
As we still want to support both kernel versions (7.x and 8.x) for now,
all *at syscalls are marked as stubs in glibc (see i.e. <gnu/stubs-32.h>).
Therefore the coreutils (and any gnulib user) should not use them at all.

Unfortunately the *stat{,at} functions are in glibc implemented via
*xstat{,at} and the *stat{,at} functions are inline's which calls 
*xstat{,at}, see * <sys/stat.h> on any glibc system :-(

The "rm" ended up using the glibc one's even iff they are marked as stubs 
:-(.

The "rm" part of coreutils have been rewritten in 8.x series
and the gnulib replacement are not used.

> Also, it might be interesting that:
> - The problem goes away if coreutils is compiled with -O0.

The inline-ing does not happen in this case and the used fstatat()
comes from gnulib, i.e. no native ENOSYS call ...

> My not entirely fruitful debugging showed that something icky happens in
> line 75 of src/remove.c:
>
> if (st->st_size == -1 && fstatat (fd, file, st, flag) != 0)
>
> The relevant part of ktrace output, which does make no sense at all to
> me, is:

For the code under it see
http://svn.debian.org/wsvn/glibc-bsd/trunk/glibc-ports/kfreebsd/fxstatat.c

> | 2676 rm CALL __sysctl(0xbfbfe628,0x4,0,0xbfbfe638,0,0)
> | 2676 rm RET __sysctl 0
> | 2676 rm CALL __sysctl(0xbfbfe628,0x4,0xbfbfdce0,0xbfbfe638,0,0)
> | 2676 rm RET __sysctl 0
> | 2676 rm CALL lstat(0xbfbfe5a8,0xbfbfdc50)
> | 2676 rm NAMI "-/b"
> | 2676 rm RET lstat -1 errno 2 No such file or directory
>
> (Note, that it's "-/b", not "a/b".)

I am unsure what can be done about it.

Ideally, we could just switch to kfreebsd-8 only, but just now we have 
problem with build of some big packages (namely gcc-4.3) under kfreebsd-8.
So far it looks like race condition in scheduler/memory 
manager/pagedaemon/...,
It is rather hard to give an estimate of time to solve the kfreebsd-8 
problem. Well, dot zero is dot zero :-(

Sorry

Petr




Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#573940; Package coreutils. (Thu, 01 Apr 2010 20:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Thu, 01 Apr 2010 20:12:04 GMT) Full text and rfc822 format available.

Message #71 received at 573940@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: debian-release@lists.debian.org
Cc: 573940@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: coreutils/kfreebsd/libcs
Date: Thu, 1 Apr 2010 23:42:49 +0200 (CEST)
Hi.

> Please see 573940. I'm open to suggestions on how to deal with this. If 
> I understand correctly, kfreebsd has been declared a release arch for 
> squeeze, but its libc (0.1?) doesn't handle compatibility between kernel 
> versions, its old kernel lacks features that are standard in other 
> debian archs,

True for "other debian release considered archs", but we (libc0.1-dev) 
advertise that we do not support *at functions.
The gnulib and its users (like coreutils) should properly handle it.

> and its new kernel is buggy in some way that makes people want to 
> support both (even though the libc seems to not do that very well)

I do not agree, the ((e)g)libc clearly advertise that *at functions
are not properly supported (via ENOSYS and <gnu/stubs.h>).
In fact, only the 7.x kernel does not support *at functions,
but the 8.x does. The bug in gnulib/coreutils is just
hidden by FreeBSD 8.0 kernel, but it still exists.

We (GNU/kFreeBSD team) hope that 8.0 kernel problem will be located
amd solved before squeeze release.

Petr




Reply sent to Michael Stone <mstone@debian.org>:
You have taken responsibility. (Wed, 28 Apr 2010 03:39:03 GMT) Full text and rfc822 format available.

Notification sent to Christian Marillat <marillat@debian.org>:
Bug acknowledged by developer. (Wed, 28 Apr 2010 03:39:04 GMT) Full text and rfc822 format available.

Message #76 received at 573940-close@bugs.debian.org (full text, mbox):

From: Michael Stone <mstone@debian.org>
To: 573940-close@bugs.debian.org
Subject: Bug#573940: fixed in coreutils 8.5-1
Date: Wed, 28 Apr 2010 03:34:12 +0000
Source: coreutils
Source-Version: 8.5-1

We believe that the bug you reported is fixed in the latest version of
coreutils, which is due to be installed in the Debian FTP archive:

coreutils_8.5-1.diff.gz
  to main/c/coreutils/coreutils_8.5-1.diff.gz
coreutils_8.5-1.dsc
  to main/c/coreutils/coreutils_8.5-1.dsc
coreutils_8.5-1_i386.deb
  to main/c/coreutils/coreutils_8.5-1_i386.deb
coreutils_8.5.orig.tar.gz
  to main/c/coreutils/coreutils_8.5.orig.tar.gz
mktemp_8.5-1_all.deb
  to main/c/coreutils/mktemp_8.5-1_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 573940@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Stone <mstone@debian.org> (supplier of updated coreutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 27 Apr 2010 20:32:54 -0400
Source: coreutils
Binary: coreutils mktemp
Architecture: source all i386
Version: 8.5-1
Distribution: unstable
Urgency: low
Maintainer: Michael Stone <mstone@debian.org>
Changed-By: Michael Stone <mstone@debian.org>
Description: 
 coreutils  - GNU core utilities
 mktemp     - coreutils mktemp transitional package
Closes: 573940
Changes: 
 coreutils (8.5-1) unstable; urgency=low
 .
   * New upstream version
   * kfbsd patch to work around fstat bug (from jwilk) (Closes: #573940)
   * temporarily killing tests on mipsel due to longstanding gcc bug #519006
Checksums-Sha1: 
 2c5b4fcffaded7634520c3e7c8807c9f4e3fabb9 1264 coreutils_8.5-1.dsc
 939144f16d05691753a87134436dd2bb8ea89851 10740866 coreutils_8.5.orig.tar.gz
 ffa3b33e27fac2aa046815066fb6b6da4e4227ab 20767 coreutils_8.5-1.diff.gz
 2e5980b646715ed48c81d0a3f7f9a927f6965cf8 14832 mktemp_8.5-1_all.deb
 3f7aacbfd4969cb92e12a20487a4e180562abfc2 4608374 coreutils_8.5-1_i386.deb
Checksums-Sha256: 
 336eccecedad0d13f8c60101325c376221fa0b1e588c7f7ca2d0be4483e5f129 1264 coreutils_8.5-1.dsc
 dd243e2ac7d0ed203b170ecfb8299643779e7501fec2b45ae1cea8a450fa8ca0 10740866 coreutils_8.5.orig.tar.gz
 dbf98faedfdc2a9df02f8b95e9c7382fd9bec3a17d3eb4d1f71d5bda345d7079 20767 coreutils_8.5-1.diff.gz
 5d2ce1170be911d716ba7d78ee2766db3c4558cf2f4764f7633d7f17cef86fa0 14832 mktemp_8.5-1_all.deb
 0fc137f31543130a5d0770610ffe5819dd887650b38b478355a53c2c991a455a 4608374 coreutils_8.5-1_i386.deb
Files: 
 a7447d1ac5c75866195c48557a03f76e 1264 utils required coreutils_8.5-1.dsc
 c1ffe586d001e87d66cd80c4536ee823 10740866 utils required coreutils_8.5.orig.tar.gz
 b4bfc1ed1efe031f7f22b3093470e052 20767 utils required coreutils_8.5-1.diff.gz
 de527ccb8ac6152242b2ee59c8d87d6c 14832 oldlibs extra mktemp_8.5-1_all.deb
 de7f2ef8769cc38e64774102708ce1ae 4608374 utils required coreutils_8.5-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQCVAwUBS9eRVQ0hVr09l8FJAQih0wP/aR6ppV6nB3u3S69dWEBr/nXC+PmBwE92
Etn2qTDYcQ+y19v9qIDbF0Tmq5R0VKRSqmcSVSw0hOgA5z4ag2leACnWxGeZ/LQ1
wrkjxQljtwY+zZEzXoeAgyi7kbdpM7GESaMe0S0vKo2/zlFPImPR1xdn/IasyZKU
X0EtWnre71M=
=JVP2
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 27 May 2010 07:32:19 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 13:23:51 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.