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: unexpected return pc for runtime.(*mheap).alloc #35328

Closed
mvdan opened this issue Nov 3, 2019 · 4 comments
Closed

runtime: unexpected return pc for runtime.(*mheap).alloc #35328

mvdan opened this issue Nov 3, 2019 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@mvdan
Copy link
Member

mvdan commented Nov 3, 2019

Apologies if this is a duplicate of an existing issue. I saw some similar open and closed issues, but none referenced the same function, so I'm opening a new issue to be safe.

$ go version
go version devel +d2c039fb21 Sun Nov 3 01:44:46 2019 +0000 linux/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mvdan/.cache/go-build"
GOENV="/home/mvdan/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="brank.as/*"
GONOSUMDB="brank.as/*"
GOOS="linux"
GOPATH="/home/mvdan/go"
GOPRIVATE="brank.as/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/mvdan/tip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/mvdan/tip/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build616221183=/tmp/go-build -gno-record-gcc-switches"

Full panic output:

$ go test
--- FAIL: TestWayland (4.19s)
    wayland_test.go:83: could not build app: exit status 2:
        # gioui.org/internal/ops
        runtime: unexpected return pc for runtime.(*mheap).alloc called from 0x656c676f6f672f74
        stack: frame={sp:0xc0005b5360, fp:0xc0005b5368} stack=[0xc0005b4000,0xc0005b6000)
        000000c0005b5260:  0000000000000000  0000000000000000
        000000c0005b5270:  0000000000000000  0000000000000000
        000000c0005b5280:  0000000000000000  0000000000000000
        000000c0005b5290:  0000000000000000  0000000000000000
        000000c0005b52a0:  0000000000000000  0000000000000000
        000000c0005b52b0:  0000000000000000  0000000000000000
        000000c0005b52c0:  0000000000000000  0000000000000000
        000000c0005b52d0:  0000000000000000  0000000000000000
        000000c0005b52e0:  0000000000000000  0000000000000000
        000000c0005b52f0:  0000000000000000  0000000000000000
        000000c0005b5300:  0000000000000000  0000000000000000
        000000c0005b5310:  0000000000000000  0000000000000000
        000000c0005b5320:  0000000000000000  0000000000000000
        000000c0005b5330:  0000000000000000  0000000000000000
        000000c0005b5340:  0000000000000000  0000000000000000
        000000c0005b5350:  0000000000000000  0000000000000000
        000000c0005b5360: <656c676f6f672f74 >732d64756f6c632d
        000000c0005b5370:  0000000000000000  0000000000000000
        000000c0005b5380:  0000000000000000  0000000000000000
        000000c0005b5390:  0000000000000000  0000000000000000
        000000c0005b53a0:  0000000000000000  0000000000000000
        000000c0005b53b0:  0000000000000000  0000000000000000
        000000c0005b53c0:  bfe62e42fefa39ef  0000000000000000
        000000c0005b53d0:  0000000000000000  0000000000000000
        000000c0005b53e0:  414fffffe0000000  0000000000000000
        000000c0005b53f0:  0000000000000000  0000000000000000
        000000c0005b5400:  00000000004165a5 <runtime.(*mcache).refill+133>  0000000001597438
        000000c0005b5410:  0000000000000000  000000c000680450
        000000c0005b5420:  000000000040ba47 <runtime.(*mcache).nextFree+135>  00007f424789db28
        000000c0005b5430:  0000000000000007  0000000000000000
        000000c0005b5440:  0000000000000000  000000000158e940
        000000c0005b5450:  000000c0006804f0  000000000040c383 <runtime.mallocgc+1939>
        000000c0005b5460:  00007f424789db28
        fatal error: unknown caller pc

        runtime stack:
        runtime.throw(0xe30510, 0x11)
                /home/mvdan/tip/src/runtime/panic.go:1045 +0x72
        runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc000070c00, 0x0, 0x0, 0x7fffffff, 0xe4bcc0, 0xc00007bd18, 0x0, ...)
                /home/mvdan/tip/src/runtime/traceback.go:273 +0x19ee
        runtime.copystack(0xc000070c00, 0x2000)
                /home/mvdan/tip/src/runtime/stack.go:888 +0x291
        runtime.newstack()
                /home/mvdan/tip/src/runtime/stack.go:1042 +0x20b
        runtime.morestack()
                /home/mvdan/tip/src/runtime/asm_amd64.s:449 +0x8f

        goroutine 17 [copystack]:
        runtime: unexpected return pc for runtime.(*mheap).alloc called from 0x656c676f6f672f74
        stack: frame={sp:0xc0005b5360, fp:0xc0005b5368} stack=[0xc0005b4000,0xc0005b6000)
        000000c0005b5260:  0000000000000000  0000000000000000
        000000c0005b5270:  0000000000000000  0000000000000000
        000000c0005b5280:  0000000000000000  0000000000000000
        000000c0005b5290:  0000000000000000  0000000000000000
        000000c0005b52a0:  0000000000000000  0000000000000000
        000000c0005b52b0:  0000000000000000  0000000000000000
        000000c0005b52c0:  0000000000000000  0000000000000000
        000000c0005b52d0:  0000000000000000  0000000000000000
        000000c0005b52e0:  0000000000000000  0000000000000000
        000000c0005b52f0:  0000000000000000  0000000000000000
        000000c0005b5300:  0000000000000000  0000000000000000
        000000c0005b5310:  0000000000000000  0000000000000000
        000000c0005b5320:  0000000000000000  0000000000000000
        000000c0005b5330:  0000000000000000  0000000000000000
        000000c0005b5340:  0000000000000000  0000000000000000
        000000c0005b5350:  0000000000000000  0000000000000000
        000000c0005b5360: <656c676f6f672f74 >732d64756f6c632d
        000000c0005b5370:  0000000000000000  0000000000000000
        000000c0005b5380:  0000000000000000  0000000000000000
        000000c0005b5390:  0000000000000000  0000000000000000
        000000c0005b53a0:  0000000000000000  0000000000000000
        000000c0005b53b0:  0000000000000000  0000000000000000
        000000c0005b53c0:  bfe62e42fefa39ef  0000000000000000
        000000c0005b53d0:  0000000000000000  0000000000000000
        000000c0005b53e0:  414fffffe0000000  0000000000000000
        000000c0005b53f0:  0000000000000000  0000000000000000
        000000c0005b5400:  00000000004165a5 <runtime.(*mcache).refill+133>  0000000001597438
        000000c0005b5410:  0000000000000000  000000c000680450
        000000c0005b5420:  000000000040ba47 <runtime.(*mcache).nextFree+135>  00007f424789db28
        000000c0005b5430:  0000000000000007  0000000000000000
        000000c0005b5440:  0000000000000000  000000000158e940
        000000c0005b5450:  000000c0006804f0  000000000040c383 <runtime.mallocgc+1939>
        000000c0005b5460:  00007f424789db28
        runtime.(*mheap).alloc(0x732d64756f6c632d, 0x0, 0x0, 0x0)
                /home/mvdan/tip/src/runtime/mheap.go:1147 +0xe1 fp=0xc0005b5368 sp=0xc0005b5360 pc=0x425501
        created by cmd/compile/internal/gc.compileFunctions
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:361 +0x128

        goroutine 1 [runnable]:
        cmd/compile/internal/gc.compileFunctions()
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:369 +0x17c
        cmd/compile/internal/gc.Main(0xe4ae50)
                /home/mvdan/tip/src/cmd/compile/internal/gc/main.go:709 +0x3280
        main.main()
                /home/mvdan/tip/src/cmd/compile/main.go:50 +0xac

        goroutine 18 [runnable]:
        cmd/compile/internal/ssa.liveValues.func1(0xc0005e9e00, 0xc0002bec60)
                /home/mvdan/tip/src/cmd/compile/internal/ssa/deadcode.go:105 +0x70
        cmd/compile/internal/ssa.liveValues(0xc0002bec60, 0xc00001d9c0, 0x37, 0x37, 0xc0000cc6e0, 0x154, 0x154, 0xc0005fc000, 0x36, 0x100)
                /home/mvdan/tip/src/cmd/compile/internal/ssa/deadcode.go:167 +0xfb5
        cmd/compile/internal/ssa.deadcode(0xc0002bec60)
                /home/mvdan/tip/src/cmd/compile/internal/ssa/deadcode.go:215 +0x277
        cmd/compile/internal/ssa.Compile(0xc0002bec60)
                /home/mvdan/tip/src/cmd/compile/internal/ssa/compile.go:92 +0x9a5
        cmd/compile/internal/gc.buildssa(0xc0002be840, 0x1, 0x0)
                /home/mvdan/tip/src/cmd/compile/internal/gc/ssa.go:444 +0xcd8
        cmd/compile/internal/gc.compileSSA(0xc0002be840, 0x1)
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:298 +0x5d
        cmd/compile/internal/gc.compileFunctions.func2(0xc000580c00, 0xc00054b1d0, 0x1)
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:363 +0x49
        created by cmd/compile/internal/gc.compileFunctions
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:361 +0x128

        goroutine 19 [runnable]:
        cmd/compile/internal/gc.(*Progs).settext(0xc0005ee2a0, 0xc0002be6e0)
                /home/mvdan/tip/src/cmd/compile/internal/gc/gsubr.go:173 +0xff
        cmd/compile/internal/gc.newProgs(0xc0002be6e0, 0x2, 0xc0005a6000)
                /home/mvdan/tip/src/cmd/compile/internal/gc/gsubr.go:72 +0x1d0
        cmd/compile/internal/gc.compileSSA(0xc0002be6e0, 0x2)
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:306 +0x366
        cmd/compile/internal/gc.compileFunctions.func2(0xc000580c00, 0xc00054b1d0, 0x2)
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:363 +0x49
        created by cmd/compile/internal/gc.compileFunctions
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:361 +0x128

        goroutine 20 [runnable]:
        cmd/compile/internal/ssa.(*Cache).Reset.func3(0x3e8, 0xc000071001)
                /home/mvdan/tip/src/cmd/compile/internal/ssa/cache.go:55
        sort.Search(0x7d0, 0xc000595d20, 0x0)
                /home/mvdan/tip/src/sort/search.go:66 +0x58
        cmd/compile/internal/ssa.(*Cache).Reset(0xc0004c8818)
                /home/mvdan/tip/src/cmd/compile/internal/ssa/cache.go:55 +0xf8
        cmd/compile/internal/gc.buildssa(0xc0002be2c0, 0x3, 0x0)
                /home/mvdan/tip/src/cmd/compile/internal/gc/ssa.go:316 +0x2f9
        cmd/compile/internal/gc.compileSSA(0xc0002be2c0, 0x3)
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:298 +0x5d
        cmd/compile/internal/gc.compileFunctions.func2(0xc000580c00, 0xc00054b1d0, 0x3)
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:363 +0x49
        created by cmd/compile/internal/gc.compileFunctions
                /home/mvdan/tip/src/cmd/compile/internal/gc/pgen.go:361 +0x128
FAIL
exit status 1
FAIL    gioui.org/cmd/gogio     4.713s
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 5, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Nov 5, 2019
@andybons
Copy link
Member

@randall77 what do you think? Should this block the beta coming up in December?

@randall77
Copy link
Contributor

This definitely blocks the release, a compiler crash in the runtime alloc path is bad.
Beta though? Not sure. How often does this happen? What is the source program (can I just go get gioui.org/cmd/gogio and go test it)?
We wouldn't necessarily need to fix it for the beta if it is low probability.

@mvdan
Copy link
Member Author

mvdan commented Nov 15, 2019

I only encountered this crash once, and haven't seen it again. I should also mention I haven't actively tried to reproduce it; I was in the middle of some work, and only filed the issue so that it wasn't forgotten.

Yes, you should be able to go get the package and go test it. Just make sure to run go test within the cmd/gogio directory, as it's a separate module. The panic happened while building a binary to run as part of the test, so you could narrow that down.

If you don't succeed in reproducing the crash, I can try to hammer it later and see if I manage to hit it again.

@aclements
Copy link
Member

Thanks. I'll fold this into the memory corruption super-bug. I'm going to close this issue since nobody has been able to reproduce it.

@golang golang locked and limited conversation to collaborators Nov 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

6 participants