Skip to content

Panic: nil pointer dereference in go/types with Go 1.26 #44

@bsene

Description

@bsene

Description

go-mutesting panics with a nil pointer dereference when running against a project using Go 1.26.1.

Image

Steps to Reproduce

  1. Install Go 1.26.1
  2. Run go-mutesting on any Go source file
go-mutesting myfile.go

Error

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1010d3a18]

goroutine 4 [running]:
go/types.(*Checker).handleBailout(...)
go/types.(*StdSizes).Sizeof(0x0, ...)
...
golang.org/x/tools/go/packages.(*loader).loadPackage(...)
	golang.org/x/tools@v0.0.0-20191018212557-ed542cd5b28a/go/packages/packages.go:835

Root Cause

The bundled golang.org/x/tools@v0.0.0-20191018212557 dependency predates Go 1.26 and is incompatible with its type system changes, causing the nil pointer in go/types.(*StdSizes).Sizeof.

Environment

  • Go version: go1.26.1 darwin/arm64
  • OS: macOS (Darwin 25.4.0, arm64)
  • go-mutesting: installed via go install github.com/avito-tech/go-mutesting/...@latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions