Test case is very simple: cat x.sh #!/bin/sh [[ $A -lt $B ]] [[ $A -lt $B ]] $ ksh -R foo x.sh x.sh: warning: line 3: -lt within [[...]] obsolete, use ((...)) x.sh: warning: line 4: -lt within [[...]] obsolete, use ((...)) $ grep obsolete foo -5iIEV;v;Bsh: warning: line 4: -lt within [[...]] obsolete, use ((...)) 1HFhH7;v;Bsh: warning: line 3: -lt within [[...]] obsolete, use ((...)) patch is also very simple: diff -up ksh-20120801/src/cmd/ksh93/sh/parse.c.orig ksh-20120801/src/cmd/ksh93/sh/parse.c --- ksh-20120801/src/cmd/ksh93/sh/parse.c.orig 2017-03-31 14:39:37.920062158 -0300 +++ ksh-20120801/src/cmd/ksh93/sh/parse.c 2017-03-31 14:40:14.200175096 -0300 @@ -2032,6 +2032,7 @@ unsigned long kiaentity(Lex_t *lexp,cons else sfputr(stkp,name,0); } + sfputc(stkp,'\0'); np = nv_search(stakptr(offset),lexp->entity_tree,NV_ADD); stkseek(stkp,offset); np->nvalue.i = pkind; The problem happens due to mixed usage of length based strings and "C" (zero ended) strings. And from observation it only happens after errors are reported. The patch just makes it work with either string kind.
https://www.mail-archive.com/ast-developers@lists.research.att.com/msg01952.html
https://github.com/att/ast/pull/58
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0801