Dr. Werner Fink 2012-02-02 12:07:46 +00:00 committed by Git OBS Bridge
parent fcd1020dfe
commit bc3d72c166
7 changed files with 96 additions and 31 deletions

View File

@ -1,11 +1,11 @@
#!/bin/bash
test $(ulimit -l) -lt 64 && exit 1
test $(ulimit -s) -lt 8192 && exit 1
test $(ulimit -l) -lt 64 && exit 1
test $(ulimit -s) -lt 8192 && exit 1
if test $(getconf LONG_BIT) -le 32 ; then
test $(ulimit -m) -lt 6852272 && exit 1
test $(ulimit -v) -lt 5010688 && exit 1
test $(ulimit -m) -lt 3145728 && exit 1
test $(ulimit -v) -lt 4194304 && exit 1
else
test $(ulimit -m) -lt 10471232 && exit 1
test $(ulimit -v) -lt 6683794 && exit 1
test $(ulimit -m) -lt 4194304 && exit 1
test $(ulimit -v) -lt 6683794 && exit 1
fi
exit 0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 2 11:32:15 UTC 2012 - werner@suse.de
- Fix an off-by-one error which cause that the builtin ulimit may
fail (bnc#744355), patch from Li Bin.
-------------------------------------------------------------------
Tue Jan 24 18:42:48 UTC 2012 - werner@suse.de

View File

@ -76,6 +76,7 @@ Patch18: ksh93-jobs.dif
Patch19: ksh93-reg.dif
Patch20: ksh93-aso.dif
Patch21: ksh93-vm.dif
Patch22: ksh93-limit-name-len.dif
Patch42: ksh-locale.patch
%global use_suid_exe 0
%global use_locale 0
@ -150,6 +151,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf
%patch19
%patch20
%patch21
%patch22
find -type f -a -name Mamfile | \
xargs sed -ri '/exec.*-I-D/{s@(-I)(-D)([^0]*)(0[^[:blank:]]+)@\1\3@}'
@ -319,13 +321,10 @@ find -type f -a -name Mamfile | \
cflags -std=gnu99 RPM_OPT_FLAGS
cflags -fPIC RPM_OPT_FLAGS
cflags @$nobuiltin RPM_OPT_FLAGS
cflags -fno-unwind-tables RPM_OPT_FLAGS
cflags -fno-strict-aliasing RPM_OPT_FLAGS
cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS
cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS
cflags -fno-asynchronous-unwind-tables RPM_OPT_FLAGS
cflags -fno-unsafe-loop-optimizations RPM_OPT_FLAGS
cflags -fno-reorder-blocks-and-partition RPM_OPT_FLAGS
cflags -fsigned-bitfields RPM_OPT_FLAGS
cflags -fsigned-chars RPM_OPT_FLAGS
cflags -fsigned-zeros RPM_OPT_FLAGS

11
ksh93-limit-name-len.dif Normal file
View File

@ -0,0 +1,11 @@
--- src/cmd/ksh93/include/ulimit.h
+++ src/cmd/ksh93/include/ulimit.h 2012-02-02 11:30:00.242435132 +0000
@@ -157,7 +157,7 @@
typedef struct Limit_s
{
- const char name[8];
+ const char* name;
const char* description;
int index;
const char* conf;

View File

@ -355,3 +355,23 @@
chmodf = lchmod;
goto commit;
#else
--- src/cmd/ksh93/sh/xec.c
+++ src/cmd/ksh93/sh/xec.c 2012-01-26 12:07:46.463645375 +0000
@@ -922,7 +922,7 @@ int sh_exec(register const Shnode_t *t,
{
case TCOM:
{
- register struct argnod *argp;
+ volatile struct argnod *argp;
char *trap;
Namval_t *np, *nq, *last_table;
struct ionod *io;
@@ -1027,7 +1027,7 @@ int sh_exec(register const Shnode_t *t,
comn = com[argn-1];
}
io = t->tre.treio;
- if(shp->envlist = argp = t->com.comset)
+ if((shp->envlist = argp = t->com.comset))
{
if(argn==0 || (np && nv_isattr(np,(BLT_DCL|BLT_SPC))))
{

View File

@ -6,30 +6,40 @@ getSampleInterval() { return 0; }
typeset -ilu times=4000
typeset -ilu leak=0
typeset -a curstate=(0 0 0)
typeset -a oldstate=(0 0 0)
vm()
{
typeset size
typeset key unit result=""
while read key size unit; do
case "$key" in
VmSize*) result=${result:+"$result:"}$size ;;
VmRSS*) result=${result:+"$result:"}$size ;;
VmData*) result=${result:+"$result:"}$size ;;
VmSize*) result=${result:+"$result "}$size ;;
VmRSS*) result=${result:+"$result "}$size ;;
VmData*) result=${result:+"$result "}$size ;;
esac
done < /proc/$$/status
echo $result
}
curstate="XXXX:XXXX:XXXX"
oldstate=$(vm)
lessequal()
{
typeset -i ret=0
((${curstate[0]} > ${oldstate[0]})) && let ret=1
((${curstate[1]} > ${oldstate[1]})) && let ret=1
((${curstate[2]} > ${oldstate[2]})) && let ret=1
return $ret
}
oldstate=($(vm))
while ((times-- > 0))
do
interval=$(getSampleInterval)
curstate=$(vm)
[ "$curstate" != "$oldstate" ] && let leak++
oldstate="$curstate"
curstate=($(vm))
lessequal || let leak++
oldstate=(${curstate[@]})
done

View File

@ -6,15 +6,18 @@ bla=234
typeset -lui count=4000
typeset -lui leak=0
typeset -a curstate=(0 0 0)
typeset -a oldstate=(0 0 0)
vm()
{
typeset size
typeset key unit result=""
while read key size unit; do
case "$key" in
VmSize*) result=${result:+"$result:"}$size ;;
VmRSS*) result=${result:+"$result:"}$size ;;
VmData*) result=${result:+"$result:"}$size ;;
VmSize*) result=${result:+"$result "}$size ;;
VmRSS*) result=${result:+"$result "}$size ;;
VmData*) result=${result:+"$result "}$size ;;
esac
done < /proc/$$/status
echo $result
@ -22,23 +25,39 @@ vm()
fusub()
{
datun=`date +%S`
# datun=$(date +%S)
interval=$((10 - datun%10))
datum=`date +%S`
interval=$((10 - datum%10))
}
curstate="XXXX:XXXX:XXXX"
oldstate=$(vm)
fvsub()
{
datum=$(date +%S)
interval=$((10 - datum%10))
}
lessequal()
{
typeset -i ret=0
((${curstate[0]} > ${oldstate[0]})) && let ret=1
((${curstate[1]} > ${oldstate[1]})) && let ret=1
((${curstate[2]} > ${oldstate[2]})) && let ret=1
return $ret
}
oldstate=($(vm))
while ((count-- > 0))
do
foo=$((foo+1))
datum=`fusub`
# datum=$(fusub)
foo=$((foo+1))
curstate=$(vm)
[ "$curstate" != "$oldstate" ] && let leak++
oldstate="$curstate"
if ((count%2 == 0)) ; then
datum=`fusub`
else
datum=$(fvsub)
fi
curstate=($(vm))
lessequal || let leak++
oldstate=(${curstate[@]})
done