1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License (the "License"). 6# You may not use this file except in compliance with the License. 7# 8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9# or http://www.opensolaris.org/os/licensing. 10# See the License for the specific language governing permissions 11# and limitations under the License. 12# 13# When distributing Covered Code, include this CDDL HEADER in each 14# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15# If applicable, add the following below this CDDL HEADER, with the 16# fields enclosed by brackets "[]" replaced with your own identifying 17# information: Portions Copyright [yyyy] [name of copyright owner] 18# 19# CDDL HEADER END 20# 21 22# 23# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26 27# 28# ERRATA.txt 29# 30# Errata/problems/notes about problems in the current sources 31# 32 33######## Errata #001: ######## 34The usage of |posix_spawn()| has been manually disabled because there seems to be a 35race condition which cases sporadic failures like this: 36-- snip --. 37$ builtin | fgrep sum | fgrep sum 38/usr/ast/bin/sum 39/usr/bin/sum 40$ builtin | fgrep sum | fgrep sum 41fgrep: fgrep: cannot execute [Exec format error] 42-- snip --. 43The following files have been changed: 44-- snip -- 45Index: src/lib/libast/sparcv9/include/ast/ast_lib.h 46=================================================================== 47--- src/lib/libast/sparcv9/include/ast/ast_lib.h (revision 888) 48+++ src/lib/libast/sparcv9/include/ast/ast_lib.h (working copy) 49@@ -160,7 +160,7 @@ 50 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 51 #define _lib_vfork 1 /* vfork exists and it works */ 52 #define _real_vfork 1 /* vfork child shares data with parent */ 53-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 54+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 55 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 56 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 57 #define _hdr_string 1 /* #include <string.h> ok */ 58Index: src/lib/libast/sparcv9/src/lib/libast/ast_lib.h 59=================================================================== 60--- src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (revision 888) 61+++ src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (working copy) 62@@ -139,7 +139,7 @@ 63 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 64 #define _lib_vfork 1 /* vfork exists and it works */ 65 #define _real_vfork 1 /* vfork child shares data with parent */ 66-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 67+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 68 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 69 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 70 #define _hdr_string 1 /* #include <string.h> ok */ 71Index: src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib 72=================================================================== 73--- src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (revision 888) 74+++ src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (working copy) 75@@ -139,7 +139,7 @@ 76 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 77 #define _lib_vfork 1 /* vfork exists and it works */ 78 #define _real_vfork 1 /* vfork child shares data with parent */ 79-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 80+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 81 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 82 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 83 #define _hdr_string 1 /* #include <string.h> ok */ 84Index: src/lib/libast/sparc/include/ast/ast_lib.h 85=================================================================== 86--- src/lib/libast/sparc/include/ast/ast_lib.h (revision 888) 87+++ src/lib/libast/sparc/include/ast/ast_lib.h (working copy) 88@@ -171,7 +171,7 @@ 89 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 90 #define _lib_vfork 1 /* vfork exists and it works */ 91 #define _real_vfork 1 /* vfork child shares data with parent */ 92-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 93+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 94 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 95 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 96 #define _hdr_string 1 /* #include <string.h> ok */ 97Index: src/lib/libast/sparc/src/lib/libast/ast_lib.h 98=================================================================== 99--- src/lib/libast/sparc/src/lib/libast/ast_lib.h (revision 888) 100+++ src/lib/libast/sparc/src/lib/libast/ast_lib.h (working copy) 101@@ -150,7 +150,7 @@ 102 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 103 #define _lib_vfork 1 /* vfork exists and it works */ 104 #define _real_vfork 1 /* vfork child shares data with parent */ 105-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 106+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 107 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 108 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 109 #define _hdr_string 1 /* #include <string.h> ok */ 110Index: src/lib/libast/sparc/src/lib/libast/FEATURE/lib 111=================================================================== 112--- src/lib/libast/sparc/src/lib/libast/FEATURE/lib (revision 888) 113+++ src/lib/libast/sparc/src/lib/libast/FEATURE/lib (working copy) 114@@ -150,7 +150,7 @@ 115 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 116 #define _lib_vfork 1 /* vfork exists and it works */ 117 #define _real_vfork 1 /* vfork child shares data with parent */ 118-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 119+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 120 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 121 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 122 #define _hdr_string 1 /* #include <string.h> ok */ 123Index: src/lib/libast/i386/include/ast/ast_lib.h 124=================================================================== 125--- src/lib/libast/i386/include/ast/ast_lib.h (revision 888) 126+++ src/lib/libast/i386/include/ast/ast_lib.h (working copy) 127@@ -171,7 +171,7 @@ 128 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 129 #define _lib_vfork 1 /* vfork exists and it works */ 130 #define _real_vfork 1 /* vfork child shares data with parent */ 131-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 132+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 133 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 134 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 135 #define _hdr_string 1 /* #include <string.h> ok */ 136Index: src/lib/libast/i386/src/lib/libast/ast_lib.h 137=================================================================== 138--- src/lib/libast/i386/src/lib/libast/ast_lib.h (revision 888) 139+++ src/lib/libast/i386/src/lib/libast/ast_lib.h (working copy) 140@@ -150,7 +150,7 @@ 141 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 142 #define _lib_vfork 1 /* vfork exists and it works */ 143 #define _real_vfork 1 /* vfork child shares data with parent */ 144-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 145+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 146 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 147 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 148 #define _hdr_string 1 /* #include <string.h> ok */ 149Index: src/lib/libast/i386/src/lib/libast/FEATURE/lib 150=================================================================== 151--- src/lib/libast/i386/src/lib/libast/FEATURE/lib (revision 888) 152+++ src/lib/libast/i386/src/lib/libast/FEATURE/lib (working copy) 153@@ -150,7 +150,7 @@ 154 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 155 #define _lib_vfork 1 /* vfork exists and it works */ 156 #define _real_vfork 1 /* vfork child shares data with parent */ 157-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 158+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 159 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 160 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 161 #define _hdr_string 1 /* #include <string.h> ok */ 162Index: src/lib/libast/amd64/include/ast/ast_lib.h 163=================================================================== 164--- src/lib/libast/amd64/include/ast/ast_lib.h (revision 888) 165+++ src/lib/libast/amd64/include/ast/ast_lib.h (working copy) 166@@ -160,7 +160,7 @@ 167 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 168 #define _lib_vfork 1 /* vfork exists and it works */ 169 #define _real_vfork 1 /* vfork child shares data with parent */ 170-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 171+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 172 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 173 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 174 #define _hdr_string 1 /* #include <string.h> ok */ 175Index: src/lib/libast/amd64/src/lib/libast/ast_lib.h 176=================================================================== 177--- src/lib/libast/amd64/src/lib/libast/ast_lib.h (revision 888) 178+++ src/lib/libast/amd64/src/lib/libast/ast_lib.h (working copy) 179@@ -139,7 +139,7 @@ 180 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 181 #define _lib_vfork 1 /* vfork exists and it works */ 182 #define _real_vfork 1 /* vfork child shares data with parent */ 183-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 184+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 185 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 186 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 187 #define _hdr_string 1 /* #include <string.h> ok */ 188Index: src/lib/libast/amd64/src/lib/libast/FEATURE/lib 189=================================================================== 190--- src/lib/libast/amd64/src/lib/libast/FEATURE/lib (revision 888) 191+++ src/lib/libast/amd64/src/lib/libast/FEATURE/lib (working copy) 192@@ -139,7 +139,7 @@ 193 #define _hdr_unistd 1 /* #include <unistd.h> ok */ 194 #define _lib_vfork 1 /* vfork exists and it works */ 195 #define _real_vfork 1 /* vfork child shares data with parent */ 196-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */ 197+#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */ 198 #define _stream_peek 1 /* ioctl(I_PEEK) works */ 199 #define _socket_peek 1 /* recv(MSG_PEEK) works */ 200 #define _hdr_string 1 /* #include <string.h> ok */ 201-- snip -- 202 203 204######## Errata #002: ######## 205A workaround was added for a problem with the "multiline" editor mode which 206occurs when the edit line becomes longer than the terminal's width and the 207terminal cursor is not at position 0 when PS1 is send to the terminal. 208 209For example: The user executes a $ printf "foo"<enter> # the prompt will start 210at position 3 instead of 0. If the user enters a command which is longer than 211the terminal width and then removes enougth characters that the edit line fits 212again into one line the "foo" at the beginning will be overwritten with the 213prompt. 214 215The workaround is to add $(printf "%*s\r%s" COLUMNS "") at the beginning of 216PS1 set by /etc/ksh.kshrc, this causes the shell to move to the beginning 217of the next line if the terminal cursor is not at position 0. 218 219 220######## Errata #003: ######## 221A fix was backported to cure sporadic VSC test suite failures. The failures are 222generated when command substitutions+functions are executed in a nested manner 223- sometimes the return code is non-zero even if the called function explicitly 224contains a "return 0"-statement. 225The following files have been changed: 226-- snip -- 227Index: src/lib/libshell/common/sh/jobs.c 228=================================================================== 229--- src/lib/libshell/common/sh/jobs.c (revision 1284) 230+++ src/lib/libshell/common/sh/jobs.c (working copy) 231@@ -1224,6 +1224,8 @@ 232 job_lock(); 233 if(pid > 1) 234 { 235+ if(pid==sh.spid) 236+ sh.spid = 0; 237 if(!(pw=job_bypid(pid))) 238 { 239 /* check to see whether job status has been saved */ 240-- snip -- 241 242 243######## Errata #004: ######## 244A fix was backported to cure a hang in a command substitution when the 245amount of data exceeds a certain amount of data (this was causing 246the hang in CR #6800929 ("snv_106 ksh93 update breaks Install(1M)")). 247The following files have been changed: 248-- snip -- 249Index: src/lib/libshell/common/include/defs.h 250=================================================================== 251--- src/lib/libshell/common/include/defs.h (revision 1391) 252+++ src/lib/libshell/common/include/defs.h (working copy) 253@@ -166,6 +166,7 @@ 254 char winch; \ 255 char indebug; /* set when in debug trap */ \ 256 unsigned char lastsig; /* last signal received */ \ 257+ char subshare; /* set when in ${..} comsub */ \ 258 char *readscript; /* set before reading a script */ \ 259 int *inpipe; /* input pipe pointer */ \ 260 int *outpipe; /* output pipe pointer */ \ 261Index: src/lib/libshell/common/sh/subshell.c 262=================================================================== 263--- src/lib/libshell/common/sh/subshell.c (revision 1391) 264+++ src/lib/libshell/common/sh/subshell.c (working copy) 265@@ -89,6 +89,7 @@ 266 int coutpipe; 267 int cpipe; 268 int nofork; 269+ char subshare; 270 } *subshell_data; 271 272 static int subenv; 273@@ -477,7 +478,9 @@ 274 sp->bckpid = shp->bckpid; 275 if(comsub) 276 sh_stats(STAT_COMSUB); 277- if(!comsub || (comsub==1 && !sh_isoption(SH_SUBSHARE))) 278+ sp->subshare = shp->subshare; 279+ shp->subshare = comsub==2 || (comsub==1 && sh_isoption(SH_SUBSHARE)); 280+ if(!comsub || !shp->subshare) 281 { 282 sp->shpwd = shp->pwd; 283 sp->pwd = (shp->pwd?strdup(shp->pwd):0); 284@@ -677,6 +680,7 @@ 285 shp->cpipe[1] = sp->cpipe; 286 shp->coutpipe = sp->coutpipe; 287 } 288+ shp->subshare = sp->subshare; 289 if(shp->subshell) 290 SH_SUBSHELLNOD->nvalue.s = --shp->subshell; 291 if(sp->sig) 292Index: src/lib/libshell/common/sh/xec.c 293=================================================================== 294--- src/lib/libshell/common/sh/xec.c (revision 1391) 295+++ src/lib/libshell/common/sh/xec.c (working copy) 296@@ -1406,7 +1406,12 @@ 297 pid_t savepgid = job.curpgid; 298 job.curpgid = 0; 299 if(shp->subshell) 300- sh_subtmpfile(1); 301+ { 302+ if(shp->subshare) 303+ sh_subtmpfile(0); 304+ else 305+ sh_subfork(); 306+ } 307 shp->inpipe = pvo; 308 shp->outpipe = pvn; 309 pvo[1] = -1; 310-- snip -- 311 312 313######## Errata #005: ######## 314A fix was backported for CR #6807179 to cure an unneccesary 315|libc::getpwnam()| lookup when the shell encountered a 316"~(modifer)pattern"-shell pattern (the leading '~' triggered a 317(unneccesary) tilde expansion). 318The following files have been changed: 319-- snip -- 320--- src/lib/libshell/common/sh/macro.c Wed Feb 18 11:53:56 2009 +0800 321+++ src/lib/libshell/common/sh/macro.c Wed Feb 18 21:45:00 2009 +0100 322@@ -439,7 +439,7 @@ 323 mp->sp = NIL(Sfio_t*); 324 mp->quote = newquote; 325 first = cp = fcseek(0); 326- if(!mp->quote && *cp=='~') 327+ if(!mp->quote && *cp=='~' && cp[1]!=LPAREN) 328 tilde = stktell(stkp); 329 /* handle // operator specially */ 330 if(mp->pattern==2 && *cp=='/') 331 332-- snip -- 333 334#EOF. 335