Last change
on this file since 3537 was 3320, checked in by Bruno Cornec, 10 years ago |
- Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in
the move to 3.0
|
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
File size:
769 bytes
|
Rev | Line | |
---|
[3320] | 1 | #!/bin/sh
|
---|
| 2 | # Leak test for gunzip. Watch top for growing process size.
|
---|
| 3 | # In this case we look for leaks in "concatenated .gz" code -
|
---|
| 4 | # we feed gunzip with a stream of .gz files.
|
---|
| 5 |
|
---|
| 6 | i=$PID
|
---|
| 7 | c=0
|
---|
| 8 | while true; do
|
---|
| 9 | c=$((c + 1))
|
---|
| 10 | echo "Block# $c" >&2
|
---|
| 11 | # RANDOM is not very random on some shells. Spice it up.
|
---|
| 12 | i=$((i * 1664525 + 1013904223))
|
---|
| 13 | # 100003 is prime
|
---|
| 14 | len=$(( (((RANDOM*RANDOM)^i) & 0x7ffffff) % 100003 ))
|
---|
| 15 |
|
---|
| 16 | # Just using urandom will make gzip use method 0 (store) -
|
---|
| 17 | # not good for test coverage!
|
---|
| 18 | cat /dev/urandom \
|
---|
| 19 | | while true; do read junk; echo "junk $c $i $junk"; done \
|
---|
| 20 | | dd bs=$len count=1 2>/dev/null \
|
---|
| 21 | | gzip >xxx.gz
|
---|
| 22 | cat xxx.gz xxx.gz xxx.gz xxx.gz xxx.gz xxx.gz xxx.gz xxx.gz
|
---|
| 23 | done | ../busybox gunzip -c >/dev/null
|
---|
Note:
See
TracBrowser
for help on using the repository browser.