Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime.Breakpoint SIGSEGV in s390x #52103

Closed
alexsaezm opened this issue Apr 1, 2022 · 3 comments
Closed

runtime.Breakpoint SIGSEGV in s390x #52103

alexsaezm opened this issue Apr 1, 2022 · 3 comments
Labels
arch-s390x Issues solely affecting the s390x architecture. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alexsaezm
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.17.7 linux/s390x

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="s390x"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="s390x"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/golang"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_s390x"
GOVCS=""
GOVERSION="go1.17.7"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -march=z196 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1381326963=/tmp/go-build -gno-record-gcc-switches"

What did you do?

In s390x, if you run the following code:

package main

import "runtime"

func main() {
	runtime.Breakpoint()
}

You get a SIGSEGV:

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

goroutine 1 [running]:
runtime.Breakpoint(...)
	/usr/lib/golang/src/runtime/proc.go:4537
main.main()
	/root/test/main.go:6 +0x20

What did you expect to see?

A trap like in amd64.

What did you see instead?

A SIGSEGV. It is similar at what happens in this other issue.

@cherrymui cherrymui added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 5, 2022
@cherrymui cherrymui added this to the Unplanned milestone Apr 5, 2022
@cherrymui cherrymui added the arch-s390x Issues solely affecting the s390x architecture. label Apr 5, 2022
@cherrymui
Copy link
Member

I'll note that Breakpoint is mainly for getting into the debugger. A faulting instruction is probably fine. It would be nice if it is an actual trap instruction. You're welcome to send a CL. Thanks.

@alexsaezm
Copy link
Contributor Author

I'll note that Breakpoint is mainly for getting into the debugger. A faulting instruction is probably fine. It would be nice if it is an actual trap instruction. You're welcome to send a CL. Thanks.

Yeah, that's how I found this while working on Delve. Delve uses Breakpoint in some parts and that breaks tests for example.
I'm planning n work on this as soon as I can. I just opened the issue for awareness.

@gopherbot
Copy link

Change https://go.dev/cl/457456 mentions this issue: cmd/internal/obj/s390x, runtime: fix breakpoint in s390x

@golang golang locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-s390x Issues solely affecting the s390x architecture. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants