Updating link to change in openSUSE:Factory/ksh revision 36.0

OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=c6c6ba7d2e835dcf237d2685d75bd36f
This commit is contained in:
OBS User buildservice-autocommit 2009-12-21 22:11:48 +00:00 committed by Git OBS Bridge
parent c404054fbc
commit 359ac87728
9 changed files with 64 additions and 193 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a2500bcbcfa21b782a8b72cceb55dc776dd232ea91da417bc35879fd13bbbc0
size 274616

3
INIT.2009-12-18.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f58767a5bc7ff03824a3e161b0f380d079fe733aed34df7c8c0034cf4f2aa866
size 274759

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:64ef53f3cda7bc59455a9acb0ed322f202dab04066e1d216363cfa699bdaeb01
size 1464922

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:030d9c20ab19632b81c9758a9f7edbfe0fe3d3762d6a2ec2f8eb13465ce120c1
size 1466114

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Dec 21 14:20:21 CET 2009 - werner@suse.de
- Update to 2009-12-18 beta test of ksh93t+ for bug fixes
09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals
< SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed.
09-12-18 A bug where [[ -v var ]] was incorrect for some variables (including
LC_* vars) has been fixed.
09-12-15 A bug that produced a syntax error when a multibyte character
straddled a buffer boundary has been fixed.
09-12-11 A bug where the subscript of an unset variable was not evaluated has
been fixed.
09-12-09 A bug where shcomp dumped core on certain syntax errors has been fixed.
09-12-07 A bug where a parent shell environment var reset in a subshell removed
the value in subsequent children of the parent shell has been fixed.
-------------------------------------------------------------------
Wed Dec 9 18:01:09 CET 2009 - werner@suse.de
@ -88,7 +105,7 @@ Fri Oct 30 16:23:36 CET 2009 - werner@suse.de
did not display an error message has been fixed.
09-08-24 When processing profiles, ksh93 now violates the POSIX standard and
treats &> as a redirection operator similar to bash.
09-08-23 A bug in the handling of the trap on SIGPIPE that could lead to am
09-08-23 A bug in the handling of the trap on SIGPIPE that could lead to a
memory fault has been fixed.
09-08-21 A bug in the handling of the comma operator in arithmetic expressions
that could cause a core dump on some systems has been fixed.

View File

@ -29,11 +29,11 @@ Group: System/Shells
PreReq: /bin/ln /bin/rm /etc/bash.bashrc /bin/true
AutoReqProv: on
Version: 93t
Release: 17
Release: 18
Summary: Korn Shell
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: INIT.2009-12-06.tar.bz2
Source1: ast-ksh.2009-12-06.tar.bz2
Source: INIT.2009-12-18.tar.bz2
Source1: ast-ksh.2009-12-18.tar.bz2
Source2: ast-open-locale.2008-07-25.tar.bz2
Source10: leak1.sh
Source11: leak2.sh
@ -229,22 +229,22 @@ find share/ -type d -a -empty | xargs -r rm -vrf
libshell)
base=src/cmd/ksh93
vers=$(grep ^VERSION ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG $LDFLAGS -ldll -lcmd -last -lm -ldl"
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast $LDSOFLG $LDFLAGS -ldll -lcmd -last -lm -ldl"
;;
libdll)
base=src/lib/$lib
vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG -ldl -last"
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast $LDSOFLG -ldl -last"
;;
libcmd)
base=src/lib/$lib
vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG -last"
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast $LDSOFLG -last"
;;
libast)
base=src/lib/$lib
vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG"
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast $LDSOFLG"
;;
esac
soname="-Wl,-soname,${lib}.so.${vers%.*},-stats"
@ -290,6 +290,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf
SHCOMP=${root}/bin/shcomp.test
export PATH SHCOMP SHELL
pushd ${test}
ln -sf ${root}/lib ${test}/../
${root}/bin/ksh.test shtests
${root}/bin/ksh.test %{S:10}
${root}/bin/ksh.test %{S:11}

View File

@ -1,146 +0,0 @@
| Bug bnc#520598 : memory leak in ksh
|
| From: David Korn <dgk@research.att.com>
| Subject: Re: Re: [ast-developers] Re: Memory leak in ksh upto 2009-06-30
|
| I started looking at this before I went on vacation. Here are changes
| I makde to sh/nvdisc.c that eliminate much of the problem.
| Note, that line numbers differ because my version doesn't have
| the copyright notices.
|
--- src/cmd/ksh93/sh/nvdisc.c
+++ src/cmd/ksh93/sh/nvdisc.c 2009-07-09 18:57:02.000000000 +0200
@@ -573,13 +573,14 @@ Namfun_t *nv_clone_disc(register Namfun_
{
register Namfun_t *nfp;
register int size;
+ if(!fp->disc && !fp->next && (fp->nofree&1))
+ return(fp);
if(!(size=fp->dsize) && (!fp->disc || !(size=fp->disc->dsize)))
size = sizeof(Namfun_t);
if(!(nfp=newof(NIL(Namfun_t*),Namfun_t,1,size-sizeof(Namfun_t))))
return(0);
memcpy(nfp,fp,size);
- if(flags&NV_COMVAR)
- nfp->nofree &= ~1;
+ nfp->nofree &= ~1;
nfp->nofree |= (flags&NV_RDONLY)?1:0;
return(nfp);
}
|
| From: David Korn <dgk@research.att.com>
| Subject: Re: Re: [ast-developers] Re: Memory leak in ksh upto 2009-06-30
|
| This change eliminates about 80% of the leak in the case that you sent.
| I will send another change to eliminate the rest.
|
--- src/cmd/ksh93/sh/xec.c
+++ src/cmd/ksh93/sh/xec.c 2009-08-06 18:07:12.000000000 +0200
@@ -352,7 +352,12 @@ static void put_level(Namval_t* np,const
int16_t level, oldlevel = (int16_t)nv_getnum(np);
nv_putv(np,val,flags,fp);
if(!val)
+ {
+ fp = nv_stack(np, NIL(Namfun_t*));
+ if(fp && !fp->nofree)
+ free((void*)fp);
return;
+ }
level = nv_getnum(np);
if(level<0 || level > lp->maxlevel)
{
|
| From: David Korn <dgk@research.att.com>
| Subject: Re: Re: [ast-developers] Re: Memory leak in ksh upto 2009-06-30
|
| Here is another fix that should eliminate the leak from the
| script that you sent.
|
--- src/cmd/ksh93/bltins/read.c
+++ src/cmd/ksh93/bltins/read.c 2009-08-06 19:00:24.000000000 +0200
@@ -67,9 +67,14 @@ int b_read(int argc,char *argv[], void *
int save_prompt, fixargs=((Shbltin_t*)extra)->invariant;
struct read_save *rp;
static char default_prompt[3] = {ESC,ESC};
+ rp = (struct read_save*)(((Shbltin_t*)extra)->data);
if(argc==0)
+ {
+ if(rp)
+ free((void*)rp);
return(0);
- if(rp = (struct read_save*)(((Shbltin_t*)extra)->data))
+ }
+ if(rp)
{
flags = rp->flags;
timeout = rp->timeout;
|
| From: David Korn <dgk@research.att.com>
| Subject: Re: Re: [ast-developers] Re: Memory leak in ksh upto 2009-06-30
|
| I hope that I finally got it. Here are the changes to init.c and subshell.c
|
--- src/cmd/ksh93/sh/init.c
+++ src/cmd/ksh93/sh/init.c 2009-08-10 16:05:02.000000000 +0200
@@ -445,10 +445,18 @@ static void put_cdpath(register Namval_t
static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
register struct ifs *ip = (struct ifs*)fp;
+ Shell_t *shp;
ip->ifsnp = 0;
+ if(!val)
+ {
+ fp = nv_stack(np, NIL(Namfun_t*));
+ if(fp && !fp->nofree)
+ free((void*)fp);
+ }
if(val != np->nvalue.cp)
nv_putv(np, val, flags, fp);
-
+ if(!val && !(flags&NV_CLONE) && (fp=np->nvfun) && !fp->disc && (shp=(Shell_t*)(fp->last)))
+ nv_stack(np,&((Init_t*)shp->init_context)->IFS_init.hdr);
}
/*
@@ -522,7 +530,7 @@ static void put_seconds(register Namval_
fp = nv_stack(np, NIL(Namfun_t*));
if(fp && !fp->nofree)
free((void*)fp);
- nv_unset(np);
+ nv_putv(np, val, flags, fp);
return;
}
if(!np->nvalue.dp)
--- src/cmd/ksh93/sh/subshell.c
+++ src/cmd/ksh93/sh/subshell.c 2009-08-10 16:05:19.000000000 +0200
@@ -254,7 +254,7 @@ Namval_t *sh_assignok(register Namval_t
Namarr_t *ap;
int save;
/* don't bother with this */
- if(!sp->shpwd || (nv_isnull(np) && !add))
+ if(!sp->shpwd || (nv_isnull(np) && !add) || np==SH_LEVELNOD)
return(np);
/* don't bother to save if in newer scope */
if(!(rp=shp->st.real_fun) || !(dp=rp->sdict))
@@ -334,7 +334,7 @@ static void nv_restore(struct subshell *
continue;
if(nv_isarray(mp))
nv_putsub(mp,NIL(char*),ARRAY_SCAN);
- _nv_unset(mp,NV_RDONLY);
+ _nv_unset(mp,NV_RDONLY|NV_CLONE);
if(nv_isarray(np))
{
nv_clone(np,mp,NV_MOVE);
@@ -346,7 +346,11 @@ static void nv_restore(struct subshell *
mp->nvfun = np->nvfun;
mp->nvflag = np->nvflag;
if(nv_cover(mp))
- nv_putval(mp, nv_getval(np),0);
+ {
+ nv_putval(mp, nv_getval(np),np->nvflag|NV_NOFREE);
+ if(!nv_isattr(np,NV_NOFREE))
+ nv_offattr(mp,NV_NOFREE);
+ }
else
mp->nvalue.cp = np->nvalue.cp;
np->nvfun = 0;

View File

@ -1,5 +1,5 @@
--- src/cmd/ksh93/sh.1
+++ src/cmd/ksh93/sh.1 2008-09-22 14:11:56.000000000 +0200
+++ src/cmd/ksh93/sh.1 2008-09-22 12:11:56.000000000 +0000
@@ -201,7 +201,7 @@ separated by
.BR \(bv .
The standard output of each command but the last
@ -10,7 +10,7 @@
Each command,
except possibly the last,
--- src/cmd/ksh93/bltins/print.c
+++ src/cmd/ksh93/bltins/print.c 2008-05-05 13:20:21.000000000 +0200
+++ src/cmd/ksh93/bltins/print.c 2008-05-05 11:20:21.000000000 +0000
@@ -86,7 +86,11 @@ static char* nullarg[] = { 0, 0 };
{
static char bsd_univ;
@ -78,8 +78,8 @@
prdata.raw = 1;
while(argv[1] && *argv[1]=='-')
--- src/cmd/ksh93/data/msg.c
+++ src/cmd/ksh93/data/msg.c 2007-12-20 19:01:26.000000000 +0100
@@ -185,7 +185,7 @@ const char e_bash_login[] = "$HOME/.bash
+++ src/cmd/ksh93/data/msg.c 2007-12-20 18:01:26.000000000 +0000
@@ -186,7 +186,7 @@ const char e_bash_login[] = "$HOME/.bash
const char e_bash_logout[] = "$HOME/.bash_logout";
const char e_bash_profile[] = "$HOME/.bash_profile";
#endif
@ -89,7 +89,7 @@
#if SHOPT_SUID_EXEC
const char e_suidexec[] = "/etc/suid_exec";
--- src/cmd/ksh93/data/variables.c
+++ src/cmd/ksh93/data/variables.c 2008-09-18 19:22:24.000000000 +0200
+++ src/cmd/ksh93/data/variables.c 2008-09-18 17:22:24.000000000 +0000
@@ -68,7 +68,7 @@ const struct shtable2 shtab_variables[]
"OPTARG", 0, (char*)0,
"OPTIND", NV_NOFREE|NV_INTEGER, (char*)0,
@ -100,7 +100,7 @@
"LC_ALL", 0, (char*)0,
"LC_COLLATE", 0, (char*)0,
--- src/cmd/ksh93/features/options
+++ src/cmd/ksh93/features/options 2007-12-20 19:01:26.000000000 +0100
+++ src/cmd/ksh93/features/options 2007-12-20 18:01:26.000000000 +0000
@@ -36,7 +36,7 @@ tst cross{
option TEST_L $?
test -f /etc/ksh.kshrc -o -f /etc/bash.bashrc &&
@ -111,7 +111,7 @@
}end
--- src/cmd/ksh93/sh/io.c
+++ src/cmd/ksh93/sh/io.c 2008-09-11 17:16:16.000000000 +0200
+++ src/cmd/ksh93/sh/io.c 2008-09-11 15:16:16.000000000 +0000
@@ -641,6 +641,7 @@ int sh_close(register int fd)
#ifdef O_SERVICE
@ -129,8 +129,8 @@
#endif
--- src/cmd/ksh93/sh/main.c
+++ src/cmd/ksh93/sh/main.c 2007-12-20 19:01:26.000000000 +0100
@@ -129,9 +129,9 @@ int sh_source(Shell_t *shp, Sfio_t *iop,
+++ src/cmd/ksh93/sh/main.c 2007-12-20 18:01:26.000000000 +0000
@@ -130,9 +130,9 @@ int sh_source(Shell_t *shp, Sfio_t *iop,
}
#ifdef S_ISSOCK
@ -142,7 +142,7 @@
#endif
int sh_main(int ac, char *av[], Shinit_f userinit)
@@ -196,7 +196,7 @@ int sh_main(int ac, char *av[], Shinit_f
@@ -198,7 +198,7 @@ int sh_main(int ac, char *av[], Shinit_f
}
if(!sh_isoption(SH_RC) && (sh_isoption(SH_BASH) && !sh_isoption(SH_POSIX)
#if SHOPT_REMOTE
@ -152,7 +152,7 @@
))
sh_onoption(SH_RC);
--- src/cmd/ksh93/sh/suid_exec.c
+++ src/cmd/ksh93/sh/suid_exec.c 2007-12-20 19:01:26.000000000 +0100
+++ src/cmd/ksh93/sh/suid_exec.c 2007-12-20 18:01:26.000000000 +0000
@@ -65,7 +65,11 @@
#define THISPROG "/etc/suid_exec"
#define DEFSHELL "/bin/sh"
@ -166,7 +166,7 @@
static int endsh(const char*);
#ifndef _lib_setregid
--- src/cmd/ksh93/tests/attributes.sh
+++ src/cmd/ksh93/tests/attributes.sh 2009-07-09 15:14:04.632882500 +0200
+++ src/cmd/ksh93/tests/attributes.sh 2009-07-09 13:14:05.000000000 +0000
@@ -199,7 +199,7 @@ hello worldhello worldhello world
[[ $v1 == "$b1" ]] || err_exit "v1=$v1 should be $b1"
[[ $v2 == "$x" ]] || err_exit "v1=$v2 should be $x"
@ -177,7 +177,7 @@
unset var
typeset -b var
--- src/cmd/ksh93/tests/builtins.sh
+++ src/cmd/ksh93/tests/builtins.sh 2009-07-09 15:14:50.154431765 +0200
+++ src/cmd/ksh93/tests/builtins.sh 2009-07-09 13:14:50.000000000 +0000
@@ -332,7 +332,7 @@ wait $pid1
(( $? == 1 )) || err_exit "wait not saving exit value"
wait $pid2
@ -188,10 +188,10 @@
for v in ${v//,/ }
do v=${v#*:}
--- src/cmd/ksh93/tests/locale.sh
+++ src/cmd/ksh93/tests/locale.sh 2009-12-09 14:01:40.927429385 +0100
@@ -134,11 +134,11 @@
+++ src/cmd/ksh93/tests/locale.sh 2009-12-09 13:01:41.000000000 +0000
@@ -135,11 +135,11 @@ set -- $($SHELL -c "
unset LC_CTYPE
export LANG=$locale
export LANG=$utf_8
export LC_ALL=C
- command wc -C < $tmp/two_euro_chars.txt
+ command wc -m < $tmp/two_euro_chars.txt
@ -205,8 +205,8 @@
got=$*
[[ $got == $exp ]] || err_exit "command wc LC_ALL default failed -- expected '$exp', got '$got'"
--- src/cmd/ksh93/tests/path.sh
+++ src/cmd/ksh93/tests/path.sh 2008-09-11 18:02:46.000000000 +0200
@@ -228,7 +228,7 @@ builtin getconf
+++ src/cmd/ksh93/tests/path.sh 2008-09-11 16:02:46.000000000 +0000
@@ -269,7 +269,7 @@ builtin getconf
getconf UNIVERSE - att # override sticky default 'UNIVERSE = foo'
[[ $(PATH=/usr/ucb/bin:/usr/bin echo -n ucb) == 'ucb' ]] || err_exit "ucb universe echo ignores -n option"
@ -216,7 +216,7 @@
PATH=$path
--- src/lib/libast/disc/memfatal.c
+++ src/lib/libast/disc/memfatal.c 2009-07-09 15:30:38.706403542 +0200
+++ src/lib/libast/disc/memfatal.c 2009-07-09 13:30:39.000000000 +0000
@@ -72,7 +72,7 @@ memfatal(void)
{
Vmdisc_t* disc;
@ -227,7 +227,7 @@
disc->exceptf = nomalloc;
}
--- src/lib/libast/features/align.c
+++ src/lib/libast/features/align.c 2007-12-20 19:01:26.000000000 +0100
+++ src/lib/libast/features/align.c 2007-12-20 18:01:26.000000000 +0000
@@ -32,6 +32,7 @@
#include "FEATURE/common"
@ -237,7 +237,7 @@
union _u_
{
--- src/lib/libast/features/botch.c
+++ src/lib/libast/features/botch.c 2007-12-20 19:01:26.000000000 +0100
+++ src/lib/libast/features/botch.c 2007-12-20 18:01:26.000000000 +0000
@@ -27,6 +27,7 @@
* generate ast traps for botched standard prototypes
*/
@ -247,8 +247,8 @@
#include "FEATURE/lib"
--- src/lib/libast/features/lib
+++ src/lib/libast/features/lib 2007-12-20 19:01:26.000000000 +0100
@@ -516,14 +516,19 @@ tst lib_utime_now note{ utime works with
+++ src/lib/libast/features/lib 2007-12-20 18:01:26.000000000 +0000
@@ -517,14 +517,19 @@ tst lib_utime_now note{ utime works with
}end
tst cross{
@ -276,7 +276,7 @@
}end
--- src/lib/libast/misc/procopen.c
+++ src/lib/libast/misc/procopen.c 2007-12-20 19:01:26.000000000 +0100
+++ src/lib/libast/misc/procopen.c 2007-12-20 18:01:26.000000000 +0000
@@ -537,7 +537,7 @@ procopen(const char* cmd, char** argv, c
if (!fork())
{
@ -287,7 +287,7 @@
}
sleep(2);
--- src/lib/libast/sfio/sfstrtof.h
+++ src/lib/libast/sfio/sfstrtof.h 2007-12-20 19:01:26.000000000 +0100
+++ src/lib/libast/sfio/sfstrtof.h 2007-12-20 18:01:26.000000000 +0000
@@ -54,7 +54,7 @@
#if !defined(S2F_function)
@ -298,8 +298,8 @@
#define S2F_scan 1
#ifndef elementsof
--- src/lib/libcmd/chmod.c
+++ src/lib/libcmd/chmod.c 2007-12-20 19:02:37.000000000 +0100
@@ -161,7 +161,7 @@ b_chmod(int argc, char** argv, void* con
+++ src/lib/libcmd/chmod.c 2007-12-20 18:02:37.000000000 +0000
@@ -162,7 +162,7 @@ b_chmod(int argc, char** argv, void* con
int notify = 0;
int ignore = 0;
int show = 0;
@ -308,7 +308,7 @@
int chlink = 0;
#endif
struct stat st;
@@ -185,7 +185,7 @@ b_chmod(int argc, char** argv, void* con
@@ -186,7 +186,7 @@ b_chmod(int argc, char** argv, void* con
force = 1;
continue;
case 'h':
@ -317,7 +317,7 @@
chlink = 1;
#endif
continue;
@@ -242,7 +242,7 @@ b_chmod(int argc, char** argv, void* con
@@ -249,7 +249,7 @@ b_chmod(int argc, char** argv, void* con
}
}
chmodf =

View File

@ -1,6 +1,5 @@
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/libshell\.so.*")
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/libdll\.so.*")
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/libcmd\.so.*")
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/libast\.so.*")
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/.*\.so.*")
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/bin/shcomp.*")
addFilter(".*binary-or-shlib-defines-rpath.*/lib/ast/bin/ksh.*")
addFilter(".*devel-file-in-non-devel-package.*/lib/ast/.*\.so")
addFilter(".*script-without-shebang.*//usr/share/ksh/fun/.*")