The actual message is "awk: can't happen: unknown type 0 in freetr".
You might be interested in OpenTerm Issue #163, also opened by me, which may or may not be related. Mr. Holzschuch made a partial fix there.
awk dies trying to access NF #163
Below is a simple script and data to reproduce the error. I would not pay attention to the source line number. In another script I saw the same assert in an END pattern, and it seems to occur on whatever source line happens to be the last one. The sample also produced another intermittent error for me, whereby it printed #oo 1# instead of # foo 1#. It's a little weird, especially because I can't reproduce it consistently. Anyway one bug at a time. Maybe if this one gets fixed the other one will resolve itself.
$ cat s1null.awk
{
$1 = "";
print "#" $0 "#";
}
$ cat s1null-data.txt
1 foo 1
2 bar 2
3 baz 3
$ awk -f s1null.awk s1null-data.txt
# foo 1# (edit : escape the BOL # characters)
# bar 2#
# baz 3#
awk: can't happen: unknown type 0 in freetr
input record number 3, file s1null-data.txt
source line number 3
$
The actual message is "awk: can't happen: unknown type 0 in freetr".
You might be interested in OpenTerm Issue #163, also opened by me, which may or may not be related. Mr. Holzschuch made a partial fix there. awk dies trying to access NF #163
Below is a simple script and data to reproduce the error. I would not pay attention to the source line number. In another script I saw the same assert in an END pattern, and it seems to occur on whatever source line happens to be the last one. The sample also produced another intermittent error for me, whereby it printed #oo 1# instead of # foo 1#. It's a little weird, especially because I can't reproduce it consistently. Anyway one bug at a time. Maybe if this one gets fixed the other one will resolve itself. $ cat s1null.awk { $1 = ""; print "#" $0 "#"; } $ cat s1null-data.txt 1 foo 1 2 bar 2 3 baz 3 $ awk -f s1null.awk s1null-data.txt # foo 1# (edit : escape the BOL # characters) # bar 2# # baz 3# awk: can't happen: unknown type 0 in freetr input record number 3, file s1null-data.txt source line number 3 $