Skip to content

cmd/cgo/internal/test: TestCallbackCallersSEH failures #65116

@qmuntal

Description

@qmuntal

Go version

go version devel go1.22-e9b3ff15f4 Wed Jan 10 17:35:49 2024 +0000 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\aaa\AppData\Local\go-build
set GOENV=C:\Users\aaa\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\aaa\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\aaa\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\aaa\code\golang-go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Users\aaa\code\golang-go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.22-e9b3ff15f4 Wed Jan 10 17:35:49 2024 +0000
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\aaa\code\golang-go\src\cmd\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\aaa\AppData\Local\Temp\go-build998051253=/tmp/go-build -gno-record-gcc-switches

What did you do?

go test --ldflags=-linkmode=internal -run=TestCallbackCallersSEH ./cmd/cgo/internal/test

What did you see happen?

--- FAIL: TestCallbackCallersSEH (0.00s)
    callback_windows.go:107: incorrect backtrace:
        want:   [test._Cfunc_backtrace test.testCallbackCallersSEH.func1.1 test.testCallbackCallersSEH.func1 test.goCallback test._Cfunc_callback test.nestedCall.func1 test.nestedCall test.testCallbackCallersSEH test.TestCallbackCallersSEH]
        got:    []
FAIL
FAIL    cmd/cgo/internal/test   2.527s
FAIL

What did you expect to see?

=== RUN   TestCallbackCallersSEH
--- PASS: TestCallbackCallersSEH (0.00s)
PASS
ok      cmd/cgo/internal/test   2.286s

Some more context:

  • Only reproduces when using the Go internal linker.
  • The test fails only with certain gcc versions. I've reproduced the failure with:
>gcc --version
gcc (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.OS-Windowscompiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

In Progress

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions