JuliusBrussee/caveman · error

cave_input_too_large

cave_input_too_large

Error message

cave_input_too_large: stdin exceeds %d bytes

What it means

Error "cave_input_too_large: stdin exceeds %d bytes" thrown in JuliusBrussee/caveman.

Source

Thrown at shrink/cmd/caveman-shrink/main.go:71

		// Byte-safe: forward the original unchanged rather than fail.
		_, _ = os.Stdout.Write(input)
		fmt.Fprintf(os.Stderr, `{"ratio":0,"basis":"inferred","note":"passed through: %v"}`+"\n", err)
		return
	}
	if _, err := os.Stdout.Write(res.Output); err != nil {
		fatal("write stdout: %v", err)
	}
	report, _ := json.Marshal(res)
	fmt.Fprintln(os.Stderr, string(report))
}

func readBoundedInput(r io.Reader, maxBytes int64) ([]byte, error) {
	input, err := io.ReadAll(io.LimitReader(r, maxBytes+1))
	if err != nil {
		return nil, err
	}
	if int64(len(input)) > maxBytes {
		return nil, fmt.Errorf("cave_input_too_large: stdin exceeds %d bytes", maxBytes)
	}
	return input, nil
}

func runLint(args []string) {
	if len(args) < 1 {
		fatal("usage: caveman-shrink lint <file>")
	}
	input, err := os.ReadFile(args[0])
	if err != nil {
		fatal("read %s: %v", args[0], err)
	}
	rep, err := shrink.Lint(input)
	if err != nil {
		fatal("lint: %v", err)
	}
	fmt.Printf("%-28s %10s %10s %8s\n", "TOOL", "BEFORE", "AFTER", "RATIO")
	for _, t := range rep.Tools {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Reduce stdin below the byte limit.

When it happens

Trigger: Thrown at shrink/cmd/caveman-shrink/main.go:71 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/15915d61e1206d3a. Report an issue: GitHub.