15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe s11u1-sru
authorMohana Rao Gorai <mohana.gorai@oracle.com>
Mon, 01 Apr 2013 23:23:56 -0500
branchs11u1-sru
changeset 2544 50b56aff2479
parent 2543 0efbf13ff5f3
child 2545 dc88d792018e
15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe 15819673 SUNBT7202182 ksh93 script hangs when ps -ef gets stuck in fifo_write
components/ksh93/Makefile
components/ksh93/patches/Bug15794787,15819673.patch
--- a/components/ksh93/Makefile	Fri Mar 29 16:21:25 2013 -0700
+++ b/components/ksh93/Makefile	Mon Apr 01 23:23:56 2013 -0500
@@ -72,7 +72,8 @@
 					 CR7019368.patch CR6729252.patch \
 					 MAP_TYPE_64_Bits.patch CR7167466.patch \
 					 CR7168611.patch CR7178717.patch \
-					 CR7175995.patch CR7128313.patch
+					 CR7175995.patch CR7128313.patch \
+					 Bug15794787,15819673.patch
 
 # Fixup HOSTTYPE to match uname output and bits
 HOSTTYPE32=sol11.$(shell uname -p)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/Bug15794787,15819673.patch	Mon Apr 01 23:23:56 2013 -0500
@@ -0,0 +1,39 @@
+--- a/src/cmd/ksh93/sh/xec.c	Thu Nov 29 22:06:17 2012
++++ b/src/cmd/ksh93/sh/xec.c	Fri Nov 30 00:45:30 2012
[email protected]@ -540,8 +540,10 @@
+ 	static Sfio_t *io_save;
+ 	volatile int traceon=0, lineno=0;
+ 	int binscript=shp->binscript;
++	char comsub = shp->comsub;
+ 	io_save = iop; /* preserve correct value across longjmp */
+ 	shp->binscript = 0;
++	shp->comsub = 0;
+ #define SH_TOPFUN	0x8000	/* this is a temporary tksh hack */
+ 	if (mode & SH_TOPFUN)
+ 	{
[email protected]@ -581,6 +583,7 @@
+ 	}
+ 	sh_popcontext(shp,&buff);
+ 	shp->binscript = binscript;
++	shp->comsub = comsub;
+ 	if(traceon)
+ 		sh_onoption(SH_XTRACE);
+ 	if(lineno)
[email protected]@ -3281,7 +3284,8 @@
+ 	struct funenv fun;
+ 	char *fname = nv_getval(SH_FUNNAMENOD);
+ 	struct Level	*lp =(struct Level*)(SH_LEVELNOD->nvfun);
+-	int		level, pipepid=shp->pipepid;
++	int		level, pipepid=shp->pipepid, comsub=shp->comsub;
++	shp->comsub = 0;
+ 	shp->pipepid = 0;
+ 	sh_stats(STAT_FUNCT);
+ 	if(!lp->hdr.disc)
[email protected]@ -3323,6 +3327,7 @@
+ 	lp->maxlevel = level;
+ 	SH_LEVELNOD->nvalue.s = lp->maxlevel;
+ 	shp->last_root = nv_dict(DOTSHNOD);
++	shp->comsub = comsub;
+ #if 0
+ 	nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
+ #else