www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/07/28/10:10:32

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Message-ID: <005d01c1176f$19910e30$0300a8c0@ufo>
From: "Trevor Forbes" <trevorforbes AT ozemail DOT com DOT au>
To: "cygdev" <cygwin-developers AT cygwin DOT com>
References: <20010725173147 DOT P490 AT cygbert DOT vinschen DOT de>
Subject: Re: Problems with autoconf-2.52 testsuite using current CVS Cygwin
Date: Sat, 28 Jul 2001 23:37:41 +0930
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200

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.



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019