Skip to content

segfault when using genericsΒ #80

@ttytm

Description

@ttytm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions