On Sun, 7 Oct 2007, Jim Meyering wrote:
Martin Koeppe <[EMAIL PROTECTED]> wrote:
The test tests/rm/dir-nonrecur shows IMO a real bug in coreutils,
however:
"rm d" should fail at
remove.c:1094  with   "cannot remove 'd':  Is a directory"
but fails there with  "cannot remove 'd':  No such file or diectory"

If I remove the translation call _() around the text, then it fails
correctly with "Is a directory".  I think failures during translation
shouldn't change the errno reported.

Thanks for investigating.
If it's happening the way you say, then gettext must change, and fail
to restore errno.  Are you using the latest version of gettext?
Why do you think that's a bug in coreutils?

Can you provide something like strace/truss output?

truss output is attached. I added 'perror("errno=");' just before
remove.c:1094, to see errno before the gettext call.

I'm using gettext 0.16.1 and libiconv 1.11. I now read the gettext(3) man page. It says: "errno is not modified". I only thought coreutils could use the possibility to avoid this sort of bugs by saving errno elsewhere before calling gettext(). If the gettext(3) man page is to read as "errno is guaranteed not to be modified" then it's a gettext() bug of course.

BTW, the tests mv/dir2dir and rm/dir-no-w fail due to very probably the same issue. Will try to --disable-nls and retest.


Martin
tracing pid 3513
getdata() getdata returned 0
getrlimit() getrlimit returned 0
pthread_inform_signals() pthread_inform_signals returned 0
unixpath2win() unixpath2win returned 0
getids() getids returned 0
getids() getids returned 0
getids() getids returned 0
getids() getids returned 0
open("/usr/lib/libintl.so.8", 0x1) open returned 4
read(4, 0x85EC18, 4096) read returned 4096 0x1000
close(4) close returned 0
unixpath2win() unixpath2win returned 0
open("/usr/lib/libc.so.3.5", 0x1) open returned 4
read(4, 0x85EBF8, 4096) read returned 4096 0x1000
close(4) close returned 0
unixpath2win() unixpath2win returned 0
open("/usr/lib/libiconv.so.2", 0x1) open returned 4
read(4, 0x85EBD8, 4096) read returned 4096 0x1000
close(4) close returned 0
unixpath2win() unixpath2win returned 0
open("/usr/share/locale//_ASCII", 0x1) open returned 4
read(4, 0x864D58, 131072) read returned 131072 0x20000
close(4) close returned 0
open("/usr/share/locale//ASCII_", 0x1) open returned 4
read(4, 0x864318, 512) read returned 512 0x200
read(4, 0x884D60, 131072) read returned 0
close(4) close returned 0
pthread_rwlock_wrlock(0x564C7038) pthread_rwlock_init(0x564C7038, 0x0) 
pthread_rwlock_init returned 0
pthread_rwlock_wrlock returned 0
pthread_rwlock_unlock(0x564C7038) pthread_rwlock_unlock returned 0
pthread_rwlock_wrlock(0x564C7038) pthread_rwlock_wrlock returned 0
pthread_rwlock_unlock(0x564C7038) pthread_rwlock_unlock returned 0
isatty(0) isatty returned 0
getids() getids returned 0
lstat("d", 0x04E80B28) lstat ret: 0 dev: 0x4c0000000d082e ino: 0x7ff90178
getids() getids returned 0
unlink() unlink failed: errno 1, Operation not permitted

write(2, 0x85EAA0, 23) errno=: Is a directory
write returned 23 0x17
pthread_rwlock_rdlock(0x564C7038) pthread_rwlock_rdlock returned 0
pthread_rwlock_rdlock(0x564C7030) pthread_rwlock_init(0x564C7030, 0x0) 
pthread_rwlock_init returned 0
pthread_rwlock_rdlock returned 0
pthread_rwlock_unlock(0x564C7030) pthread_rwlock_unlock returned 0
getids() getids returned 0
getids() getids returned 0
getids() getids returned 0
getids() getids returned 0
pthread_rwlock_unlock(0x564C7038) pthread_rwlock_unlock returned 0
pthread_rwlock_rdlock(0x564C7038) pthread_rwlock_rdlock returned 0
pthread_rwlock_rdlock(0x564C7030) pthread_rwlock_rdlock returned 0
pthread_rwlock_unlock(0x564C7030) pthread_rwlock_unlock returned 0
pthread_rwlock_unlock(0x564C7038) pthread_rwlock_unlock returned 0
pthread_rwlock_rdlock(0x564C7038) pthread_rwlock_rdlock returned 0
pthread_rwlock_rdlock(0x564C7030) pthread_rwlock_rdlock returned 0
pthread_rwlock_unlock(0x564C7030) pthread_rwlock_unlock returned 0
pthread_rwlock_unlock(0x564C7038) pthread_rwlock_unlock returned 0
write(2, 0x85F278, 6) ./rm: write returned 6
write(2, 0x85EE64, 17) cannot remove `d'write returned 17 0x11
write(2, 0x85EE48, 27) : No such file or directorywrite returned 27 0x1B
write(2, 0x77DC2F9B, 1) 
write returned 1
close(0) close returned 0
close(1) close returned 0
close(2) close returned 0
exit(1) process exited with status 1
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to