Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

@abhi
Copy link
Contributor

@abhi abhi commented Nov 15, 2018

This commit adds an error check to avoid crash while accessing the result of typecheck when there is an error generated.
Encountered a panic during hover. I don't have a way to reproduce it consistently. However I think this check is necessary. Please let me know otherwise. Posting the panic st.

panic serving textDocument/hover: runtime error: invalid memory address or nil pointer dereference
goroutine 75264 [running]:
third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver/util.Panicf(0xa918c0, 0x10cfe90, 0xb4be8f, 0x2, 0xc0270f1248, 0x1, 0x1, 0xc0270f1258, 0x45b656)
	third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver/util/util.go:133 +0x93
third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver.(*LangHandler).Handle.func1(0xc0327aa320, 0xc0270f1b78)
	third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver/handler.go:164 +0xc4
panic(0xa918c0, 0x10cfe90)
something.../.../.../tools/go/src/runtime/panic.go:513 +0x1b9
third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver.(*LangHandler).handleHoverGodef(0xc0000e1b00, 0xc42c20, 0xc032776240, 0xc41c20, 0xc000158380, 0xc0327aa320, 0xc018e07a90, 0x49, 0x23, 0x47, ...)
	third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver/hover.go:440 +0xaf6
third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver.(*LangHandler).handleHover(0xc0000e1b00, 0xc42c20, 0xc032776240, 0xc41c20, 0xc000158380, 0xc0327aa320, 0xc018e07a90, 0x49, 0x23, 0x47, ...)
	third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver/hover.go:27 +0x1140
third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver.(*LangHandler).Handle(0xc0000e1b00, 0xc42c20, 0xc032776240, 0xc41c20, 0xc000158380, 0xc0327aa320, 0x0, 0x0, 0x0, 0x0)
	third-party-source/go/src/github.com/sourcegraph/go-langserver/langserver/handler.go:333 +0x1d9e

...............

Signed-off-by: Abhinandan Prativadi aprativadi@fb.com

@abhi abhi changed the title Adding an error in handleHoverGodef Adding an error check in handleHoverGodef Nov 15, 2018
This commit adds an error check to avoid crash while accessing
the result of typecheck when there is an error generated.

Signed-off-by: Abhinandan Prativadi <aprativadi@fb.com>
Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@keegancsmith keegancsmith merged commit e01bf53 into sourcegraph:master Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants