crashdump

package
v2.18.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package crashdump preserves runtime crash output independently of routine logs.

Index

Constants

View Source
const (
	CurrentFile    = "core.crash.log"
	PreviousFile   = "core.crash.previous.log"
	MaxReportBytes = 64 * 1024
	// VersionPrefix opens every capture file. A body carrying only this, or a
	// truncated piece of it, records no crash.
	VersionPrefix = "zaparoo-core@"
)

Variables

This section is empty.

Functions

func Stop

func Stop()

Stop releases the runtime's copy of the crash file descriptor.

The service never calls this: capture is meant to outlive shutdown, so the descriptor is held until the process exits. A test binary is the exception. It starts the service repeatedly against t.TempDir() directories, and a retained handle stops Windows removing the directory, which fails the test during cleanup rather than in anything it asserted.

Types

type Report

type Report struct {
	Time    time.Time
	Version string
	Data    []byte
}

Report is a bounded view of the retained file, not a replacement for it.

func Start

func Start(dir, version string) (*Report, error)

Start rotates a previous crash before opening fresh runtime-only capture. Call only from the service process, before starting its workers. The runtime retains its own descriptor until process exit, including during shutdown. Native code that exits without Go's fatal handler cannot be captured here.

Jump to

Keyboard shortcuts

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