bug-coreutils
[Top][All Lists]
Advanced

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

Re: ia64 GNU/Linux pwd-long test failure in CVS coreutils


From: Bob Proulx
Subject: Re: ia64 GNU/Linux pwd-long test failure in CVS coreutils
Date: Sun, 18 Jun 2006 11:24:49 -0600
User-agent: Mutt/1.5.9i

Hi Jim,

Jim Meyering wrote:
> Bob, would you please compile and run this and tell me what
> it does on your ia64 system?

Done.  It "works".

> I expect it to abort and leave behind the deep tree.
> If that's what it does, then I'll change all exit calls to
> always exit 0, and just let the abort trigger the test failure.

Nope.  Sitting in /tmp/rwp I run the program and the desired_depth is
computed to be 1091.

>   initial_cwd_len = strlen (cwd);
>   desired_depth = ((buf_len - 1 - initial_cwd_len) / (1 + strlen (dir_name)));

  (gdb) p initial_cwd_len
  $4 = 8
  (gdb) p desired_depth
  $5 = 1091

>   for (d = 0; d < desired_depth; d++)
>     {
>       if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
>       {
>         fail = 3; /* Unable to construct deep hierarchy.  */
>         break;
>       }
>     }
> 
>   cwd = getcwd (buf, buf_len);

  (gdb) p cwd
  $6 = 0x6000000000004010 
"/tmp/rwp/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B"...

  (gdb) p d
  $7 = 1091

>   if (cwd == NULL)
>     fail = 4; /* getcwd failed.  This is ok, and expected.  */
>   free (buf);
> 
>   /* Call rmdir first, in case the above chdir failed.  */
>   rmdir (dir_name);
>   while (0 < d--)
>     {
>       if (chdir ("..") < 0)
>       break;
>       rmdir (dir_name);
>     }
> 
>   exit (fail);
> }

The mkdir call never fails.  It hits the desired depth and then cleans
up normally.  It 'exit(0);'s at the end because fail = 3 was never hit.

Bob




reply via email to

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