bug-gnulib
[Top][All Lists]
Advanced

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

Re: Problems with directory trees "confdir-14B---" and "confdir3"


From: Peter Dyballa
Subject: Re: Problems with directory trees "confdir-14B---" and "confdir3"
Date: Mon, 18 Mar 2024 17:51:02 +0100

> Am 11.01.2022 um 00:35 schrieb Paul Eggert <eggert@cs.ucla.edu>:
> 
> On 1/9/22 03:10, Peter Dyballa wrote:
>>     checking whether getcwd aborts when 4k < cwd_length < 16k... yes
>> and of course the reports about not being able to remove the 
>> "confdir-14B---" and "confdir3" directory trees,
> 
> So, the problem is that the test program creates the deep directories, and 
> then runs a test that aborts the test program, and this means the test 
> program can't clean up after itself?
> 
> If so, perhaps we should alter the test program so that it can be run in such 
> a way that it *only* cleans up after itself, and we use that for cleanup 
> since macOS 'rm' isn't up to the task.

Paul,

I am experimenting with the test programme although I am not an experienced C 
programmer, just understanding a few things. So I may be wrong in some aspects. 
I was adding to the test programme some lines of code to output diagnostics 
into a(n ever growing) file. From this it seems that the /break;/ instruction 
of the (first) /for loop/ that builds up the deep directory tree is never 
reached, because this would lead to some output from my code from a line after 
the loop. It just happens a crash before, or the break is misinterpreted as 
reason to crash. And so the (second) /while loop/ that removes the tree cannot 
perform, the deep tree is left over on Mac OS X.

Usually the test programme returns 3, meaning that it reached the line before 
/break;/, which is:

        fail = 3; /* Unable to construct deep hierarchy.  */


BTW, I found that /grm/ from coreutils can easily remove the too deep directory 
hierarchy on Mac OS X.

The test programme reaches level (d=) 250, current working directory down there 
is 3785 chars long. Next iteration, that causes the crash, does add 15 
characters plus a /.

--
Greetings

  Pete

Programming today is a race between software engineers striving to build bigger 
and better idiot-proof programs, and the Universe trying to produce bigger and 
better idiots. So far, the Universe is winning.
                                – Rich Cook




reply via email to

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