slackhq/nebula · error

bad cpulist entry %q: %w

Error message

bad cpulist entry %q: %w

What it means

Parse error from parseCPUList: an entry in a kernel cpulist string (e.g. from sysfs topology files, "0-7,16") is not a valid decimal CPU number. strconv.Atoi on the lower bound of the entry failed; the whole offending entry is quoted and the Atoi error wrapped with %w.

Source

Thrown at cpupick/perf_linux.go:128

	return keep, true
}

// parseCPUList decodes the kernel's cpulist format ("0-7,16-23", "3") into
// individual CPU IDs. Empty input yields an empty list.
func parseCPUList(s string) ([]int, error) {
	if s == "" {
		return nil, nil
	}
	var out []int
	for part := range strings.SplitSeq(s, ",") {
		part = strings.TrimSpace(part)
		if part == "" {
			continue
		}
		lo, hi, isRange := strings.Cut(part, "-")
		a, err := strconv.Atoi(lo)
		if err != nil {
			return nil, fmt.Errorf("bad cpulist entry %q: %w", part, err)
		}
		if !isRange {
			out = append(out, a)
			continue
		}
		b, err := strconv.Atoi(hi)
		if err != nil {
			return nil, fmt.Errorf("bad cpulist entry %q: %w", part, err)
		}
		if b < a || b-a > 8192 {
			return nil, fmt.Errorf("bad cpulist range %q", part)
		}
		for v := a; v <= b; v++ {
			out = append(out, v)
		}
	}
	return out, nil
}

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Ignore and fall back to a default CPU selection strategy
  2. Verify the sysfs cpulist file was read correctly (not truncated/garbled)
  3. Report the unexpected kernel format as a bug with the offending value
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at cpupick/perf_linux.go:128 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/d926b8113e7440ea. Report an issue: GitHub.