vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
86 stars 9 forks source link

segfault when using generics #80

Open ttytm opened 3 months ago

ttytm commented 3 months ago

Describe the bug

v-analyzer crashes when working with generics. the issue happens more often in neovim than in vscode.

Expected Behavior

keeps running

Current Behavior

segfault

Reproduction Steps

E.g. in vlib/x/json2/decoder.v v-analyzer won't work - tested in VSCode as well as in neovim. The connection to the server closes

signal 11: segmentation fault
addr2line: '[0x4e6756]': No such file
[0x4e6756]
addr2line: '[0x5babc0]': No such file
...
[Error - 1:32:13 AM] Connection to server got closed. Server will not be restarted.
[Info  - 1:35:48 AM] v-analyzer version: 0.0.4-beta.1, commit: cae4a2c, OS: linux x64

In VSCode apparently below can be handled (I think the server restarts itself here), while in neovim a crash without restart seems more likely.

struct Foo[T] {
    foo T
}

// If it doesn't crash on paste try to remove and add the `bar T` parameter`
fn foo[T](bar T) {
    println(bar)
}

Possible Solution

No response

Additional Information/Context

might be an issue with V itself

Environment details (v doctor output)

linux, amd64

Editor name

nvim, vscode

v-analyzer Version

nightly

VS Code Extension Version

No response