-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues 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.Someone 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.Issues related to the Go compiler and/or runtime.
Milestone
Description
Go version
go tip
Output of go env in your module/workspace:
λ ..\bin\go env
set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=1
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=e:\temp\gocache
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\klaus\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=d:\temp\wintemp\go-build235563609=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=e:\godev\src\go.mod
set GOMODCACHE=e:\gopath\pkg\mod
set GOOS=windows
set GOPATH=e:\gopath\
set GOPRIVATE=github.com/miniohq/,github.com/klauspost/minio-ec
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=e:\godev
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\klaus\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=e:\godev\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.26-devel_0c8bc965d9 Thu Oct 23 12:01:03 2025 +0200
set GOWORK=
set PKG_CONFIG=pkg-configWhat did you do?
Observed working on https://go.dev/issue/75532
If the datasection cannot be compressed and this check is hit and an invalid binary will be generated.
To reproduce, apply:
diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go
index dfb1d7bafb..ddbd7c5762 100644
--- a/src/cmd/link/internal/ld/data.go
+++ b/src/cmd/link/internal/ld/data.go
@@ -3210,7 +3210,7 @@ func compressSyms(ctxt *Link, syms []loader.Sym) []byte {
// compression levels of zlib.DefaultCompression, but takes
// substantially less time. This is important because DWARF
// compression can be a significant fraction of link time.
- z, err := zlib.NewWriterLevel(&buf, zlib.BestSpeed)
+ z, err := zlib.NewWriterLevel(&buf, zlib.NoCompression)
if err != nil {
log.Fatalf("NewWriterLevel failed: %s", err)
}Always taking the branch has same effect. It appears the caller isn't handling nil response correctly.
What did you see happen?
Compilation fails:
λ make.bat
Building Go cmd/dist using C:\go. (go1.25.1 windows/amd64)
Building Go toolchain1 using C:\go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
e:\godev\pkg\tool\windows_amd64\link: .debug_frame.PointerToRawData = 0xb05200, want 0xf28000
go tool dist: FAILED: e:\godev\pkg\tool\windows_amd64\link -extld= -L=e:\godev\pkg\obj\go-bootstrap\windows_amd64 -o e:\godev\pkg\tool\windows_amd64\go_bootstrap.exe d:\temp\wintemp\go-tool-dist-2188564858\cmd\go\_go_.a: exit status 2
What did you expect to see?
Successful compilation.
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues 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.Someone 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.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Todo