saibing / bingo

Bingo is a Go language server that speaks Language Server Protocol.
MIT License
495 stars 25 forks source link

Slice out of bounds in VS Code / Git #103

Closed inliquid closed 5 years ago

inliquid commented 5 years ago

This error appears only when switching between files in Source Control: Git pane:

panic serving textDocument/didClose: runtime error: slice bounds out of range
goroutine 20 [running]:
github.com/saibing/bingo/langserver/internal/util.Panicf(0x918080, 0xdc9ad0, 0x9a814b, 0x2, 0xc0106e5618, 0x1, 0x1, 0x40c289, 0xc010709f40)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/internal/util/util.go:116 +0x9a
github.com/saibing/bingo/langserver.(*LangHandler).Handle.func1(0xc010855bd0, 0xc0106e5c08)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:107 +0xcb
panic(0x918080, 0xdc9ad0)
    C:/Go/src/runtime/panic.go:513 +0x1c7
github.com/saibing/bingo/langserver/internal/source.ToURI(0x0, 0x0, 0x0, 0x0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/internal/source/uri.go:57 +0x1ab
github.com/saibing/bingo/langserver/internal/source.FromDocumentURI(0xc0101fe480, 0x108, 0x122, 0xc0106e5830)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/internal/source/uri.go:77 +0x54
github.com/saibing/bingo/langserver.(*overlay).didClose(0xc0001e8460, 0xa5e720, 0xc0000960c0, 0xc010709f20)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/fs.go:125 +0x45
github.com/saibing/bingo/langserver.(*HandlerShared).handleFileSystemRequest(0xc00009a140, 0xa5e720, 0xc0000960c0, 0xc010855bd0, 0xffffffffffffffff, 0x1)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/fs.go:56 +0x49b
github.com/saibing/bingo/langserver.(*LangHandler).Handle(0xc0001dc0c0, 0xa5e720, 0xc0000960c0, 0xa5cc20, 0xc0000ae780, 0xc010855bd0, 0x0, 0x0, 0x0, 0x0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:358 +0x3fa
github.com/saibing/bingo/langserver.(*LangHandler).handle(0xc0001dc0c0, 0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855bd0, 0xc010884028, 0x919c60, 0xc010709f00, 0x16)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:97 +0x6d
github.com/saibing/bingo/langserver.(*LangHandler).handle-fm(0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855bd0, 0xc010709f00, 0x919c60, 0xc010709f00, 0x0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:24 +0x59
github.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc000093200, 0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855bd0)
    C:/Users/*******/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20180831160525-549eb959f029/handler_with_error.go:21 +0x7a
github.com/saibing/bingo/langserver.lspHandler.Handle(0xa57e60, 0xc000093200, 0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855bd0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:45 +0xaf
github.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc0000ae780, 0xa5e720, 0xc0000960c0)
    C:/Users/*******/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20180831160525-549eb959f029/jsonrpc2.go:511 +0x4ec
created by github.com/sourcegraph/jsonrpc2.NewConn
    C:/Users/*******/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20180831160525-549eb959f029/jsonrpc2.go:328 +0x133
jsonrpc2 handler: notification "textDocument/didClose" handling error: unexpected panic: runtime error: slice bounds out of range
panic serving textDocument/didOpen: runtime error: slice bounds out of range
goroutine 20 [running]:
github.com/saibing/bingo/langserver/internal/util.Panicf(0x918080, 0xdc9ad0, 0x9a814b, 0x2, 0xc0106e55b8, 0x1, 0x1, 0x40c289, 0xc010709fd0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/internal/util/util.go:116 +0x9a
github.com/saibing/bingo/langserver.(*LangHandler).Handle.func1(0xc010855c20, 0xc0106e5c08)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:107 +0xcb
panic(0x918080, 0xdc9ad0)
    C:/Go/src/runtime/panic.go:513 +0x1c7
github.com/saibing/bingo/langserver/internal/source.ToURI(0x0, 0x0, 0x0, 0x0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/internal/source/uri.go:57 +0x1ab
github.com/saibing/bingo/langserver/internal/source.FromDocumentURI(0xc0101fe5a0, 0x101, 0xc010898400, 0xc00)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/internal/source/uri.go:77 +0x54
github.com/saibing/bingo/langserver.(*overlay).cacheFile(0xc0001e8460, 0xa5e720, 0xc0000960c0, 0xc0101fe5a0, 0x101, 0xc010898400, 0xbac, 0xc00)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/fs.go:156 +0x46
github.com/saibing/bingo/langserver.(*overlay).didOpen(0xc0001e8460, 0xa5e720, 0xc0000960c0, 0xc0108725c0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/fs.go:98 +0xa2
github.com/saibing/bingo/langserver.(*HandlerShared).handleFileSystemRequest(0xc00009a140, 0xa5e720, 0xc0000960c0, 0xc010855c20, 0xe8f, 0x1)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/fs.go:40 +0x268
github.com/saibing/bingo/langserver.(*LangHandler).Handle(0xc0001dc0c0, 0xa5e720, 0xc0000960c0, 0xa5cc20, 0xc0000ae780, 0xc010855c20, 0x0, 0x0, 0x0, 0x0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:358 +0x3fa
github.com/saibing/bingo/langserver.(*LangHandler).handle(0xc0001dc0c0, 0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855c20, 0xc010884188, 0x919c60, 0xc010709fa0, 0x16)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:97 +0x6d
github.com/saibing/bingo/langserver.(*LangHandler).handle-fm(0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855c20, 0xc010709fa0, 0x919c60, 0xc010709fa0, 0x0)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:24 +0x59
github.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc000093200, 0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855c20)
    C:/Users/*******/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20180831160525-549eb959f029/handler_with_error.go:21 +0x7a
github.com/saibing/bingo/langserver.lspHandler.Handle(0xa57e60, 0xc000093200, 0xa5e720, 0xc0000960c0, 0xc0000ae780, 0xc010855c20)
    C:/Users/*******/go/src/github.com/saibing/bingo/langserver/handler.go:45 +0xaf
github.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc0000ae780, 0xa5e720, 0xc0000960c0)
    C:/Users/*******/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20180831160525-549eb959f029/jsonrpc2.go:511 +0x4ec
created by github.com/sourcegraph/jsonrpc2.NewConn
    C:/Users/*******/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20180831160525-549eb959f029/jsonrpc2.go:328 +0x133
jsonrpc2 handler: notification "textDocument/didOpen" handling error: unexpected panic: runtime error: slice bounds out of range