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/compile: internal compiler error in importer when building runtime's testprogcgo in PIE #28563

Closed
cherrymui opened this issue Nov 2, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@cherrymui
Copy link
Contributor

commented Nov 2, 2018

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

tip (745ec8b)

Does this issue reproduce with the latest release?

No

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/usr/local/google/home/cherryyz/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/local/google/home/cherryyz/gopkg"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/google/home/cherryyz/src/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/google/home/cherryyz/src/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
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-build858234433=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run all.bash, when testing the runtime package,

--- FAIL: TestCgoPprofPIE (2.90s)
    crash_cgo_test.go:275: building testprogcgo [-buildmode=pie]: exit status 2
        # strconv
        ../../../strconv/extfloat.go:208:30: internal compiler error: cannot import CALLINTER (30) node
        ==> please file an issue and assign to gri@
        
        
        goroutine 1 [running]:
        runtime/debug.Stack(0x0, 0x0, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/runtime/debug/stack.go:24 +0x9d
        cmd/compile/internal/gc.Fatalf(0xd9434c, 0x47, 0xc000678238, 0x2, 0x2)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/subr.go:190 +0x1e7
        cmd/compile/internal/gc.(*importReader).node(0xc00055b6c0, 0xc00069c880)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:1054 +0x2ffa
        cmd/compile/internal/gc.(*importReader).expr(0xc00055b6c0, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:773 +0x2f
        cmd/compile/internal/gc.(*importReader).exprList(0xc00055b6c0, 0xc00069c800, 0xc00069c780, 0xb80aac)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:763 +0x4f
        cmd/compile/internal/gc.(*importReader).node(0xc00055b6c0, 0xc00055b6c0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:899 +0x47e
        cmd/compile/internal/gc.(*importReader).expr(0xc00055b6c0, 0x97)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:773 +0x2f
        cmd/compile/internal/gc.(*importReader).exprsOrNil(0xc00055b6c0, 0xc0003c8060, 0x1)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:1077 +0x8a
        cmd/compile/internal/gc.(*importReader).node(0xc00055b6c0, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:1012 +0x2d7b
        cmd/compile/internal/gc.(*importReader).stmtList(0xc00055b6c0, 0x38, 0x40, 0xc00055b6c0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:745 +0x60
        cmd/compile/internal/gc.(*importReader).doInline(0xc00055b6c0, 0xc0004ca870)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:703 +0x67
        cmd/compile/internal/gc.expandInline(0xc0004ca870)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:62 +0x92
        cmd/compile/internal/gc.typecheckinl(0xc0004ca870)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:74 +0x61
        cmd/compile/internal/gc.mkinlcall(0xc000504380, 0xc0004ca870, 0x50, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:849 +0x4213
        cmd/compile/internal/gc.inlnode(0xc000504380, 0xcb06000000050, 0xc000500960)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:652 +0x9f2
        cmd/compile/internal/gc.inlnode(0xc000504300, 0x50, 0xc000504000)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:574 +0x165
        cmd/compile/internal/gc.inlnodelist(0xc0004f3280, 0x50)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:523 +0x6e
        cmd/compile/internal/gc.inlnode(0xc0004f62c0, 0x50, 0x2a)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:629 +0x415
        cmd/compile/internal/gc.inlcalls(0xc0004f62c0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:479 +0x77
        cmd/compile/internal/gc.Main.func6(0xc0003bdad0, 0x1, 0x2, 0xc000698000)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/main.go:592 +0x2e
        cmd/compile/internal/gc.(*bottomUpVisitor).visit(0xc000679a88, 0xc0004f62c0, 0x28)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:107 +0x237
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc000509f80, 0x28, 0xc000000028)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:136 +0x1ad
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcodelist(0xc000679a88, 0xc0004f3b80, 0x28, 0x28)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:115 +0x64
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc000509a80, 0x28, 0x511d33d00000028)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:129 +0xdd
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcodelist(0xc000679a88, 0xc000510040, 0xc000000028, 0xc0006980cc)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:115 +0x64
        cmd/compile/internal/gc.(*bottomUpVisitor).visit(0xc000679a88, 0xc0004f6580, 0x26)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:81 +0xfa
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc0003b5200, 0x26, 0xc000000026)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:136 +0x1ad
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc0003b5100, 0x26, 0xc000679a88)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:127 +0x95
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcodelist(0xc000679a88, 0xc0003a75a0, 0x26, 0x26)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:115 +0x64
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc0003b5080, 0x26, 0xc000000026)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:125 +0x4e
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcodelist(0xc000679a88, 0xc0003a7740, 0x26, 0x26)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:115 +0x64
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc0003b4900, 0x26, 0xc000000026)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:129 +0xdd
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcodelist(0xc000679a88, 0xc0003a7760, 0x26, 0xc000000026)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:115 +0x64
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcode(0xc000679a88, 0xc0003b4480, 0x26, 0xb3f2214500000026)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:129 +0xdd
        cmd/compile/internal/gc.(*bottomUpVisitor).visitcodelist(0xc000679a88, 0xc0003a7980, 0xc000000026, 0xc000698140)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:115 +0x64
        cmd/compile/internal/gc.(*bottomUpVisitor).visit(0xc000679a88, 0xc0000a6f20, 0x24)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:81 +0xfa
        cmd/compile/internal/gc.visitBottomUp(0xc0004c8480, 0x80, 0x90, 0xd98388)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:63 +0x95
        cmd/compile/internal/gc.Main(0xd98270)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/main.go:583 +0x2e87
        main.main()
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/main.go:51 +0x93
        
        # sync
        ../../../sync/map.go:103:24: internal compiler error: cannot import DCLFIELD (47) node
        ==> please file an issue and assign to gri@
        
        
        goroutine 1 [running]:
        runtime/debug.Stack(0x0, 0x0, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/runtime/debug/stack.go:24 +0x9d
        cmd/compile/internal/gc.Fatalf(0xd9434c, 0x47, 0xc000410c90, 0x2, 0x2)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/subr.go:190 +0x1e7
        cmd/compile/internal/gc.(*importReader).node(0xc0004211c0, 0xb7ae85)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:1054 +0x2ffa
        cmd/compile/internal/gc.(*importReader).stmtList(0xc0004211c0, 0x38, 0x40, 0xc0004211c0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:745 +0x60
        cmd/compile/internal/gc.(*importReader).doInline(0xc0004211c0, 0xc0003f1c20)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:703 +0x67
        cmd/compile/internal/gc.expandInline(0xc0003f1c20)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/iimport.go:62 +0x92
        cmd/compile/internal/gc.typecheckinl(0xc0003f1c20)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:74 +0x61
        cmd/compile/internal/gc.mkinlcall(0xc000363900, 0xc0003f1c20, 0x50, 0x8402000000050)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:849 +0x4213
        cmd/compile/internal/gc.inlnode(0xc000363900, 0x670a000000050, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:702 +0xb3c
        cmd/compile/internal/gc.inlnode(0xc000363980, 0x50, 0xc0000b91d0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:569 +0x121
        cmd/compile/internal/gc.inlnodelist(0xc00035b9c0, 0x6606000000050)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:523 +0x6e
        cmd/compile/internal/gc.inlnode(0xc000363780, 0x50, 0x0)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:610 +0x2ff
        cmd/compile/internal/gc.inlnodelist(0xc00035bbe0, 0x50)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:523 +0x6e
        cmd/compile/internal/gc.inlnode(0xc0000a6c60, 0x50, 0x1a)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:629 +0x415
        cmd/compile/internal/gc.inlcalls(0xc0000a6c60)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/inl.go:479 +0x77
        cmd/compile/internal/gc.Main.func6(0xc000426d60, 0x1, 0x4, 0xc00043c100)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/main.go:592 +0x2e
        cmd/compile/internal/gc.(*bottomUpVisitor).visit(0xc000411a88, 0xc0000a6c60, 0x18)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:107 +0x237
        cmd/compile/internal/gc.visitBottomUp(0xc000013000, 0x55, 0x80, 0xd98388)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/esc.go:63 +0x95
        cmd/compile/internal/gc.Main(0xd98270)
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/internal/gc/main.go:583 +0x2e87
        main.main()
        	/usr/local/google/home/cherryyz/src/go/src/cmd/compile/main.go:51 +0x93
        
        
FAIL
FAIL	runtime	22.251s

Same failure when running go build -buildmode=pie in $GOROOT/src/runtime/testdata/testprogcgo. It runs ok without -buildmode=pie.

@dmitshur dmitshur added this to the Go1.12 milestone Nov 4, 2018

@griesemer griesemer self-assigned this Nov 13, 2018

@griesemer

This comment has been minimized.

Copy link
Contributor

commented Nov 13, 2018

FWIW, I cannot reproduce this on OS X (macOS Mojave, 10.14.1) - it's not obvious why the import/export data might be so different for OS X and Linux.

Furthermore, the exporter explicitly maps OCALLINTER nodes to OCALL nodes. This might be some corruption elsewhere (maybe the prior node is not properly handled).

Exporting ODCLFIELD on the other hand is not supported in the first place ("unimplemented" panic), so it's also unclear how they might show up during import.

@cherrymui Can you still reproduce this?

@cherrymui

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2018

I cannot reproduce it now. Closing for now. I'll reopen if it shows again.

@griesemer thanks for looking into this. It indeed looks like some kind of corruption. Maybe there was something wrong on the file system on my machine on that day...

@cherrymui cherrymui closed this Nov 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.