From e2bd345208a53bc064837154a13fbbef26a828257bd25e0c3d4e137694266f8d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 6 Feb 2012 12:36:57 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=89 --- INIT.2012-01-01.tar.bz2 | 3 - INIT.2012-02-02.tar.bz2 | 3 + ast-ksh.2012-01-01.tar.bz2 | 3 - ast-ksh.2012-02-02.tar.bz2 | 3 + ast-msgcc.2012-01-01.tar.bz2 | 3 - ast-msgcc.2012-02-02.tar.bz2 | 3 + ksh.changes | 40 ++++++++++ ksh.spec | 62 +++++++++------ ksh93-aso.dif | 78 ++++++++++--------- ksh93-limit-name-len.dif | 2 +- ksh93-shift_ijs.dif | 4 +- ksh93-signals.dif | 11 +-- ksh93-vm.dif | 16 +--- ksh93.dif | 4 +- leak1.sh | 4 +- leak2.sh | 2 +- leak3.sh | 2 +- ulimit.sh | 2 +- workaround-stupid-build-system.diff | 117 ++++++++++++++-------------- 19 files changed, 205 insertions(+), 157 deletions(-) delete mode 100644 INIT.2012-01-01.tar.bz2 create mode 100644 INIT.2012-02-02.tar.bz2 delete mode 100644 ast-ksh.2012-01-01.tar.bz2 create mode 100644 ast-ksh.2012-02-02.tar.bz2 delete mode 100644 ast-msgcc.2012-01-01.tar.bz2 create mode 100644 ast-msgcc.2012-02-02.tar.bz2 diff --git a/INIT.2012-01-01.tar.bz2 b/INIT.2012-01-01.tar.bz2 deleted file mode 100644 index 79f9a4b..0000000 --- a/INIT.2012-01-01.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:654c2f7b3a3166142b47bf60f108b732024c2c7c1bdffc044582f250a0600926 -size 296293 diff --git a/INIT.2012-02-02.tar.bz2 b/INIT.2012-02-02.tar.bz2 new file mode 100644 index 0000000..d0cc9ea --- /dev/null +++ b/INIT.2012-02-02.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea89823ade1949c828e6012cf85f58aebcfe8cb9f31052370936e215a9b126a6 +size 296877 diff --git a/ast-ksh.2012-01-01.tar.bz2 b/ast-ksh.2012-01-01.tar.bz2 deleted file mode 100644 index 93ddd16..0000000 --- a/ast-ksh.2012-01-01.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4620fbd035d3c85d80a1bc8559e464111ebac9fe6beec06fb44d5c8ced20f416 -size 1571615 diff --git a/ast-ksh.2012-02-02.tar.bz2 b/ast-ksh.2012-02-02.tar.bz2 new file mode 100644 index 0000000..2fc431c --- /dev/null +++ b/ast-ksh.2012-02-02.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ddaab5c6ae873e61e0706024abd57f0363891a8ad5bf026082c0706b7557665 +size 1573400 diff --git a/ast-msgcc.2012-01-01.tar.bz2 b/ast-msgcc.2012-01-01.tar.bz2 deleted file mode 100644 index 2ad6fa9..0000000 --- a/ast-msgcc.2012-01-01.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:60572e0165faf8bc54ace6e0d3930a52c51b71ea600dae2ee551d017dcf6de6e -size 129201 diff --git a/ast-msgcc.2012-02-02.tar.bz2 b/ast-msgcc.2012-02-02.tar.bz2 new file mode 100644 index 0000000..0e573c1 --- /dev/null +++ b/ast-msgcc.2012-02-02.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:318716d403b0b0f5be08848235122ab27d4c13f6daceca55cd61a41cd3c8cfb4 +size 129260 diff --git a/ksh.changes b/ksh.changes index 6b994ba..50bbe1d 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,43 @@ +------------------------------------------------------------------- +Mon Feb 6 12:01:10 UTC 2012 - werner@suse.de + +- Update to 2012-02-02 of ksh93u+ which includes some of our patches + and fixes for the observerd memory leaks + 12-02-02 A bug in the ulimit option table was fixed. + 12-01-26 A bug in which a set command that did not change monitor could + effect the behavior of the monitor when monitor mode is on is fixed. + 12-01-21 +You can now test whether the shell implements a math function using + typeset -f .sh.math.name, where name is the name of the function. + 12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte + characters correctly has been fixed. + 12-01-20 A bug that could cause the shell to hang waiting for an incorrect + job pid has been fixed. + 12-01-19 A memory leak which occured for a nested command subtiution has been + fixed. + 12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute + for some other variables, for exampe, HISTFILE has been fixed. + 12-01-16 A bug in which .sh.match was not correct after a substring match when + the replacement string contained a substring match has been fixed. + 12-01-12 +Files that are sourced from profile files are now read and executed + one command at a time so that alias definitions take effect as they + do for profile files. + 12-01-12 A bug in which whence -p would find a function if one existed and + there was no command of that name on PATH. + 12-01-11 Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*). + 12-01-05 A bug in which read was not terminating for a signal that had a trap + set has been fixed. + libast: + 12-01-31 spawnveg.c: fix transient bug that made invalid setpgid() call + 12-01-27 pathpath.c: fix buffer size math when internal allocation requested + 12-01-24 malloc.c: fix _vmkeep() bug that did not return previous state + 12-01-23 malloc.c: add VMALLOC_OPTIONS=break to try sbrk() block allocator first + 12-01-18 malloc.c: disable multiple regions for tracing or !vmbest or ASO_SIGNAL + 12-01-12 sfpkrd.c: add __sun I_PEEK+rsh runtime workaround + 12-01-10 shcmd.h: void* => Shbltin_t* + 12-01-10 tmxdate.c: handle { n>=1000 } TM_PARTS + libcmd: + 12-01-10 b_* (int, char**, void*) => (int, char**, Shbltin_t*) + ------------------------------------------------------------------- Thu Feb 2 11:32:15 UTC 2012 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index a85d5ea..21f5275 100644 --- a/ksh.spec +++ b/ksh.spec @@ -45,9 +45,9 @@ Version: 93u Release: 1 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: INIT.2012-01-01.tar.bz2 -Source1: ast-ksh.2012-01-01.tar.bz2 -Source2: ast-msgcc.2012-01-01.tar.bz2 +Source: INIT.2012-02-02.tar.bz2 +Source1: ast-ksh.2012-02-02.tar.bz2 +Source2: ast-msgcc.2012-02-02.tar.bz2 Source3: CPL Source10: leak1.sh Source11: leak2.sh @@ -124,12 +124,14 @@ Authors: %prep chmod +x %{S:31} %setup -q -n ksh93 -T -c -a 0 -a 1 -a 2 -find share/ \( -name chef -o -name fudd -o -name piglatin -o -name valley \) -a -type d |\ - xargs -r rm -vrf -find share/ ! \( -name libast -o -name libcmd -o -name libdll -o -name libshell \) -a -type f |\ - xargs -r rm -vf -find share/ -type d -a -empty | xargs -r rm -vrf -find share/ -type d -a -empty | xargs -r rm -vrf +if test -d share ; then + find share/ \( -name chef -o -name fudd -o -name piglatin -o -name valley \) -a -type d |\ + xargs -r rm -vrf + find share/ ! \( -name libast -o -name libcmd -o -name libdll -o -name libshell \) -a -type f |\ + xargs -r rm -vf + find share/ -type d -a -empty | xargs -r rm -vrf + find share/ -type d -a -empty | xargs -r rm -vrf +fi %patch %patch42 %patch1 @@ -158,8 +160,6 @@ find share/ -type d -a -empty | xargs -r rm -vrf %patch20 %patch21 %patch22 -find -type f -a -name Mamfile | \ - xargs sed -ri '/exec.*-I-D/{s@(-I)(-D)([^0]*)(0[^[:blank:]]+)@\1\3@}' %build # @@ -180,6 +180,7 @@ find -type f -a -name Mamfile | \ set -- $(readlink $fd) exec -a $SHELL ./sigexec $SHELL ${1+"$@"} fi + IGNORED=0x$(ps --no-headers -o ignored $$) AR="ar" CC=gcc @@ -283,51 +284,49 @@ find -type f -a -name Mamfile | \ RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O2}" cflags -m32 RPM_OPT_FLAGS HOSTTYPE=linux.i386 - MEMORY="-e mmap2,munmap" ;; x86_64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O2}" cflags -m64 RPM_OPT_FLAGS HOSTTYPE=linux.i386-64 - MEMORY="-e mmap,munmap" ;; ia64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" cflags -mlp64 RPM_OPT_FLAGS cflags -mno-volatile-asm-stop RPM_OPT_FLAGS HOSTTYPE=linux.ia64 - MEMORY="-e mmap,munmap" ;; s390) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" cflags -m31 RPM_OPT_FLAGS HOSTTYPE=linux.s390 - MEMORY="-e mmap2,munmap" ;; s390*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" cflags -m64 RPM_OPT_FLAGS HOSTTYPE=linux.s390-64 - MEMORY="-e mmap,munmap" ;; ppc|powerpc) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" cflags -mno-powerpc64 RPM_OPT_FLAGS HOSTTYPE=linux.powerpc - MEMORY="-e mmap,munmap" ;; ppc64|powerpc64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" cflags -mpowerpc64 RPM_OPT_FLAGS HOSTTYPE=linux.powerpc64 - MEMORY="-e mmap2,munmap" ;; *) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" HOSTTYPE=linux.$RPM_ARCH - MEMORY="" ;; esac + for mm in mmap mmap2 mmap64 munmap munmap2 munmap64 ; do + if strace -e $mm /bin/true > /dev/null 2>&1 ; then + MEMORY="${MEMORY:+${MEMORY},}$mm" + fi + done + MEMORY="${MEMORY:+-e ${MEMORY}}" RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?/ -g2/g') UNIVERSE=att LDFLAGS="-lm" @@ -444,16 +443,33 @@ find -type f -a -name Mamfile | \ ln -sf ${root}/lib ${test}/../ rm -f pty.sh ${root}/bin/ksh.test shtests - strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} - strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} + LANG=POSIX + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 4000 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 4000 strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:12} - strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 4000 strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 400 strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 4000 if test $((IGNORED & SIGPIPE)) -eq 0 ; then - # This may fail in current factory (aka next 11.3) ${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10 fi + LANG=en_US.UTF-8 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 4000 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 4000 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:12} + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 4000 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 400 + strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 4000 + if test $((IGNORED & SIGPIPE)) -eq 0 ; then + ${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10 + fi + LANG=POSIX killall -q -s 9 ${root}/bin/ksh.test || true popd %endif diff --git a/ksh93-aso.dif b/ksh93-aso.dif index 3dc029a..27032ba 100644 --- a/ksh93-aso.dif +++ b/ksh93-aso.dif @@ -1,42 +1,50 @@ --- src/lib/libast/features/aso -+++ src/lib/libast/features/aso 2012-01-18 11:31:07.856479000 +0000 -@@ -1,12 +1,17 @@ - # ast atomic scalar operations feature tests - - if aso note{ gcc 4.1+ memory atomic operations model }end link{ ++++ src/lib/libast/features/aso 2012-02-06 11:25:03.897933168 +0100 +@@ -5,7 +5,10 @@ if aso note{ gcc 4.1+ 64 bit memory atom + int main() + { + uint64_t i = 0; +- return __sync_fetch_and_add(&i,7); ++ uint32_t j = 0; ++ uint16_t l = 0; ++ uint8_t m = 0; ++ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7); + } + }end && { + #define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n) +@@ -27,10 +30,13 @@ if aso note{ gcc 4.1+ 64 bit memory atom + #endif + } + elif aso note{ gcc 4.1+ 32 bit memory atomic operations model }end link{ + #include int main() { - unsigned int i = 0; - return __sync_fetch_and_add(&i,7); -+ uint8_t i = 0; ++ uint32_t i = 0; + uint16_t j = 0; -+ uint32_t l = 0; -+ uint64_t m = 0; -+ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7); ++ uint8_t l = 0; ++ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7); } }end && { -+ #include #define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n) - #define _aso_inc8(p) __sync_fetch_and_add(p,1) - #define _aso_dec8(p) __sync_fetch_and_sub(p,1) -@@ -26,6 +31,7 @@ if aso note{ gcc 4.1+ memory atomic oper - #endif +@@ -45,6 +51,7 @@ elif aso note{ gcc 4.1+ 32 bit memory at + #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,(uint32_t)o,(uint32_t)n)) } elif aso note{ atomic_cas_64 }end link{ + #include #include int main() { -@@ -34,6 +40,7 @@ elif aso note{ atomic_cas_64 - return atomic_cas_64(&i, 0, 1) != 0 || atomic_add_32_nv(&j, 1) != 1; +@@ -53,6 +60,7 @@ elif aso note{ atomic_cas_64 + return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) - #define _aso_inc8(p) atomic_add_8_nv(p,1) -@@ -54,6 +61,7 @@ elif aso note{ atomic_cas_64 + #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) +@@ -73,6 +81,7 @@ elif aso note{ atomic_cas_64 #endif } elif aso note{ atomic_cas_32 }end link{ @@ -44,15 +52,15 @@ #include int main() { -@@ -61,6 +69,7 @@ elif aso note{ atomic_cas_32 - return atomic_cas_32(&i, 0, 1) != 0 || atomic_add_32_nv(&i, 1) != 1; +@@ -80,6 +89,7 @@ elif aso note{ atomic_cas_32 + return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) - #define _aso_inc8(p) atomic_add_8_nv(p,1) -@@ -74,6 +83,7 @@ elif aso note{ atomic_cas_32 + #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) +@@ -93,6 +103,7 @@ elif aso note{ atomic_cas_32 #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) } elif aso -latomic note{ atomic_cas_64 with -latomic }end link{ @@ -60,15 +68,15 @@ #include int main() { -@@ -82,6 +92,7 @@ elif aso -latomic note{ atomi - return atomic_cas_64(&i, 0, 1) != 0 || atomic_add_32_nv(&j, 1) != 1; +@@ -101,6 +112,7 @@ elif aso -latomic note{ atomi + return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1) } }end && { + #include #include #define _REQ_atomic #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) -@@ -103,6 +114,7 @@ elif aso -latomic note{ atomi +@@ -122,6 +134,7 @@ elif aso -latomic note{ atomi #endif } elif aso note{ atomic_cas_32 with -latomic }end link{ @@ -76,15 +84,15 @@ #include int main() { -@@ -110,6 +122,7 @@ elif aso note{ atomic_cas_32 - return atomic_cas_32(&i, 0, 1) != 0 || atomic_add_32_nv(&i, 1) != 1; +@@ -129,6 +142,7 @@ elif aso note{ atomic_cas_32 + return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1) } }end && { + #include #include #define _REQ_atomic #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) -@@ -124,6 +137,7 @@ elif aso note{ atomic_cas_32 +@@ -143,6 +157,7 @@ elif aso note{ atomic_cas_32 #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) } elif aso note{ cas64 }end link{ @@ -92,15 +100,15 @@ #include int main() { -@@ -132,6 +146,7 @@ elif aso note{ cas64 }end lin - return cas64(&i, 0, 1) != 0 || atomic_add_32_nv(&j, 1) != 1; +@@ -151,6 +166,7 @@ elif aso note{ cas64 }end lin + return cas64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) cas8(p,o,n) - #define _aso_inc8(p) atomic_add_8_nv(p,1) -@@ -152,6 +167,7 @@ elif aso note{ cas64 }end lin + #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) +@@ -171,6 +187,7 @@ elif aso note{ cas64 }end lin #endif } elif aso note{ cas32 }end link{ @@ -108,11 +116,11 @@ #include int main() { -@@ -159,6 +175,7 @@ elif aso note{ cas32 }end lin - return cas32(&i, 0, 1) != 0 || atomic_add_32_nv(&i, 1) != 1; +@@ -178,6 +195,7 @@ elif aso note{ cas32 }end lin + return cas32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) cas8(p,o,n) - #define _aso_inc8(p) atomic_add_8_nv(p,1) + #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) diff --git a/ksh93-limit-name-len.dif b/ksh93-limit-name-len.dif index 40bf837..db923c8 100644 --- a/ksh93-limit-name-len.dif +++ b/ksh93-limit-name-len.dif @@ -4,7 +4,7 @@ typedef struct Limit_s { -- const char name[8]; +- const char name[16]; + const char* name; const char* description; int index; diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index 5db5080..0722770 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -326,8 +326,8 @@ prev cat.c meta cat.o %.c>%.o cat.c cat prev cat.c --exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I-D${INSTALLROOT}/lib/probe/C/pp/0F689CA5rbincc -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -c cat.c -+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I-D${INSTALLROOT}/lib/probe/C/pp/0F689CA5rbincc -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -DSHOPT_MULTIBYTE -c cat.c +-exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -c cat.c ++exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -DSHOPT_MULTIBYTE -c cat.c done cat.o generated make chgrp.o prev chgrp.c diff --git a/ksh93-signals.dif b/ksh93-signals.dif index 7b90a91..38eacf2 100644 --- a/ksh93-signals.dif +++ b/ksh93-signals.dif @@ -1,14 +1,15 @@ --- src/cmd/ksh93/data/signals.c -+++ src/cmd/ksh93/data/signals.c 2008-09-11 15:49:02.645531304 +0000 -@@ -18,6 +18,8 @@ ++++ src/cmd/ksh93/data/signals.c 2012-02-06 11:16:53.970131637 +0100 +@@ -18,6 +18,9 @@ * * ***********************************************************************/ - #include + #include "defs.h" +#include +#include - #include "shtable.h" - #include "fault.h" ++ + #if defined(SIGCLD) && !defined(SIGCHLD) + # define SIGCHLD SIGCLD --- src/cmd/ksh93/sh/xec.c +++ src/cmd/ksh93/sh/xec.c 2007-12-21 13:28:04.000000000 +0100 @@ -2894,6 +2894,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons diff --git a/ksh93-vm.dif b/ksh93-vm.dif index 79acabc..c8d96af 100644 --- a/ksh93-vm.dif +++ b/ksh93-vm.dif @@ -23,21 +23,7 @@ /* macros to get the data section and size */ #define MMHEAD(file) ROUND(sizeof(Mmvm_t)+strlen(file), ALIGN) -@@ -135,7 +137,12 @@ static Mmvm_t* mmfix(Mmvm_t* mmvm, Mmdis - if(mmdc->proj < 0) - { munmap((Void_t*)mmvm, size); - mmvm = (Mmvm_t*)mmap(base, size, (PROT_READ|PROT_WRITE), -- (MAP_FIXED|MAP_SHARED), fd, (off_t)0 ); -+#if (defined(__ia64__) || defined(__s390x__)) && defined(MAP_32BIT) -+ (MAP_32BIT|MAP_SHARED), -+#else -+ (MAP_FIXED|MAP_SHARED), -+#endif -+ fd, (off_t)0 ); - } - else - { shmdt((Void_t*)mmvm); -@@ -162,10 +169,18 @@ static int mminit(Mmdisc_t* mmdc) +@@ -162,10 +164,18 @@ static int mminit(Mmdisc_t* mmdc) if(mmdc->mmvm) /* already done this */ return 0; diff --git a/ksh93.dif b/ksh93.dif index d2e763e..d6d2a79 100644 --- a/ksh93.dif +++ b/ksh93.dif @@ -11,7 +11,7 @@ + prdata.options = sh_optecho + 5; +# endif prdata.raw = prdata.echon = 0; - prdata.sh = ((Shbltin_t*)extra)->shp; + prdata.sh = context->shp; NOT_USED(argc); @@ -99,7 +103,52 @@ static char* nullarg[] = { 0, 0 }; prdata.sh->universe = 1; @@ -61,7 +61,7 @@ + } + out: +# endif - return(b_print(0,argv,&prdata)); + return(b_print(0,argv,(Shbltin_t*)&prdata)); + } prdata.options = sh_optecho; prdata.raw = 1; diff --git a/leak1.sh b/leak1.sh index 2be93e2..0f36834 100644 --- a/leak1.sh +++ b/leak1.sh @@ -3,7 +3,7 @@ PATH=/bin:/usr/bin:/usr/sbin:/sbin getSampleInterval() { return 0; } -typeset -ilu times=4000 +typeset -lui count=${1:-4000} typeset -ilu leak=0 typeset -a curstate=(0 0 0) @@ -33,7 +33,7 @@ lessequal() } oldstate=($(vm)) -while ((times-- > 0)) +while ((count-- > 0)) do interval=$(getSampleInterval) diff --git a/leak2.sh b/leak2.sh index 158a36f..caa82d0 100644 --- a/leak2.sh +++ b/leak2.sh @@ -3,7 +3,7 @@ foo=0 LoopCountForMEMSAP=0 bla=234 -typeset -lui count=4000 +typeset -lui count=${1:-4000} typeset -lui leak=0 typeset -a curstate=(0 0 0) diff --git a/leak3.sh b/leak3.sh index e8a45e8..0a52307 100644 --- a/leak3.sh +++ b/leak3.sh @@ -5,7 +5,7 @@ trap "rm -f $a_sh" EXIT (cat > $a_sh) <<-EOF #!$SHELL - check_proc_handle() + check_proc_handle () { handleSoftLimit=$(ulimit -n) echo \$handleSoftLimit > /dev/null diff --git a/ulimit.sh b/ulimit.sh index 9fa5988..f95ea5a 100644 --- a/ulimit.sh +++ b/ulimit.sh @@ -1,7 +1,7 @@ #!/usr/bin/ksh PATH=/bin:/usr/bin:/usr/sbin:/sbin -typeset -ilu count=20000 +typeset -lui count=${1:-4000} typeset -ilu err=0 trap 'echo "[${0##*/}: error count at $err]"' ERR diff --git a/workaround-stupid-build-system.diff b/workaround-stupid-build-system.diff index 014f3e0..0f996a4 100644 --- a/workaround-stupid-build-system.diff +++ b/workaround-stupid-build-system.diff @@ -8,7 +8,7 @@ +setv CC gcc setv mam_cc_FLAGS setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} - setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} + setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} @@ -27,7 +27,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr @@ -94,7 +94,7 @@ +setv CC gcc setv mam_cc_FLAGS setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} - setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} + setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} @@ -29,7 +29,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr @@ -104,7 +104,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -1346,7 +1346,7 @@ prev +ljobs +@@ -1337,7 +1337,7 @@ prev +ljobs prev +li prev ${mam_libsocket} prev ${mam_libsecdb} @@ -113,7 +113,7 @@ done ksh generated make shcomp make shcomp.o -@@ -1370,7 +1370,7 @@ prev ${mam_libsocket} +@@ -1361,7 +1361,7 @@ prev ${mam_libsocket} prev ${mam_libsecdb} setv CC.DLL -UCC.DLL setv SH_DICT -DSH_DICT="\"libshell\"" @@ -123,16 +123,16 @@ make suid_exec make suid_exec.o --- src/lib/libast/Mamfile -+++ src/lib/libast/Mamfile 2010-08-17 15:00:56.000000000 +0000 ++++ src/lib/libast/Mamfile 2012-02-06 10:05:34.917933005 +0000 @@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS rc setv AS as setv ASFLAGS -setv CC cc +setv CC gcc - setv mam_cc_FLAGS ${mam_cc_DLL} -D_BLD_ast + setv mam_cc_FLAGS ${mam_cc_DLL} -D_BLD_ast setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} - setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} + setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} @@ -27,7 +27,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr @@ -142,7 +142,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -1002,7 +1002,7 @@ make lcgen +@@ -999,7 +999,7 @@ make lcgen make port/lcgen.c prev std/stdio.h implicit done port/lcgen.c @@ -156,83 +156,80 @@ prev comp/fmtmsg.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in --exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x --exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/fmtmsg.h 1.${COTEMP}.x --exec - then rm -f 1.${COTEMP}.x --exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h --exec - fi --exec - ;; --exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_fmtmsg' ast_lib.h > /dev/null || { +-exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x +-exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/fmtmsg.h 1.${COTEMP}.x +-exec - then rm -f 1.${COTEMP}.x +-exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h +-exec - fi +-exec - ;; +-exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_fmtmsg' ast_lib.h > /dev/null || { +exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_fmtmsg' ast_lib.h > /dev/null || { - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x - exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/fmtmsg.h 1.${COTEMP}.x - exec - then rm -f 1.${COTEMP}.x - exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h - exec - fi --exec - } --exec - ;; + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x + exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/fmtmsg.h 1.${COTEMP}.x + exec - then rm -f 1.${COTEMP}.x + exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h + exec - fi + exec - } +-exec - ;; -exec - esac -+exec - } prev ${INSTALLROOT}/include/prototyped.h implicit done ${INSTALLROOT}/include/ast/fmtmsg.h generated make ${INSTALLROOT}/include/ast/libgen.h prev comp/libgen.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in --exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x --exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/libgen.h 1.${COTEMP}.x --exec - then rm -f 1.${COTEMP}.x --exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h --exec - fi --exec - ;; --exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_libgen' ast_lib.h > /dev/null || { +-exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x +-exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/libgen.h 1.${COTEMP}.x +-exec - then rm -f 1.${COTEMP}.x +-exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h +-exec - fi +-exec - ;; +-exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_libgen' ast_lib.h > /dev/null || { +exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_libgen' ast_lib.h > /dev/null || { - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x - exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/libgen.h 1.${COTEMP}.x - exec - then rm -f 1.${COTEMP}.x - exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h - exec - fi --exec - } --exec - ;; + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x + exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/libgen.h 1.${COTEMP}.x + exec - then rm -f 1.${COTEMP}.x + exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h + exec - fi + exec - } +-exec - ;; -exec - esac -+exec - } prev ${INSTALLROOT}/include/prototyped.h implicit done ${INSTALLROOT}/include/ast/libgen.h generated make ${INSTALLROOT}/include/ast/syslog.h prev comp/syslog.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in --exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x --exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/syslog.h 1.${COTEMP}.x --exec - then rm -f 1.${COTEMP}.x --exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h --exec - fi --exec - ;; --exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_syslog' ast_lib.h > /dev/null || { +-exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x +-exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/syslog.h 1.${COTEMP}.x +-exec - then rm -f 1.${COTEMP}.x +-exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h +-exec - fi +-exec - ;; +-exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_syslog' ast_lib.h > /dev/null || { +exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_syslog' ast_lib.h > /dev/null || { - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x - exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/syslog.h 1.${COTEMP}.x - exec - then rm -f 1.${COTEMP}.x - exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h - exec - fi --exec - } --exec - ;; + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x + exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/syslog.h 1.${COTEMP}.x + exec - then rm -f 1.${COTEMP}.x + exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h + exec - fi + exec - } +-exec - ;; -exec - esac -+exec - } prev ast_namval.h implicit prev ${INSTALLROOT}/include/prototyped.h implicit done ${INSTALLROOT}/include/ast/syslog.h generated --- src/lib/libcmd/Mamfile -+++ src/lib/libcmd/Mamfile 2008-02-14 12:08:37.000000000 +0000 ++++ src/lib/libcmd/Mamfile 2012-02-06 10:06:34.179552617 +0000 @@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS rc setv AS as setv ASFLAGS -setv CC cc +setv CC gcc - setv mam_cc_FLAGS ${mam_cc_DLL} + setv mam_cc_FLAGS ${mam_cc_DLL} setv CCFLAGS ${mam_cc_DEBUG} - setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} + setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} @@ -29,7 +29,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr @@ -252,7 +249,7 @@ +setv CC gcc setv mam_cc_FLAGS ${mam_cc_DLL} setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} - setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} + setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} @@ -29,7 +29,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr @@ -263,8 +260,8 @@ setv TAR tar setv YACC yacc --- src/lib/libpp/Mamfile -+++ src/lib/libpp/Mamfile 2012-01-24 18:31:21.979645513 +0000 -@@ -665,7 +665,7 @@ exec - . ++++ src/lib/libpp/Mamfile 2012-01-24 18:31:22.000000000 +0000 +@@ -661,7 +661,7 @@ exec - . exec - w exec - q exec - ! @@ -273,7 +270,7 @@ exec - ./${COTEMP}.exe > pp.yacc exec - rm -f 1.${COTEMP}.c ${COTEMP}.exe done pp.yacc generated -@@ -707,7 +707,7 @@ exec - . +@@ -703,7 +703,7 @@ exec - . exec - w exec - q exec - !