openterm icon indicating copy to clipboard operation
openterm copied to clipboard

awk dies trying to access NF

Open adbennet opened this issue 6 years ago • 2 comments

simple test case $ awk -- '{print NR;}' foo bar ^C 1 2 $ awk -- '{print NF;}' foo bar ^C ==FATAL On looking at this again, it actually prints out NF before dying.

$ awk -- '{print NF;} END {print "bye";}' foo bar ^C 2 bye ==FATAL

adbennet avatar Oct 28 '18 18:10 adbennet

I can reproduce the issue. It's related to the memory reset at the end of awk (the freeTree function in run.c). I'm investigating.

holzschu avatar Nov 01 '18 23:11 holzschu

I've submitted a partial fix on https://github.com/holzschu/ios_system You'll have to recompile and sideload (obviously), and it's not 100% robust yet, but it crashes less often.

holzschu avatar Nov 02 '18 15:11 holzschu