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

x/tools/gopls: crashed when parsing invalid URL #37882

Closed
blithefeng opened this issue Mar 16, 2020 · 5 comments
Closed

x/tools/gopls: crashed when parsing invalid URL #37882

blithefeng opened this issue Mar 16, 2020 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@blithefeng
Copy link

2020/03/16 21:50:56 failed to parse matching URL: parse "http://%s:5000/api/agent/v1": invalid URL escape "%s:"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x11a5cfb]

goroutine 3917 [running]:
go/types.(*operand).assignableTo(0xc00d0f89a0, 0x0, 0x0, 0x0, 0x0, 0xc00d0f8c28)
/usr/local/go/src/go/types/operand.go:219 +0xfb
go/types.AssignableTo(...)
/usr/local/go/src/go/types/api.go:360
golang.org/x/tools/internal/lsp/source.(*candidateInference).typeMatches(0xc00342b0a0, 0x0, 0x0, 0x1a056a0, 0xc00bac0370, 0xc00d0f89e8)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:1972 +0xdf
golang.org/x/tools/internal/lsp/source.(*candidateInference).assigneesMatch(0xc00342b0a0, 0xc00d0f8c28, 0xc0027d23c0, 0x2)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:2029 +0x19b
golang.org/x/tools/internal/lsp/source.(*completer).matchingCandidate(0xc00342b000, 0xc00d0f8c28, 0xc00bac00a0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:1872 +0x119
golang.org/x/tools/internal/lsp/source.(*completer).found(0xc00342b000, 0x1a247c0, 0xc00bac04b0, 0x3ff0000000000000, 0x0, 0x0, 0x10000, 0x0, 0x0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:336 +0x128
golang.org/x/tools/internal/lsp/source.(*completer).methodsAndFields(0xc00342b000, 0x1a05720, 0xc00bab1ef0, 0x1, 0x0, 0x7f, 0x1)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:811 +0x15a
golang.org/x/tools/internal/lsp/source.(*completer).deepSearch(0xc00342b000, 0x1a24ae0, 0xc006f0c140, 0x3feca69c691cc3f2, 0xc00d2ffd8c, 0x4, 0x10000, 0x0, 0x0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/deep_completion.go:191 +0x1c6
golang.org/x/tools/internal/lsp/source.(*completer).found(0xc00342b000, 0x1a24ae0, 0xc006f0c140, 0x3feca69c691cc3f2, 0xc00d2ffd8c, 0x4, 0x10000, 0x0, 0x0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:368 +0x29a
golang.org/x/tools/internal/lsp/source.(*completer).lexical(0xc00342b000, 0x0, 0x0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:916 +0x739
golang.org/x/tools/internal/lsp/source.Completion(0x1a12360, 0xc00d0e29f0, 0x1a24540, 0xc006a6a600, 0x1a10a20, 0xc006a6a5a0, 0x4053400000000000, 0x4033000000000000, 0x0, 0x0, ...)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/source/completion.go:564 +0xe02
golang.org/x/tools/internal/lsp.(*Server).completion(0xc0001e1d80, 0x1a12360, 0xc002b5ac90, 0xc006be0d20, 0x0, 0x0, 0xc006b58160)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/completion.go:27 +0x6b0
golang.org/x/tools/internal/lsp.(*Server).Completion(0xc0001e1d80, 0x1a12360, 0xc002b5ac90, 0xc006be0d20, 0xc006be0d20, 0x0, 0x0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/server_gen.go:24 +0x49
golang.org/x/tools/internal/lsp/protocol.serverHandler.Deliver(0x1a2cb40, 0xc0001e1d80, 0x1a12360, 0xc002b5ac90, 0xc002940040, 0x0, 0x0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/lsp/protocol/tsserver.go:345 +0x2064
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc001f12e40, 0xc002940040, 0xc0003656e0, 0x1a12360, 0xc002b5ac90, 0x0, 0x0, 0xc00097d7d0)
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/jsonrpc2/jsonrpc2.go:372 +0x160
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/Users/fengcheng/go/pkg/mod/golang.org/x/tools@v0.0.0-20200227200655-6862ededa516/internal/jsonrpc2/jsonrpc2.go:356 +0x850

Process gopls stderr<2> finished

the code that contains url.

return fmt.Sprintf("http://%s:5000/api/agent/v1", "")
@gopherbot gopherbot added this to the Unreleased milestone Mar 16, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 16, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@heschi
Copy link
Contributor

heschi commented Mar 16, 2020

The log message at the top is unrelated and not fatal -- the actual problem is during completion. Looks like a dupe of https://golang.org/issue/37615. @muirmanders @stamblerre

@stamblerre
Copy link
Contributor

Yes, it does seem like a duplicate. The fix will be released in gopls/v0.3.4 in the next few days.

@stamblerre
Copy link
Contributor

Duplicate of #37615

@stamblerre stamblerre marked this as a duplicate of #37615 Mar 16, 2020
@blithefeng
Copy link
Author

Thanks, waiting for it

@golang golang locked and limited conversation to collaborators Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants