awk seg faults when it has to deal with at least one sequence of characters. This makes it crash: %* I don't know if it happens with other combinations Fix: I'm not aware of any fixes How-To-Repeat: # edit conf Type this GPG_PW='%*' # edit awk_test.sh Type this awk '/^[ \t]*GPG_PW[ \t=]/{\ sub(/^[ \t]*GPG_PW[ \t]*=*/,"",$0);\ gsub(/^[ \t]*[\047"]|[\047"][ \t]*$/,"",$0);\ printf $0; exit}' "$1" Now try to extract GPG_PW # ./awk_test.sh conf You will get this: ./awk_test.sh: line 4: 18676 Segmentation fault: 11 (core dumped) awk '/^[ \t]*GPG_PW[ \t=]/{\ sub(/^[ \t]*GPG_PW[ \t]*=*/,"",$0);\ gsub(/^[ \t]*[\047"]|[\047"][ \t]*$/,"",$0);\ printf $0; exit}' "$1"
Responsible Changed From-To: freebsd-amd64->freebsd-bugs reclassify.
FWIW; This didn't segfault on i386 (8.2-RC1). Perhaps you could try the lang/nawk port? It's a more recent version than the awk in base.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
This awk program is incorrect (the printf uses the input line, but doesn't have enough args). awk properly detects this now and does not segfault, but issues the following diagnostic: awk: not enough args in printf(%*) input record number 1, file conf source line number 1