Solaris test t5500 race condition
- From
- Peter Eriksen <s022018@student.dtu.dk>
- Date
- Apr 14, 2006, 03:17 UTC
- Message-ID
- <20060414031759.GA9524@bohr.gbar.dtu.dk>
Hello,
I've found a race in t5500-fetch-pack.sh. The problem is the way the number of unpacked objects are counted:
pack_count=$(grep Unpacking log.txt|tr -dc "0-9")
It just concatenates all the digits on the line with "Unpacking" in it. This is the output I get on Solaris:
Generating pack...
Done counting 3 objects.
Deltifying 3 objects.
33% (1/3) done^M 66% (2/3) done^M 100% (3/3) done
Total 3Unpacking , written 33 objects <------------
(delta 0), reused 0 (delta 0)
11fa2f0cb58ed7f02dbd5ac75ed82a53fae62a7b refs/heads/AThe marked line is written as a joyful duet between these two functions:
unpack-objects.c: fprintf(stderr, "Unpacking %d objects\n",
nr_objects); pack-objects.c: fprintf(stderr, "Total %d, written %d
(delta %d), reused %d (delta %d)\n",I can't think of a good solution right now.
Regards,
Peter