Roland Mainz wrote: > Roland Mainz wrote: > > Edward Pilatowicz wrote: > > > On Tue, Feb 03, 2009 at 04:39:31PM -0800, Edward Pilatowicz wrote: > > > > so i just upgraded this morning from snv_105 to snv_106. now > > > > Install(1M) is hanging whenever i run it. i'm wondering if anyone else > > > > has seen this problem. (perhaps there's already a bug filed?) > > > > > > > > i'm running it as follows: > > > > Install -o debug -k i86xpv -T domu-219:/tmp > > > > > > > > and here's where it's hung: > > > > ---8<--- > > > > edp at mcescher$ pstack 204600 > > > > 204600: /bin/ksh /opt/onbld/bin/Install -o debug -k i86xpv -T > > > > domu-219:/tmp > > > > fffffd7fff2e3d1a write (1, 4154c0, 64) > > > > fffffd7ffefdafc8 sfwr () + 2d0 > > > > fffffd7ffefc0f6f _sfflsbuf () + 217 > > > > fffffd7ffefcb9f7 sfsync () + 17f > > > > fffffd7ffefc5c58 _sfphead () + 188 > > > > fffffd7ffefc5ef5 _sfpmove () + 55 > > > > fffffd7ffefc2595 _sfmode () + 22d > > > > fffffd7ffefc5fb1 sfpool () + 99 > > > > fffffd7fff15eb8e sh_exec () + 2f56 > > > > fffffd7fff15f78c sh_exec () + 3b54 > > > > fffffd7fff15d9c8 sh_exec () + 1d90 > > > > fffffd7fff15788e sh_subshell () + 646 > > > > fffffd7fff134562 comsubst () + 8a2 > > > > fffffd7fff12f61f copyto () + bcf > > > > fffffd7fff12df79 sh_macexpand () + 1f1 > > > > fffffd7fff1129f5 arg_expand () + a5 > > > > fffffd7fff112812 sh_argbuild () + 9a > > > > fffffd7fff15dbe2 sh_exec () + 1faa > > > > fffffd7fff15d854 sh_exec () + 1c1c > > > > fffffd7fff0f22ef b_dot_cmd () + 507 > > > > fffffd7fff161559 sh_funct () + 199 > > > > fffffd7fff15ef35 sh_exec () + 32fd > > > > fffffd7fff136e86 exfile () + 786 > > > > fffffd7fff136676 sh_main () + 7fe > > > > 0000000000400e72 main () + 52 > > > > 0000000000400ccc ???? > > > > ---8<--- > > > > > > > > there is only one place where Install(1M) invokes "uniq": > > > > set -- `grep "^CONF" $modlist | sort | uniq`; > > > > > > > > as it turns out, i can easily reproduce this problem as follows: > > > > ---8<--- > > > > edp at mcescher$ ksh93 > > > > edp at mcescher$ set -- `cat /etc/termcap | sort | uniq` > > > > <hang> > > > > ---8<--- > > > > > > ok. i just filed: > > > 6800929 snv_106 ksh93 update breaks Install(1M) > > > > Uhm... I think I have a "solid lead" where this bug hides... > > ... but I need a sponsor for the putback (April Chin is no longer at > > Sun) ... > > I have a patch which fixes the problem... > ... does anyone have time to sponsor the fix for CR#6800929, please ?
Attached (as "cr6800929_large_command_substitution_hang20090206001.diff.txt") is a patch which should fix the problem (the patch itself is complete but I am going to add a ksh93 test suite module to make sure we won't hit this bug again in the future) ... ... Edward: Do you have time to sponsor this, please ? ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) -------------- next part -------------- Index: src/lib/libshell/common/include/defs.h =================================================================== --- src/lib/libshell/common/include/defs.h (revision 1391) +++ src/lib/libshell/common/include/defs.h (working copy) @@ -166,6 +166,7 @@ char winch; \ char indebug; /* set when in debug trap */ \ unsigned char lastsig; /* last signal received */ \ + char subshare; /* set when in ${..} comsub */ \ char *readscript; /* set before reading a script */ \ int *inpipe; /* input pipe pointer */ \ int *outpipe; /* output pipe pointer */ \ Index: src/lib/libshell/common/sh/subshell.c =================================================================== --- src/lib/libshell/common/sh/subshell.c (revision 1391) +++ src/lib/libshell/common/sh/subshell.c (working copy) @@ -89,6 +89,7 @@ int coutpipe; int cpipe; int nofork; + char subshare; } *subshell_data; static int subenv; @@ -477,7 +478,9 @@ sp->bckpid = shp->bckpid; if(comsub) sh_stats(STAT_COMSUB); - if(!comsub || (comsub==1 && !sh_isoption(SH_SUBSHARE))) + sp->subshare = shp->subshare; + shp->subshare = comsub==2 || (comsub==1 && sh_isoption(SH_SUBSHARE)); + if(!comsub || !shp->subshare) { sp->shpwd = shp->pwd; sp->pwd = (shp->pwd?strdup(shp->pwd):0); @@ -677,6 +680,7 @@ shp->cpipe[1] = sp->cpipe; shp->coutpipe = sp->coutpipe; } + shp->subshare = sp->subshare; if(shp->subshell) SH_SUBSHELLNOD->nvalue.s = --shp->subshell; if(sp->sig) Index: src/lib/libshell/common/sh/xec.c =================================================================== --- src/lib/libshell/common/sh/xec.c (revision 1391) +++ src/lib/libshell/common/sh/xec.c (working copy) @@ -1406,7 +1406,12 @@ pid_t savepgid = job.curpgid; job.curpgid = 0; if(shp->subshell) - sh_subtmpfile(1); + { + if(shp->subshare) + sh_subtmpfile(0); + else + sh_subfork(); + } shp->inpipe = pvo; shp->outpipe = pvn; pvo[1] = -1;