Brad wrote:
...
(gdb) run -rf a/b/c/d
Starting program: /home/brad/tools/core_debug/src/rm -rf a/b/c/d
Breakpoint 1, fts_open (argv=0x7fffffffed08, options=536, compar=0) at
fts.c:92
92 {
(gdb) n
100 if (options & ~FTS_OPTIONMASK) {
(gdb) n
101 __set_errno (EINVAL);
(gdb) n
201 }
(gdb) n
xfts_open (argv=0x7fffffffed08, options=536, compar=0) at
../../coreutils-8.5/lib/xfts.c:37
Thanks. that "options" value is 0x218, which makes sense:
# define FTS_NOSTAT 0x0008 /* don't get stat info */
# define FTS_PHYSICAL 0x0010 /* physical walk */
# define FTS_CWDFD 0x0200
int bit_flags = (FTS_CWDFD | FTS_NOSTAT | FTS_PHYSICAL);
...
FTS *fts = xfts_open (file, bit_flags, NULL);
The other value in that comparison should come from fts_.h:
# define FTS_OPTIONMASK 0x07ff /* valid user option mask */
But is that actually the value used on your system?
To find out, do this:
cd lib
rm fts.o
make AM_CFLAGS='-E -dD' fts.o
That is a hack to obtain C-preprocessed sources.
Rename the file to have a sensible suffix, and so it
doesn't interfere with a subsequent build:
mv fts.o fts.i
In my copy, I see this:
if (options & ~0x07ff) {
(*__errno_location ()) = (22);
return (((void *)0));
}
If you see the same thing, then suspect that your compiler is at fault.
In that case, there's one more thing you can do:
Repeat the steps you performed above, then run this command right after
hitting the breakpoint, and tell us what it prints:
print options & ~0x07ff