crashwalk: Index | Files | Directories

package crashwalk

import ""

Package crashwalk is a support package for triaging crashfiles on unix systems. It concurrently walks a given root directory and instruments all matching files via an external debugger, passing the results to the caller over a channel.


Package Files



const MEMORY_LIMIT_MAX = 4096

Maximum value for the MemoryLimit config option (in MB)

const TIMEOUT_MAX = 300

Maximum value for the Timeout config option (in secs)

func Summarize Uses

func Summarize(c crash.Crash) string

Summarize presents a nicely formatted, human readable summary of the crash. Quite a lot of analysis can be performed by combining this output with `awk`,`grep`, `sort`, `uniq -c` etc etc.

type Crashwalk Uses

type Crashwalk struct {
    // contains filtered or unexported fields

Crashwalk is used to Run() walk instances, using the supplied config. Walks are not designed to be externally threadsafe, but can be configured to use multiple goroutines internally. Simultaneous calls to Run() from multiple goroutines will be serialised via an internal mutex.

func NewCrashwalk Uses

func NewCrashwalk(config CrashwalkConfig) (*Crashwalk, error)

NewCrashwalk creates a Crashwalk. Consult the information and warnings for that struct.

func (*Crashwalk) CachedDirJob Uses

func (cw *Crashwalk) CachedDirJob(dn string) Job

CachedDirJob is used during -afl mode to cache the results of parsing AFL's README.txt file, which contains the command, template filename and memory limit that were used for all crashes in that directory.

func (*Crashwalk) Run Uses

func (cw *Crashwalk) Run() <-chan crash.Crash

Run will take one run through the crashes, (optionally) skipping any we have seen, and push all the results down to the end-user on the crash channel. It closes its own resources once the run is finished. Multiple calls to Run() will be serialised via an internal mutex, however this is not recommended. The Workers setting in CrashwalkConfig allows the Run to use multiple goroutines, (and multiple cores, if GOMAXPROCS is set correctly)

type CrashwalkConfig Uses

type CrashwalkConfig struct {
    FilterFunc  func(path string) error // Can be supplied by the user to filter non-crashes in a directory tree
    SeenDB      string                  // path to BoltDB (stores already processed crash info)
    Command     []string                // command to test crashfiles against
    Strict      bool                    // abort if any instrumentation calls error
    Debugger    Debugger                // A debugger that implements our interface
    Root        string                  // Root for the filepath.Walk
    Workers     int                     // number of workers to use
    IncludeSeen bool                    // include seen crashes from the DB to the output channel
    Afl         bool                    // Use the command from README.txt in AFL crash dirs
    Tidy        bool                    // Move crashfiles that error in Run() to a tidy directory
    MemoryLimit int                     // Memory limit (in MB ) to apply to targets ( via ulimit -v )
    Timeout     int                     // Timeout (in secs ) to apply to targets
    File        string                  // Template filename to use. Workers use the base dir and extension with a random name

CrashwalkConfig is used to set the assorted configuration options for NewCrashwalk()

type Debugger Uses

type Debugger interface {
    Run(command []string, filename string, memlimit, timeout int) (crash.Info, error)

Debugger is a simple interface that allows different debugger backends to be used by this package ( GDB, LLDB etc )

type Job Uses

type Job struct {
    InFile      string
    InFileInfo  os.FileInfo
    OutFile     string
    MemoryLimit int
    Timeout     int
    Command     []string

Job is the basic unit of work that will be passed to the configured Debugger


crashPackage crash is a generated protocol buffer package.

Package crashwalk imports 20 packages (graph). Updated 2020-02-19. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).