Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Go1.25 リリースパーティ ~ nil pointer bug ~

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for sivchari sivchari
February 26, 2026
46

Go1.25 リリースパーティ ~ nil pointer bug ~

Avatar for sivchari

sivchari

February 26, 2026
Tweet

Transcript

  1. • sivchari ◦ X/GitHub @sivchari • newmo • Kubernetes maintainer

    ◦ Cluster API ◦ Kube API Linter • Go Conference メインオーガナイザー
  2. nil pointer bug m := map[string]*struct { field int }{}

    v, ok := m[“key”] valid := v.field >= 0 // 1 if !ok { println(“mark”) return } println(valid) // 2 Go N <= 1.24 panic or not?
  3. nil pointer bug m := map[string]*struct { field int }{}

    v, ok := m[“key”] valid := v.field >= 0 // 1 if !ok { println(“mark”) return } println(valid) // 2 Go N <= 1.24 panic or not?
  4. nil pointer bug m := map[string]*struct { field int }{}

    v, ok := m[“key”] valid := v.field >= 0 // 1 if !ok { println(“mark”) return } println(valid) // 2 Go N >= 1.24 panic or not?
  5. nil pointer bug m := map[string]*struct { field int }{}

    v, ok := m[“key”] valid := v.field >= 0 // 1 if !ok { println(“mark”) return } println(valid) // 2 Go N >= 1.24 panic or not?
  6. CompilerとMemory Model • GoのMemory Modelに違反する Requirement 1: The memory operations

    in each goroutine must correspond to a correct sequential execution of that goroutine, given the values read from and written to memory. That execution must be consistent with the sequenced before relation, defined as the partial order requirements set out by the Go language specification for Go's control flow constructs as well as the order of evaluation for expressions.
  7. CompilerとMemory Model m := map[string]*struct { field int }{} v,

    ok := m[“key”] valid := v.field >= 0 // 1 if !ok { println(“mark”) return } println(valid) // 2 valid is sequenced before `if !ok`
  8. CompilerとMemory Model m := map[string]*struct { field int }{} v,

    ok := m[“key”] if !ok { println(“mark”) return } valid := v.field >= 0 // 1 println(valid) // 2 valid is sequenced before `if !ok`
  9. CompilerとMemory Model if opcodeTable[v.Op].nilCheck { // Nil checks need to

    stay in their block. See issue 72860. continue } CL 657715