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

cmd/link: unexpected fault address 0x7fa5b6698538 #39456

Closed
BenLubar opened this issue Jun 8, 2020 · 5 comments
Closed

cmd/link: unexpected fault address 0x7fa5b6698538 #39456

BenLubar opened this issue Jun 8, 2020 · 5 comments

Comments

@BenLubar
Copy link

BenLubar commented Jun 8, 2020

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

$ go version
go version go1.13.8 linux/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/ben/go/bin"
GOCACHE="/home/ben/.cache/go-build"
GOENV="/home/ben/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ben/.golang-path"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ben/src/tolpaha/go.mod"
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 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build334490834=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.13.8 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.13.8
uname -sr: Linux 5.4.0-33-generic
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9) stable release version 2.31.
gdb --version: GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1

What did you do?

entr -s 'go run .'

It doesn't seem to depend on the code. touching a file can make it happen or not happen.

Here's an example of the code it happened with: https://git.lubar.me/ben/tolpaha/src/commit/ac4aab9f17e1de34424a8836964c1deee659aff1

What did you expect to see?

Program compiles and runs

What did you see instead?

unexpected fault address 0x7fa5b6698538
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0x7fa5b6698538 pc=0x4d8aed]

goroutine 1 [running]:
runtime.throw(0x690f28, 0x5)
        /usr/lib/go-1.13/src/runtime/panic.go:774 +0x72 fp=0xc000752fa8 sp=0xc000752f78 pc=0x42dc32
runtime.sigpanic()
        /usr/lib/go-1.13/src/runtime/signal_unix.go:391 +0x455 fp=0xc000752fd8 sp=0xc000752fa8 pc=0x442bd5
encoding/binary.littleEndian.PutUint64(...)
        /usr/lib/go-1.13/src/encoding/binary/binary.go:90
encoding/binary.(*littleEndian).PutUint64(0x8777c0, 0x7fa5b6698538, 0x30, 0x4a9ac8, 0xd423e0)
        <autogenerated>:1 +0x3d fp=0xc000752ff8 sp=0xc000752fd8 pc=0x4d8aed
cmd/link/internal/ld.relocsym(0xc0006e6000, 0xc00491c570)
        /usr/lib/go-1.13/src/cmd/link/internal/ld/data.go:556 +0xae0 fp=0xc000753258 sp=0xc000752ff8 pc=0x554f30
cmd/link/internal/ld.(*Link).reloc(0xc0006e6000)
        /usr/lib/go-1.13/src/cmd/link/internal/ld/data.go:570 +0xb4 fp=0xc0007532d0 sp=0xc000753258 pc=0x557c54
cmd/link/internal/ld.Main(0x84cdc0, 0x10, 0x20, 0x1, 0x7, 0x10, 0x69ac6f, 0x1b, 0x697756, 0x14, ...)
        /usr/lib/go-1.13/src/cmd/link/internal/ld/main.go:263 +0xd6e fp=0xc000753428 sp=0xc0007532d0 pc=0x5ab5ae
main.main()
        /usr/lib/go-1.13/src/cmd/link/main.go:65 +0x1d6 fp=0xc000753f60 sp=0xc000753428 pc=0x614606
runtime.main()
        /usr/lib/go-1.13/src/runtime/proc.go:203 +0x21e fp=0xc000753fe0 sp=0xc000753f60 pc=0x42f5ce
runtime.goexit()
        /usr/lib/go-1.13/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000753fe8 sp=0xc000753fe0 pc=0x45a501
@ianlancetaylor
Copy link
Contributor

The linker has changed quite a lot. Is there a way that you could test this against the master branch? Thanks.

@jeremyfaller
Copy link
Contributor

I tried with the dev.link branch, and OP's github branch. It failed to compile for other reasons, but if it's too not too much to update the link to a working piece of code I'd be happy to take a look there as well.

@BenLubar
Copy link
Author

BenLubar commented Jun 8, 2020

To make it compile, you just need to go generate ./assets

I'm omitting the generated file for now to avoid a lot of source control churn.

I noticed my SSD was almost full, so this may be related to that rather than anything in Go.

@cherrymui
Copy link
Member

I noticed my SSD was almost full

Probably related to #37310. It should be fixed on tip (Go 1.15 to be).

@BenLubar
Copy link
Author

Hasn't happened again, so closing as a duplicate of #37310

@golang golang locked and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants