15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
authorMohana Rao Gorai <mohana.gorai@oracle.com>
Mon, 11 Feb 2013 23:10:54 -0700
changeset 1154 077a95a65162
parent 1153 984eb3d32e04
child 1155 51899f20aab8
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	Mon Feb 11 13:25:41 2013 -0500
+++ b/components/ksh93/Makefile	Mon Feb 11 23:10:54 2013 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 PARFAIT_BUILD=no
 
@@ -77,7 +77,7 @@
 					 CR7168611.patch CR7178717.patch \
 					 CR7175995.patch \
 					 CR7186440_ksh93_disable_predictive_editing.patch \
-					 CR7128313.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 Feb 11 23:10:54 2013 -0700
@@ -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