Skip to content

cmd/compile: internal error: DwarfFixupTable has orphaned fixup when wrapping iter.Seq2[K, ZeroSize] into iter.Seq[K] #78599

Closed

Description

@johejo

Go version

go version go1.27-devel_996b985008 Wed Apr 8 14:21:41 2026 -0700 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/mitsuoheijo/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/mitsuoheijo/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/bq/s3vkkxm17jq79lx5qy3856zh0000gn/T/go-build2761551716=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/mitsuoheijo/repos/github.com/golang/go/src/go.mod'
GOMODCACHE='/Users/mitsuoheijo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/mitsuoheijo/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/mitsuoheijo/repos/github.com/golang/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/mitsuoheijo/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/mitsuoheijo/repos/github.com/golang/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.27-devel_996b985008 Wed Apr 8 14:21:41 2026 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

https://go.dev/play/p/aBf7_2IDaTe?v=gotip

package main

import "iter"

func pairs() iter.Seq2[int, struct{}] {
	return func(yield func(int, struct{}) bool) {
		yield(1, struct{}{})
	}
}

func keys() iter.Seq[int] {
	return func(yield func(int) bool) {
		for k := range pairs() {
			if !yield(k) {
				return
			}
		}
	}
}

func main() {
	for range keys() {
	}
}

What did you see happen?

./prog.go:7:8: internal error: DwarfFixupTable has orphaned fixup on  targeting main.keys.func1-range1 relidx=9 dclidx=1

What did you expect to see?

build succeeds

bisected 70dc75b
related d7b6fb4

cc @derekparker

Activity

  1. added
    BugReportIssues describing a possible bug in the Go implementation.
    on Apr 9, 2026
  2. derekparker commented on Apr 9, 2026

    @derekparker
    Contributor

    I will look into this today.

  3. gopherbot commented on Apr 9, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/764720 mentions this issue: cmd/compile: improve filtering in preInliningDcls

  4. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Apr 9, 2026
  5. dr2chase commented on Apr 9, 2026

    @dr2chase
    Contributor

    @golang/compiler

  6. eikemeier commented on Apr 14, 2026

    @eikemeier
    Contributor

    Even simpler (go.dev/play/p/5v7iLAF_DxQ):

    package main
    
    func main() {
    	for range func(yield func(struct{}) bool) {
    		yield(struct{}{})
    	} {
    		println()
    	}
    }
    ./prog.go:5:8: internal error: DwarfFixupTable has orphaned fixup on  targeting main.main-range1 relidx=6 dclidx=0
    
  7. derekparker commented on Apr 14, 2026

    @derekparker
    Contributor

    @eikemeier are you able to test my patch above and verify it fixes on your reproducer as well?

  8. eikemeier commented on Apr 15, 2026

    @eikemeier
    Contributor

    @eikemeier are you able to test my patch above and verify it fixes on your reproducer as well?

    Yes, it does. I want to file a bug report and costructed a minimal reproducible example, but then found this issue and though I'll add it, since it is smaller. Also, in your test, you shouldn't need

    func keys() iter.Seq[int] {
    	return func(yield func(int) bool) {
    		for k := range pairs() {
    			if !yield(k) {
    				return
    			}
    		}
    	}
    }

    It should be enough to do

    func main() {
    	for k := range pairs() {
    		println(k)
    	}
    }

    Thanks for the good work, BTW.

  9. added a commit that references this issue on Apr 15, 2026
    b77ae50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions