[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#573940: coreutils: rm -r doesn't work on kfreebsd-i386



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

Attachment: signature.asc
Description: Digital signature


Reply to: