vlang / vls

V language server. (Old V language server - see v-analyzer)
MIT License
314 stars 53 forks source link

Crash on editing .v file #304

Closed vereym closed 2 years ago

vereym commented 2 years ago

System Information

V doctor

OS: linux, "Manjaro Linux"
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
CC version: cc (GCC) 11.1.0

getwd: /home/antoni/V/fizz_buzz
vmodules: /home/antoni/.vmodules
vroot: /home/antoni/V/v
vexe: /home/antoni/V/v/v
vexe mtime: 2022-02-06 18:01:55
is vroot writable: true
is vmodules writable: true
V full version: V 0.2.4 3fa9128.649ecab

Git version: git version 2.35.1
Git vroot status: weekly.2022.05-37-g649ecab1-dirty
.git/config present: true
thirdparty/tcc status: thirdparty-linux-amd64 3654d6a8

VLS info

vls version: 0.0.1.
vls server arguments: --child --timeout 15

Problem Description

I made a new project with v new and opened the generated v file. Started to edit the file and vls crashes. It also crashes after a few seconds if I edit another part of the .v file.

Expected Output

vls doesn't crash

Actual Output

signal 11: segmentation fault
| 0x564671cff133 | /home/antoni/.vls/bin/vls(+0x8c133)
| 0x564671cbb145 | /home/antoni/.vls/bin/vls(+0x48145)
| 0x564671cf7156 | /home/antoni/.vls/bin/vls(+0x84156)
| 0x564671cc8f5b | /home/antoni/.vls/bin/vls(+0x55f5b)
| 0x564671c971fc | /home/antoni/.vls/bin/vls(+0x241fc)
| 0x7f8c945c3259 | /usr/lib/libpthread.so.0(+0x9259)
| 0x7f8c944ec5e3 | /usr/lib/libc.so.6(clone+0x43)

The output in vscode is:

[Error - 19:04:06] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
    at Object.dispose (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:29:4057)
    at Object.dispose (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:34:9518)
    at Uf.handleConnectionClosed (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:36:9070)
    at Uf.handleConnectionClosed (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:39:12255)
    at n (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:36:8752)
    at Tu.invoke (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:2:9583)
    at wr.fire (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:2:10348)
    at it (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:3:10845)
    at Tu.invoke (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:2:9583)
    at wr.fire (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:2:10348)
    at Ao.fireClose (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:2:12622)
    at Socket.<anonymous> (/home/antoni/.vscode/extensions/vlanguage.vscode-vlang-0.1.11/out/extension.js:2:14174)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)

Steps to Reproduce

Last Recorded LSP Requests

Request

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","version":186},"contentChanges":[{"range":{"start":{"line":7,"character":4},"end":{"line":7,"character":4}},"rangeLength":0,"text":"n"}]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","id":8,"method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v"}}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":5}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","id":9,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v"}}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","id":10,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v"}}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","version":187},"contentChanges":[{"range":{"start":{"line":7,"character":1},"end":{"line":7,"character":5}},"rangeLength":4,"text":""}]}}

Response

[2022-02-06 18:04:04] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","id":8,"result":[{"startLine":0,"startCharacter":0,"endLine":0,"endCharacter":11,"kind":"region"},{"startLine":0,"startCharacter":2,"endLine":2,"endCharacter":63,"kind":"region"},{"startLine":0,"startCharacter":3,"endLine":3,"endCharacter":63,"kind":"region"},{"startLine":0,"startCharacter":5,"endLine":8,"endCharacter":1,"kind":"region"}]}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","id":10,"result":[{"name":"main","kind":12,"deprecated":false,"location":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","range":{"start":{"line":5,"character":3},"end":{"line":5,"character":7}}},"containerName":""}]}

[2022-02-06 18:04:05] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/antoni/V/fizz_buzz/fizz_buzz.v","diagnostics":[]}}
nedpals commented 2 years ago

Closed. Should be fixed on the latest versions of VLS.