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

segment violation running compiler #27433

Closed
robaho opened this issue Sep 1, 2018 · 4 comments
Closed

segment violation running compiler #27433

robaho opened this issue Sep 1, 2018 · 4 comments

Comments

@robaho
Copy link

robaho commented Sep 1, 2018

Using Go 1.11 - just made some code changes, and now when the compiler runs, it fails with:

github.com/robaho/keydb

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x177bcbe]

goroutine 1 [running]:
cmd/compile/internal/gc.typecheck1(0xc0002e7400, 0x2, 0xc000660aa8)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:1270 +0x3ece
cmd/compile/internal/gc.typecheck(0xc0002e7400, 0x2, 0x0)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckslice(0xc0003c7a00, 0x2, 0x2, 0x2)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:68 +0x50
cmd/compile/internal/gc.typecheck1(0xc0002e7380, 0x2, 0x0)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:1236 +0x3b10
cmd/compile/internal/gc.typecheck(0xc0002e7380, 0x2, 0xc000091800)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckas(0xc0002e7300)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:3336 +0xa4
cmd/compile/internal/gc.typecheck1(0xc0002e7300, 0x1, 0xc000090900)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:1985 +0x332a
cmd/compile/internal/gc.typecheck(0xc0002e7300, 0x1, 0xc00045a000)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckslice(0xc000495fc0, 0x4, 0x4, 0x1)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:68 +0x50
cmd/compile/internal/gc.typecheck1(0xc0002e7100, 0x1, 0xc0002e6e80)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:2059 +0xabaf
cmd/compile/internal/gc.typecheck(0xc0002e7100, 0x1, 0xc0002e6e80)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckslice(0xc0002ecd00, 0xa, 0x10, 0x1)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:68 +0x50
cmd/compile/internal/gc.Main(0x18c0388)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/main.go:518 +0x2059
main.main()
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/main.go:51 +0x96

Compilation finished with exit code 2

@randall77
Copy link
Contributor

Might be a dup of #27356.

@robaho
Copy link
Author

robaho commented Sep 1, 2018

attached patch file containing the code changes that cause the error

compile_error.patch.txt

@robaho
Copy link
Author

robaho commented Sep 1, 2018

I believe you are correct, as intellij is showing the line to be in error, but it looks ok to me... not sure what the problem is... ds.keyIndex is a slice

image

@robaho
Copy link
Author

robaho commented Sep 1, 2018

I see the problem, the method parameter is called 'len' and it is hiding the built-in len... so yes, I am going to close this as a duplicate

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

3 participants