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: SIGBUS error when linking (because disk space consumed) #41466

Closed
jasperdenotter opened this issue Sep 17, 2020 · 3 comments
Closed

cmd/link: SIGBUS error when linking (because disk space consumed) #41466

jasperdenotter opened this issue Sep 17, 2020 · 3 comments
Milestone

Comments

@jasperdenotter
Copy link

@jasperdenotter jasperdenotter commented Sep 17, 2020

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

$ go version go1.13 linux/amd64

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

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jasper/.cache/go-build"
GOENV="/home/jasper/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"

What did you do?

I tried to run make to build my golang project

What did you expect to see?

Normal binaries being built

What did you see instead?

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

goroutine 1 [running]:
runtime.throw(0x690d25, 0x5)
        /usr/local/go/src/runtime/panic.go:774 +0x72 fp=0xc00085cef0 sp=0xc00085cec0 pc=0x42da22
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:391 +0x455 fp=0xc00085cf20 sp=0xc00085cef0 pc=0x4429c5
runtime.memmove(0x7fad5e1fa520, 0xc00d9ac000, 0x632a42)
        /usr/local/go/src/runtime/memmove_amd64.s:422 +0x50a fp=0xc00085cf28 sp=0xc00085cf20 pc=0x45b96a
cmd/link/internal/ld.(*OutBuf).Write(0xc0006ca000, 0xc00d9ac000, 0x632a42, 0x950144, 0x200, 0x10, 0x0)
        /usr/local/go/src/cmd/link/internal/ld/outbuf.go:65 +0xa0 fp=0xc00085cf78 sp=0xc00085cf28 pc=0x5ac2e0
cmd/link/internal/ld.(*OutBuf).WriteSym(0xc0006ca000, 0xc00aec2080)
        /usr/local/go/src/cmd/link/internal/ld/outbuf.go:159 +0x6c fp=0xc00085cfc8 sp=0xc00085cf78 pc=0x5acaac
cmd/link/internal/ld.blk(0xc0006ca000, 0xc00f314000, 0x169eb, 0x1c400, 0x135f520, 0xb8bf62, 0x8771c0, 0x200, 0x200)
        /usr/local/go/src/cmd/link/internal/ld/data.go:786 +0x10f fp=0xc00085d098 sp=0xc00085cfc8 pc=0x55972f
cmd/link/internal/ld.writeDatblkToOutBuf(0xc0006c8000, 0xc0006ca000, 0xe06000, 0xb8bf62)
        /usr/local/go/src/cmd/link/internal/ld/data.go:825 +0xaf fp=0xc00085d260 sp=0xc00085d098 pc=0x559d7f
cmd/link/internal/ld.Datblk(...)
        /usr/local/go/src/cmd/link/internal/ld/data.go:808
cmd/link/internal/amd64.asmb(0xc0006c8000)
        /usr/local/go/src/cmd/link/internal/amd64/asm.go:688 +0x1fe fp=0xc00085d2d0 sp=0xc00085d260 pc=0x5d1ade
cmd/link/internal/ld.Main(0x84bdc0, 0x10, 0x20, 0x1, 0x7, 0x10, 0x69aa6a, 0x1b, 0x697551, 0x14, ...)
        /usr/local/go/src/cmd/link/internal/ld/main.go:262 +0xd5d fp=0xc00085d428 sp=0xc00085d2d0 pc=0x5ab32d
main.main()
        /usr/local/go/src/cmd/link/main.go:65 +0x1d6 fp=0xc00085df60 sp=0xc00085d428 pc=0x614396
runtime.main()
        /usr/local/go/src/runtime/proc.go:203 +0x21e fp=0xc00085dfe0 sp=0xc00085df60 pc=0x42f3be
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc00085dfe8 sp=0xc00085dfe0 pc=0x45a2b1

Resolution

The problem was that the "/" directory was 100% consumed and there was not enough space to build the project. The error message from build should be a bit more clear

@jasperdenotter jasperdenotter changed the title SIGBUS error when running make SIGBUS error when running make (because disk space consumed) Sep 17, 2020
@davecheney
Copy link
Contributor

@davecheney davecheney commented Sep 17, 2020

Hi. Thanks for raising this issue. Can you please upgrade to go 1.15.2 and confirm if the problem is present there.

@rsc
Copy link
Contributor

@rsc rsc commented Sep 18, 2020

This looks like a real bug. I believe the new linker is memory mapping the output, but given the trace it appears not be using runtime/debug.SetPanicOnFault and reporting handling memory faults from I/O errors gracefully.

/cc @cherrymui @thanm @jeremyfaller

@ianlancetaylor ianlancetaylor changed the title SIGBUS error when running make (because disk space consumed) cmd/link: SIGBUS error when linking (because disk space consumed) Sep 18, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone Sep 18, 2020
@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Sep 18, 2020

Looks like dup of #37310, which is fixed on Linux and darwin in Go 1.15 (by preallocating file space), but not on other OSes.

Go 1.13 is no longer supported.

Closing as a dup.

If we do #41155, we could use SetPanicOnFault to make it fail gracefully on OSes we don't preallocate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.