Jim Meyering <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] (Bob Proulx) wrote:
>> Jim Meyering wrote:
>>> I should have created a directory whose abs. name length
>>> is a little *larger* than 16K, not just smaller.
>>>
>>> Does it provoke the failed assertion if you change this line
>>>
>>>   size_t buf_len = 16 * 1024;
>>>
>>> to e.g., this:
>>>
>>>   size_t buf_len = 20 * 1024;
>>
>> Yes.  At 20k the mkdir succeeds, the chdir succeeds, the desired depth
>> is reached and then the getcwd fails.  The getcwd fails with errno
>> equal to 36 "File name too long" as expected.  It cleans up the
>> created directory structure.
>>
>>   $ ls -log
>>   total 36
>>   -rwxr-xr-x  1 29101 Jun 18 11:54 getcwd-glibc-bug
>>   -rw-r--r--  1  1180 Jun 18 11:56 getcwd-glibc-bug.c
>>   $ ./getcwd-glibc-bug ; echo $?
>>   4
>
> Bummer.  I was hoping for a failed assertion.
>
> Ohh....
> I finally looked at the source for glibc's getcwd.c and see that
> the bug is triggered only if you make *glibc* allocate the result buffer.
>
> Would you please try one more time?

Finally got it.
and realized that I do have access to an ia64 linux system :)

Use the same program, but this definition (has to be larger
than 4k and smaller than 16k):

#define TARGET_LEN (5 * 1024)


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to