GNU bug report logs - #10305
coreutils-8.14, "rm -r" fails with EBADF

Previous Next

Package: coreutils;

Reported by: "Joachim Schmitz" <jojo <at> schmitz-digital.de>

Date: Thu, 15 Dec 2011 14:08:01 UTC

Severity: wishlist

Tags: notabug

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Joachim Schmitz <jojo <at> schmitz-digital.de>
Cc: 10305 <at> debbugs.gnu.org, bug-gnulib <at> gnu.org
Subject: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
Date: Sun, 18 Dec 2011 14:24:00 -0800
On 12/18/11 02:31, Joachim Schmitz wrote:
> it seems to go wrong in fcntl.c, line 194:
> 
>             /* Haiku alpha 2 loses fd flags on original.  */
>             int flags = fcntl (fd, F_GETFD);    <==
>             if (flags < 0)
>               {
>                 result = -1;
>                 break;
>               }
> 
> that fcntl() returns a -1 with errno set to EBADF.

What is the value of fd at that point?
Is it actually an invalid file descriptor?

> For some reason I can step into that fcntl(), guess it is calling the system's fcntl here?

Yes, that's how it's supposed to work.

If you plant a breakpoint on the parent fts_build,
and single step through that, can you find out whether
continue_readdir is true?  If it's true, then please
investigate why dirfd (fts.c line 1285)
returned an invalid file descriptor.  If it's false,
then please investigate why opendirat (..., &dir_fd)
(fts.c line 1301) succeeded but set dir_fd to an
invalid file descriptor.




This bug report was last modified 12 years and 110 days ago.

Previous Next


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