Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

awk dies trying to access NF #163

Open
adbennet opened this issue Oct 28, 2018 · 2 comments
Open

awk dies trying to access NF #163

adbennet opened this issue Oct 28, 2018 · 2 comments

Comments

@adbennet
Copy link

adbennet commented Oct 28, 2018

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

@holzschu
Copy link
Contributor

holzschu commented Nov 1, 2018

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
Copy link
Contributor

holzschu commented Nov 2, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants