Matt S Trout > Rakudo-Star-2012.08_001 > parrot_fuzzer.py

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

NAME ^

parrot_fuzzer.py - opcode fuzzer

DESCRIPTION ^

This is a fuzzer for Parrot, written in Python using the Fusil library. It attempts to break Parrot by generating calls to random PIR opcodes.

DEPENDENCIES ^

This script requires Python 2.5+ to run. The Fusil http://fusil.hachoir.org/trac and python-ptrace http://python-ptrace.hachoir.org/trac libraries are also required.

USAGE ^

Short version: sudo python tools/dev/parrot_fuzzer.py

parrot_fuzzer.py is run like any other Fusil-based fuzzer. Fusil likes to be run as the root user so that the child process in which Parrot runs can be put in a more restricted environment, limiting potential damage.

Fusil assumes the existence of a fusil user and group. Parrot runs as this user/group as part of its restricted environment. Passing --unsafe allows it to run as the current user. Although it is not likely that this will cause any damage to your system, it is possible.

parrot_fuzzer.py needs access to Parrot's source code in order to figure out which PMCs and ops are available. It assumes that it's running in the root directory of Parrot's source code. You can specify a different directory using the --parrot-root switch.

OPTIONS ^

--parrot-root=/path/to/parrot

Represents the path to the Parrot root directory. By default, this is the current directory.

--runcore=--some-runcore

Specifies which runcore to use when running Parrot. The default is the slow core. This option corresponds directly to Parrot's --runcore option. Other runcores include fast.

Run parrot --help for more details.

--ignore-blacklist

Some PMC's and opcodes are known to cause false positives or results of limited value. These are blacklisted by default. Using --ignore-blacklist causes the fuzzer to use all available PMC's and opcodes, even those known to behave badly during testing.

--instructions=10

Represents the number of instructions during the test run. Note that a larger number such as 20 does not necessarily result in more failures. Defaults to 3.

LICENSE ^

This program is distributed under the same license as Parrot itself.

syntax highlighting: