This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problems with autoconf-2.52 testsuite using current CVS Cygwin


Adding to Corinna excellent start.......

I have sent a far amount of time investigating this one. AFAICT the problem
only
occurs in the following script combination:
............
  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  trap 'AS_EXIT([1])' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
: ${TMPDIR=/tmp}
{
  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/$1XXXXXX") 2>/dev/null` &&
  test -n "$tmp" && test -d "$tmp"
}  ||
{
  tmp=$TMPDIR/$1$$-$RANDOM
  (umask 077 && mkdir $tmp)
..........

Part of the problem is that ash is missing some important functionality,
primarily $RANDOM.  As ash does not have $RANDOM, and we are left to rely on
the PID being unique identifier which is far from ideal as its already been
highlighted by Corinna. The use of $RANDOM would avoid the duplicate PID
problem and should avoid the duplicate directory name problem or at least
give a 1 in 32768 (RANDOM's range) chance of avoiding it......

And another part of the problem is Cygwin does not have a mktemp utility.
The mktemp is used in preference to mkdir and totally bypasses the duplicate
PID and no RANDOM problem highlighted above....

So after trying a few different versions of mktemp I found one at
http://www.courtesan.com/mktemp/mktemp.html . It built cleanly and I must
say its "great". I tried it with autoconf and straight away ALL 155 autoconf
tests passed. Great, but there is still the problem that the directories
are not being deleted in the temp dir. :(
Note, I think this mktemp needs to be added as a core package.

Things are a bit clearer now that there is no file name collisions. I think
the trap is not working all the time and therefore it is not calling
"rm".....
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0

This is far as I have got, I am sort of stumped as to which direction to go
next. How do you debug this sort of signal problem?.......  Anyway, I am
just reporting my finding so far just in case someone else can see the
solution.   Note, I have not stopped looking into it...

I hope this of some use.....

Trevor.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]