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

[Bug] Crash (NPE) periodically occurs during some editing operations #95

Closed
addisonj opened this issue May 12, 2023 · 0 comments · Fixed by #96
Closed

[Bug] Crash (NPE) periodically occurs during some editing operations #95

addisonj opened this issue May 12, 2023 · 0 comments · Fixed by #96

Comments

@addisonj
Copy link

I occasinally get the following crash:

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

goroutine 5728 [running]:
github.com/grafana/jsonnet-language-server/pkg/server.typeToString({0x0?, 0x0?})
	/home/runner/work/jsonnet-language-server/jsonnet-language-server/pkg/server/completion.go:205 +0x27b
github.com/grafana/jsonnet-language-server/pkg/server.createCompletionItem({_, _}, {_, _}, _, {_, _})
	/home/runner/work/jsonnet-language-server/jsonnet-language-server/pkg/server/completion.go:180 +0x125
github.com/grafana/jsonnet-language-server/pkg/server.createCompletionItemsFromRanges({0xc0121b1e00, 0x1, 0x2?}, {0xc0128edb31, 0x1}, {0xc0128edb00, 0x33})
	/home/runner/work/jsonnet-language-server/jsonnet-language-server/pkg/server/completion.go:151 +0x359
github.com/grafana/jsonnet-language-server/pkg/server.(*Server).completionFromStack(0xc0001802c0?, {0xc0128edb00, 0x33}, 0xc007e880c0, 0x874180?)
	/home/runner/work/jsonnet-language-server/jsonnet-language-server/pkg/server/completion.go:93 +0x1f8
github.com/grafana/jsonnet-language-server/pkg/server.(*Server).Completion(0xc0001802c0, {0xd2?, 0xe0?}, 0xc0006405f0)
	/home/runner/work/jsonnet-language-server/jsonnet-language-server/pkg/server/completion.go:46 +0x21b
github.com/jdbaldry/go-language-server-protocol/lsp/protocol.serverDispatch({0xa53078, 0xc0008be040}, {0xa5bd90, 0xc0001802c0}, 0xc007e88000, {0xa531c8, 0xc0008be000})
	/home/runner/go/pkg/mod/github.com/jdbaldry/go-language-server-protocol@v0.0.0-20211013214444-3022da0884b2/lsp/protocol/tsserver.go:382 +0x1bd1
github.com/jdbaldry/go-language-server-protocol/lsp/protocol.ServerHandler.func1({0xa53078, 0xc0008be040}, 0xc007e88000, {0xa531c8, 0xc0008be000})
	/home/runner/go/pkg/mod/github.com/jdbaldry/go-language-server-protocol@v0.0.0-20211013214444-3022da0884b2/lsp/protocol/protocol.go:154 +0x90
github.com/jdbaldry/go-language-server-protocol/jsonrpc2.MustReplyHandler.func1({0xa53078, 0xc0008be040}, 0xc00012c078, {0xa531c8?, 0xc0008be000?})
	/home/runner/go/pkg/mod/github.com/jdbaldry/go-language-server-protocol@v0.0.0-20211013214444-3022da0884b2/jsonrpc2/handler.go:35 +0xf6
github.com/jdbaldry/go-language-server-protocol/jsonrpc2.AsyncHandler.func1.2()
	/home/runner/go/pkg/mod/github.com/jdbaldry/go-language-server-protocol@v0.0.0-20211013214444-3022da0884b2/jsonrpc2/handler.go:103 +0xa3
created by github.com/jdbaldry/go-language-server-protocol/jsonrpc2.AsyncHandler.func1
	/home/runner/go/pkg/mod/github.com/jdbaldry/go-language-server-protocol@v0.0.0-20211013214444-3022da0884b2/jsonrpc2/handler.go:100 +0x20a
[Info  - 11:34:20 AM] Connection to server got closed. Server will restart.

During some editing operations. It is difficult to say what causes it... because it just appears to happen randomly.

This is with the latest 0.12 release. If I can, I will try and spot some common operations causing this, but I hope the stack track is enough to maybe project against it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant