Skip to content

Commit

Permalink
tests: Add runner for AFL corpus.
Browse files Browse the repository at this point in the history
Contributed by Jeff Epler (@jepler):

run-afl-corpus: Avoid locale-dependent filename sorting

.. by ensuring that the "C" locale is used while running this script.
This requires sorting the "ref" file which was generated using the
collation order of some other locale such as en_US.UTF-8.

Apparently, POSIX promises that shell globs use the locale's collation
ordering, but bash is alone (among dash, mksh and zsh) at actually doing
this.  For discussion, see
https://serverfault.com/questions/122737/in-bash-are-wildcard-expansions-guaranteed-to-be-in-order

Without this change, I get a failure when I "sh run-afl-test-corpus.sh"
(sh is invoking /bin/dash).  With this change, I get success with all
4 sh implementations I tested and regardless of my LANG setting
such as LANG=en_US.UTF-8 LANG=zh_CN.UTF-8 LANG=C.UTF-8 LANG=C
  • Loading branch information
pfalcon committed Jul 10, 2018
1 parent 73d66a2 commit 93def8d
Show file tree
Hide file tree
Showing 2 changed files with 271 additions and 0 deletions.
Loading

0 comments on commit 93def8d

Please sign in to comment.