bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils-8.3: test failed: ls/stat-dtype and touch/no-dereference


From: Jim Meyering
Subject: Re: coreutils-8.3: test failed: ls/stat-dtype and touch/no-dereference
Date: Mon, 11 Jan 2010 08:55:21 +0100

Voelker, Bernhard wrote:
> Jim Meyering wrote:
>
>> Volker, you can diagnose this by stepping through ls.c's print_dir
>> function, doing "print *next" for each entry.
>
> see attached.

Thanks!

>> One of those three will be the entry for d/s (others are usually
>> "." and "..") and we care about the direct.d_type member.
>
> Strangely, I got one for ".", "..", and one "" (d_name = '\0').
>
>> You can see that 10 corresponds to DT_LNK:
>>
>>  (gdb) p (int)DT_LNK
>>  $5 = 10
>
> I got the same:
>   (gdb) print (int)DT_LNK
>   $7 = 10
>
>> Since the code appears to work as intended with DT_DIR, perhaps
>> your system (or file system) lacks DT_LNK support?
>
> How can I check?

(see below)
Please repeat, but be sure to execute the assignment
before printing the assigned-to value.

> (gdb) run
> Starting program: /home/berny/depot/coreutils-8.3/src/ls --file-type d
> [Thread debugging using libthread_db enabled]
> [New Thread 0x2a95edcf70 (LWP 28010)]
> Breakpoint 2 at 0x2a95a0e0c0
> Pending breakpoint "readdir" resolved
> [Switching to Thread 0x2a95edcf70 (LWP 28010)]
>
> Breakpoint 2, 0x0000002a95a0e0c0 in readdir64 () from /lib64/libc.so.6
> (gdb) fin
> Run till exit from #0  0x0000002a95a0e0c0 in readdir64 () from 
> /lib64/libc.so.6
> print_dir (name=0x623bc0 "d", realname=0x0, command_line_arg=true) at 
> ls.c:2506
> 2506          if (next)
> (gdb) next
> 2505          next = readdir (dirp);
> (gdb) print *next

Ahh... our debuggers aren't quite the same.
You'll have to use one more "next" command.
The above prints "*next" *before* the assignment.
If you'd used one more "next" to advance past the assignment,
then you would have seen the expected names: ".", "..", "s".

> $1 = {d_ino = 6437824, d_off = 0, d_reclen = 1, d_type = 0 '\0',
>   d_name = '\0'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]