Martijn Dekker wrote: >- The error message produced can be ... interesting, e.g.: Which leads to another thought. 'Interesting' error messages might suggest memory issues. And, indeed, running dash built from current git master under Valgrind results in the following: $ cat <<EOF > `echo hi` ==27474== Invalid read of size 1 ==27474== at 0x4C32CC4: strcmp (vg_replace_strmem.c:846) ==27474== by 0x40BD6C: pstrcmp (mystring.c:247) ==27474== by 0x40BD6C: bsearch (stdlib-bsearch.h:33) ==27474== by 0x40BD6C: findstring (mystring.c:256) ==27474== by 0x40CFA5: findkwd (parser.c:1625) ==27474== by 0x40CFA5: readtoken (parser.c:727) ==27474== by 0x40D24C: peektoken (parser.c:690) ==27474== by 0x40D24C: list.part.2 (parser.c:184) ==27474== by 0x40E43A: list (parser.c:167) ==27474== by 0x40E43A: readtoken1 (parser.c:1443) ==27474== by 0x40ECE6: parseheredoc (parser.c:674) ==27474== by 0x40D202: list.part.2 (parser.c:179) ==27474== by 0x40AA5E: cmdloop (main.c:218) ==27474== by 0x40211F: main (main.c:176) ==27474== Address 0x51fb788 is 8 bytes inside a block of size 512 free'd ==27474== at 0x4C2FDAC: free (vg_replace_malloc.c:530) ==27474== by 0x40AE9E: popstackmark (memalloc.c:185) ==27474== by 0x40CC14: setprompt (parser.c:1564) ==27474== by 0x40ED69: parseheredoc (parser.c:669) ==27474== by 0x40D202: list.part.2 (parser.c:179) ==27474== by 0x40AA5E: cmdloop (main.c:218) ==27474== by 0x40211F: main (main.c:176) ==27474== Block was alloc'd at ==27474== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==27474== by 0x40AD32: ckmalloc (memalloc.c:55) ==27474== by 0x40AD32: stalloc (memalloc.c:132) ==27474== by 0x40AF41: growstackblock (memalloc.c:234) ==27474== by 0x40B064: growstackto (memalloc.c:271) ==27474== by 0x40B064: makestrspace (memalloc.c:285) ==27474== by 0x40DD00: readtoken1 (parser.c:928) ==27474== by 0x40EC51: expandstr (parser.c:1580) ==27474== by 0x40CC01: setprompt (parser.c:1563) ==27474== by 0x40ED69: parseheredoc (parser.c:669) ==27474== by 0x40D202: list.part.2 (parser.c:179) ==27474== by 0x40AA5E: cmdloop (main.c:218) ==27474== by 0x40211F: main (main.c:176) ==27474== With commit 7c245aa reverted the Valgrind output is clean. Ron