Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify launching and testing fuzzing tools #366

Merged
merged 6 commits into from
Feb 6, 2019

Commits on Feb 5, 2019

  1. Use command-line arguments instead of pipes

    stdin is a bit easier to use from the programming viewpoint, but it
    complicates debugging crashes. It is simpler to pass the input file
    as a command-line argument than to setup file redirection with lldb
    or gdb.
    
    Teach all tools to read input from the first command-line argument,
    update AFL command-line to pass the input via arguments, and update
    readme to prefer this form.
    
    This gives us easier time with debugger:
    
        gdb --args build/afl/${tool} tools/afl/input/${tool}/*
    
    and then we can just "run" in gdb's command line, instead of having
    to setup redirection every time.
    ilammy committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    8d2ec2e View commit details
    Browse the repository at this point in the history
  2. Launch trap as a separate command

    We should setup signal trap as a separate shell command for it to have
    effect on the next one. The previous form works on macOS for some weird
    reason but it does not work on Linux.
    ilammy committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    0445a58 View commit details
    Browse the repository at this point in the history
  3. Organize fuzzer output into subdirectories

    Separate tool name in filesystem hierarchy makes it easier to iterate
    over the findings for later reporting.
    ilammy committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    94daa12 View commit details
    Browse the repository at this point in the history
  4. Link statically against Themis

    Dynamic linkage with non-system installation paths is a minefield.
    For example, it works incorrectly on macOS if Themis is already
    installed to /usr/local/lib (that's because of the "installation path"
    thingy in dylibs). On Linux dynamic linkage requires LD_LIBRARY_PATH
    to be correctly configured even when building the fuzzing tools.
    
    Use static linkage instead. It turned out to be not that hard. We just
    have to add libsoter.a explicitly as well as LDFLAGS from outer Themis
    build to pull in the OpenSSL/LibreSSL/BoringSSL dependency.
    ilammy committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    569fc66 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2019

  1. Configuration menu
    Copy the full SHA
    54352f2 View commit details
    Browse the repository at this point in the history
  2. Human-readable error messages

    It's not nice to humans just return exit codes. We should at least give
    them a hint if the command-line is incorrect. Add some proper error
    messages as well for cases when we can't read the input file, or some
    Themis function breaks, or a really important test fails.
    ilammy committed Feb 6, 2019
    Configuration menu
    Copy the full SHA
    81a225d View commit details
    Browse the repository at this point in the history