crash

package
v0.0.0-...-767721b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2015 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptableFields = map[string]struct{}{
	"ProblemType":                struct{}{},
	"Date":                       struct{}{},
	"Traceback":                  struct{}{},
	"Signal":                     struct{}{},
	"PythonArgs":                 struct{}{},
	"Package":                    struct{}{},
	"SourcePackage":              struct{}{},
	"PackageArchitecture":        struct{}{},
	"Dependencies":               struct{}{},
	"MachineType":                struct{}{},
	"StacktraceAddressSignature": struct{}{},
	"ApportVersion":              struct{}{},
	"DuplicateSignature":         struct{}{},
	"DistroRelease":              struct{}{},
	"Uname":                      struct{}{},
	"Architecture":               struct{}{},
	"NonfreeKernelModules":       struct{}{},
	"LiveMediaBuild":             struct{}{},
	"UserGroups":                 struct{}{},
	"ExecutablePath":             struct{}{},
	"InterpreterPath":            struct{}{},
	"ExecutableTimestamp":        struct{}{},
	"ProcCwd":                    struct{}{},
	"ProcEnviron":                struct{}{},
	"ProcCmdline":                struct{}{},
	"ProcStatus":                 struct{}{},
	"ProcMaps":                   struct{}{},
	"ProcAttrCurrent":            struct{}{},
	"Registers":                  struct{}{},
	"Disassembly":                struct{}{},
	"StacktraceTop":              struct{}{},
	"AssertionMessage":           struct{}{},
	"CoreDump":                   struct{}{},
	"VmCore":                     struct{}{},
	"Tags":                       struct{}{},
	"OopsText":                   struct{}{},
	"UpgradeStatus":              struct{}{},
	"InstallationDate":           struct{}{},
	"InstallationMedia":          struct{}{},
	"IwlFwDump":                  struct{}{},
	"SystemImageInfo":            struct{}{},
}

All the fields we will unconditionally accept for upload, no matter their size.

View Source
var UnacceptableFields = map[string]struct{}{
	"Stacktrace":         struct{}{},
	"ThreadStacktrace":   struct{}{},
	"UnreportableReason": struct{}{},
	"CrashCounter":       struct{}{},
	"_MarkForUpload":     struct{}{},
	"Title":              struct{}{},
}

We always filter out these fields and do not submit them to the cloud.

Functions

func ForEachReportInDir

func ForEachReportInDir(dir string, visitor ReportVisitor)

ForEachReportInDir iterates over all crash reports in dir, parses it and reports back to visitor.

Types

type ErrorFailedToParseCrashReport

type ErrorFailedToParseCrashReport struct {
	Name string // Name of the report that failed parsing
	Next error  // Error reported by the parser.
}

ErrorFailedToParseCrashReport indicates an issue trying to parse a crash report.

func (ErrorFailedToParseCrashReport) Error

Error pretty prints the given ErrorFailedToParseCrashReport instance.

type ErrorFailedToReadCrashDir

type ErrorFailedToReadCrashDir struct {
	CrashDir string // The crash dir that we failed to read.
	Next     error  // The error reported when trying to read the directory.
}

ErrorFailedToReadCrashDir indicates an issue when trying to read entries of the given crash dir.

func (ErrorFailedToReadCrashDir) Error

func (self ErrorFailedToReadCrashDir) Error() string

Error pretty prints the given ErrorFailedToReadCrashDir instance.

type HttpReportPersister

type HttpReportPersister struct {
	SubmitURL  url.URL            // URL for sending the crash report to
	Identifier machine.Identifier // Identifier helps in generating a globally unique device id
	Client     *http.Client       // HTTP client instance for reaching out to the crash db service
}

HttpReporterPersister persists incoming crash reports to launchpad.

func (HttpReportPersister) Persist

func (self HttpReportPersister) Persist(report Report) error

type NewLineReader

type NewLineReader struct {
	Reader io.Reader
}

NewLineReader reads a final \n if the contained Reader reports EOF.

func (NewLineReader) Read

func (self NewLineReader) Read(p []byte) (int, error)

Read triggers the internal Reader instance. When that instance reports EOF, an additional \n is reported back to the caller.

type Report

type Report textproto.MIMEHeader

Report models an apport crash report.

func ParseReport

func ParseReport(reader io.Reader) (Report, error)

ParseReport parses information from reader.

type ReportPersister

type ReportPersister interface {
	// Persist stores report for future processing
	Persist(report Report) error
}

ReportPersister abstracts persisting of Report instances.

type ReportVisitor

type ReportVisitor interface {
	// NewReport is invoked for every report that has been successfully loaded
	NewReport(name string, report Report)
	// NewError is invoked for issues encountered while processing individual entries.
	NewError(err error)
}

ReportVisitor abstracts handling of individual Report instances.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL