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: nil pointer panic when building delve in Docker on Windows #41257

Open
codinggg opened this issue Sep 7, 2020 · 0 comments
Open

cmd/compile: nil pointer panic when building delve in Docker on Windows #41257

codinggg opened this issue Sep 7, 2020 · 0 comments

Comments

@codinggg
Copy link

@codinggg codinggg commented Sep 7, 2020

  1. What version of Delve are you using (dlv version)?

1.5.0

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

go1.15.1 linux/amd64

  1. What operating system and processor architecture are you using?

I use windows system with open hyper-v mode, And installed virtualBox runing ubuntu system, and ubuntu run docker.

  1. What did you do?

I want to use delve to debug the golang program in the docker on the virtual machine ubuntu installed on virtualBox(a bit complicated) , but the installation of delve fails.

  1. What did you expect to see?

install success ;_)

  1. What did you see instead?
alex@alex-VirtualBox:~/docker/build-env/golang-debug$ docker run --rm -it golang-debug
root@dcf62d8a9905:/go# go get github.com/go-delve/delve/cmd/dlv
go: downloading github.com/go-delve/delve v1.5.0
go: found github.com/go-delve/delve/cmd/dlv in github.com/go-delve/delve v1.5.0
go: downloading github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b
go: downloading go.starlark.net v0.0.0-20190702223751-32f345186213
go: downloading gopkg.in/yaml.v2 v2.2.1
go: downloading golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb
go: downloading github.com/cosiner/argv v0.1.0
go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go: downloading github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/mattn/go-isatty v0.0.3
go: downloading github.com/google/go-dap v0.2.0
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/mattn/go-colorable v0.0.0-20170327083344-ded68f7a9561
go: downloading github.com/russross/blackfriday v1.5.2
# github.com/go-delve/delve/pkg/dwarf/util
unexpected fault address 0x0
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x50ed98]

goroutine 1 [running]:
runtime.throw(0xc422cd, 0x5)
        /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc0003794c0 sp=0xc000379490 pc=0x436a52
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:727 +0x405 fp=0xc0003794f0 sp=0xc0003794c0 pc=0x44cf45
cmd/internal/obj.(*Link).NumberSyms.func3(0x1d0004000000b8)
        /usr/local/go/src/cmd/internal/obj/sym.go:211 +0x38 fp=0xc000379570 sp=0xc0003794f0 pc=0x50ed98
cmd/internal/obj.(*Link).traverseSyms.func1(0xc000550680, 0x1d0004000000b8)
        /usr/local/go/src/cmd/internal/obj/sym.go:312 +0x2f fp=0xc000379588 sp=0xc000379570 pc=0x50f0ef
cmd/internal/obj.(*Link).traverseFuncAux(0xc0000f44e0, 0x6, 0xc000550600, 0xc0003796c8)
        /usr/local/go/src/cmd/internal/obj/sym.go:356 +0x256 fp=0xc000379660 sp=0xc000379588 pc=0x509556
cmd/internal/obj.(*Link).traverseSyms(0xc0000f44e0, 0x6, 0xc0003797d8)
        /usr/local/go/src/cmd/internal/obj/sym.go:314 +0x1ee fp=0xc000379760 sp=0xc000379660 pc=0x50916e
cmd/internal/obj.(*Link).NumberSyms(0xc0000f44e0, 0xc000379a00)
        /usr/local/go/src/cmd/internal/obj/sym.go:210 +0x1bf fp=0xc000379838 sp=0xc000379760 pc=0x508d1f
cmd/compile/internal/gc.Main(0xc6e518)
        /usr/local/go/src/cmd/compile/internal/gc/main.go:793 +0x3785 fp=0xc000379f10 sp=0xc000379838 pc=0xa5f1e5
main.main()
        /usr/local/go/src/cmd/compile/main.go:52 +0xb1 fp=0xc000379f88 sp=0xc000379f10 pc=0xba6471
runtime.main()
        /usr/local/go/src/runtime/proc.go:204 +0x209 fp=0xc000379fe0 sp=0xc000379f88 pc=0x439249
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000379fe8 sp=0xc000379fe0 pc=0x46cc21
# golang.org/x/arch/x86/x86asm
panic: runtime error: index out of range [-1820413807]

goroutine 13 [running]:
cmd/compile/internal/gc.genssa.func1(0x937eb091ffd8f008, 0xc001669071)
        /usr/local/go/src/cmd/compile/internal/gc/ssa.go:6191 +0xd5
cmd/compile/internal/ssa.(*FuncDebug).PutLocationList(0xc0018ba850, 0xc001669040, 0x99, 0x12c, 0xc0002f8340, 0xc000b4da80, 0xc000b4d880)
        /usr/local/go/src/cmd/compile/internal/ssa/debug.go:1088 +0x122
cmd/compile/internal/gc.createComplexVar.func1(0xd4d240, 0xc000b4da80, 0xd4d240, 0xc000b4d880)
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:761 +0x87
cmd/internal/dwarf.putvar(0xd58a80, 0xc0002f8340, 0xc00056fcd0, 0xc0018ba9a0, 0xd4d240, 0x0, 0x3, 0xffffffffffffffff, 0xc0018c8540, 0x0, ...)
        /usr/local/go/src/cmd/internal/dwarf/dwarf.go:1592 +0x2c2
cmd/internal/dwarf.putscope(0xd58a80, 0xc0002f8340, 0xc00056fcd0, 0xc000339a40, 0x1, 0x1, 0x0, 0x3, 0xc0018c8540, 0x0, ...)
        /usr/local/go/src/cmd/internal/dwarf/dwarf.go:1425 +0x10d
cmd/internal/dwarf.putPrunedScopes(0xd58a80, 0xc0002f8340, 0xc00056fcd0, 0x3, 0x3, 0xc)
        /usr/local/go/src/cmd/internal/dwarf/dwarf.go:1170 +0x45d
cmd/internal/dwarf.PutDefaultFunc(0xd58a80, 0xc0002f8340, 0xc00056fcd0, 0xc00038bce0, 0xc0003399c0)
        /usr/local/go/src/cmd/internal/dwarf/dwarf.go:1397 +0x3b9
cmd/internal/obj.(*Link).populateDWARF(0xc0002f8340, 0xc3d720, 0xc00038bce0, 0xc000b4d880, 0x7fff7b00fa6c, 0x1c)
        /usr/local/go/src/cmd/internal/obj/objfile.go:646 +0x58c
cmd/internal/obj.Flushplist(0xc0002f8340, 0xc00056fea8, 0xc00067d4e0, 0x7fff7b00fa6c, 0x1c)
        /usr/local/go/src/cmd/internal/obj/plist.go:113 +0x7fa
cmd/compile/internal/gc.(*Progs).Flush(0xc000efc300)
        /usr/local/go/src/cmd/compile/internal/gc/gsubr.go:98 +0xbd
cmd/compile/internal/gc.compileSSA(0xc00038bce0, 0x1)
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:342 +0x68e
cmd/compile/internal/gc.compileFunctions.func2(0xc00126e480, 0xc000ee0390, 0x1)
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:382 +0x4d
created by cmd/compile/internal/gc.compileFunctions
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:380 +0x129
# github.com/sirupsen/logrus
pkg/mod/github.com/sirupsen/logrus@v1.6.0/logger.go:133:2: internal compiler error: '(*Logger).WithContext': schedule does not include all values in block b4

Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new
root@dcf62d8a9905:/go#

By the way, I tried debug golang program with delve on above system environment was success. Util I open hyper-v,install docker in windows system.

@ALTree ALTree changed the title build delve failed in docker cmd/go: build delve failed in docker Sep 8, 2020
@jayconrod jayconrod changed the title cmd/go: build delve failed in docker cmd/compile: nil pointer panic when building delve in Docker on Windows Sep 21, 2020
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
2 participants
You can’t perform that action at this time.