v-analyzer icon indicating copy to clipboard operation
v-analyzer copied to clipboard

v-analyzer vscode extension crashes systematically

Open alfu32 opened this issue 2 years ago • 7 comments

Describe the bug

the extension spins up a new instance of v on each save that never exits, the result is that the extension stops working / crashes every minute or so. this looks like a regression ( might be that vscode update has caused this bug, or the newer version of v has changed behaviour )

Expected Behavior

v-analyzer shouldn't crash (at least not so soon )

Current Behavior

the extension spins up a new instance of v on each save that never exits, the result is that the extension stops working / crashes every minute or so. this looks like a regression ( might be that vscode update has caused this bug, or the newer version of v has changed behaviour )

workaround: kill v-analyzer ( that in turn kills all the spawned v subprocesses ) restart v-analyzer from vscode.

  • problematic because saving is a routine operation and you'll have to reapeat the procedure above every minute or so.

Reproduction Steps

open any v project, start editing. save edited files fairly soon v-analyzer crashes

Possible Solution

workaround: kill v-analyzer ( that in turn kills all the spawned v subprocesses ) restart v-analyzer from vscode.

  • problematic because saving is a routine operation and you'll have to reapeat the procedure above every minute or so.

Additional Information/Context

No response

Environment details (v doctor output)

vscode version

Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:47:11.635Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.2.0-37-generic

v info

>v doctor
V full version: V 0.4.4 afd74ad
OS: linux, Ubuntu 22.04.3 LTS
Processor: 16 cpus, 64bit, little endian, Intel(R) Xeon(R) W-11955M CPU @ 2.60GHz

getwd: /home/*****/Development/v-analyzer
vexe: /home/******/Development/v/v
vexe mtime: 2024-01-17 00:05:59

vroot: OK, value: /home/******/Development/v
VMODULES: OK, value: /home/******/.vmodules
VTMP: OK, value: /tmp/v_1001

Git version: git version 2.34.1
Git vroot status: weekly.2023.40.1-800-gafd74ad6
.git/config present: true

CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3

Editor name

vscode

v-analyzer Version

v-analyzer version 0.0.1-beta.1

VS Code Extension Version

v0.0.2

alfu32 avatar Jan 17 '24 08:01 alfu32

here's what's going on on the proces level:

2069836 ?        SNl  00:23:10  \_ /usr/share/code/code --type=utility --utility-sub-type=node.mojom.NodeService --lang=en-GB --service-sandbox-type=none --dns-result-order=ipv4first --inspect-por
2070041 ?        SNl  00:00:02  |   \_ /home/******/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/dotnet /home/******/.vscode/extensions/oracle.oracledevt
2070132 ?        SNl  00:00:03  |   \_ /usr/share/code/code --ms-enable-electron-run-as-node /home/******/.vscode/extensions/ms-edgedevtools.vscode-edge-devtools-2.1.3/node_modules/vscode-webhint/
2502930 ?        SNl  00:00:00  |   \_ /home/******/.config/v-analyzer/bin/v-analyzer
2502988 ?        ZN   00:00:00  |       \_ [v] <defunct>
2502994 ?        ZN   00:00:00  |       \_ [v] <defunct>
2502995 ?        ZN   00:00:00  |       \_ [v] <defunct>
2502997 ?        ZN   00:00:00  |       \_ [v] <defunct>
2502998 ?        ZN   00:00:00  |       \_ [v] <defunct>
2502999 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503001 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503002 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503008 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503010 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503011 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503012 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503013 ?        ZN   00:00:00  |       \_ [v] <defunct>
2503015 ?        ZN   00:00:00  |       \_ [v] <defunct>

alfu32 avatar Jan 18 '24 12:01 alfu32

and they keep accumulating with each save (ctrl-s)

2522708 ?        SNl  00:00:06  |   \_ /home/******/.config/v-analyzer/bin/v-analyzer
2522766 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522767 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522773 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522775 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522776 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522777 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522779 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522780 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522781 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522787 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522789 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522790 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522791 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522796 ?        ZN   00:00:00  |       \_ [v] <defunct>
2522797 ?        ZN   00:00:00  |       \_ [v] <defunct>
2525579 ?        ZN   00:00:00  |       \_ [v] <defunct>
2525697 ?        ZN   00:00:00  |       \_ [v] <defunct>
2525793 ?        ZN   00:00:00  |       \_ [v] <defunct>
2525885 ?        ZN   00:00:00  |       \_ [v] <defunct>
2525960 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526052 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526066 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526088 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526160 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526373 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526407 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526684 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526751 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526806 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526820 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526849 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526857 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526859 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526866 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526877 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526900 ?        ZN   00:00:00  |       \_ [v] <defunct>
2526985 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527252 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527254 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527261 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527373 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527394 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527528 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527604 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527749 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527762 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527791 ?        ZN   00:00:00  |       \_ [v] <defunct>
2527811 ?        ZN   00:00:00  |       \_ [v] <defunct>
2528256 ?        ZN   00:00:00  |       \_ [v] <defunct>
2528348 ?        ZN   00:00:00  |       \_ [v] <defunct>
2528509 ?        ZN   00:00:00  |       \_ [v] <defunct>
2528682 ?        ZN   00:00:00  |       \_ [v] <defunct>
2528807 ?        ZN   00:00:00  |       \_ [v] <defunct>
2528824 ?        ZN   00:00:00  |       \_ [v] <defunct>
2529168 ?        ZN   00:00:00  |       \_ [v] <defunct>
2530141 ?        ZN   00:00:00  |       \_ [v] <defunct>
2530211 ?        ZN   00:00:00  |       \_ [v] <defunct>
2530230 ?        ZN   00:00:00  |       \_ [v] <defunct>
2530759 ?        ZN   00:00:00  |       \_ [v] <defunct>
2530832 ?        ZN   00:00:00  |       \_ [v] <defunct>
2531200 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532219 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532226 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532227 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532238 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532254 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532333 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532483 ?        ZN   00:00:00  |       \_ [v] <defunct>
2532777 ?        ZN   00:00:00  |       \_ [v] <defunct>
2534075 ?        ZN   00:00:00  |       \_ [v] <defunct>
2534187 ?        ZN   00:00:00  |       \_ [v] <defunct>
2534575 ?        ZN   00:00:00  |       \_ [v] <defunct>
2535051 ?        ZN   00:00:00  |       \_ [v] <defunct>
2535059 ?        ZN   00:00:00  |       \_ [v] <defunct>
2535060 ?        ZN   00:00:00  |       \_ [v] <defunct>
2535540 ?        ZN   00:00:00  |       \_ [v] <defunct>
2535603 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536201 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536370 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536466 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536482 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536728 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536919 ?        ZN   00:00:00  |       \_ [v] <defunct>
2536990 ?        ZN   00:00:00  |       \_ [v] <defunct>
2537262 ?        ZN   00:00:00  |       \_ [v] <defunct>
2537895 ?        ZN   00:00:00  |       \_ [v] <defunct>
2538111 ?        ZN   00:00:00  |       \_ [v] <defunct>
2538422 ?        ZN   00:00:00  |       \_ [v] <defunct>
2538607 ?        ZN   00:00:00  |       \_ [v] <defunct>

alfu32 avatar Jan 18 '24 14:01 alfu32

.. it would help if somebody would point out where v is spawned ( and why ) ... might be a v issue after all.

alfu32 avatar Jan 18 '24 14:01 alfu32

Maybe this log could also help, because mine also constantly crashes:

[Info  - 7:53:00 PM] v-analyzer version: 0.0.3-beta.1, commit: a796f25, OS: linux x64
[Info  - 7:53:00 PM] v-analyzer executable path: /home/leo/.config/v-analyzer/bin/v-analyzer
[Info  - 7:53:00 PM] v-analyzer build with V aef3643
[Info  - 7:53:00 PM] v-analyzer build at 2023-12-13 12:53:18
[Info  - 7:53:00 PM] Client / Editor: Visual Studio Code 1.85.2 (PID: 48637)
[Info  - 7:53:00 PM] Using global config: /home/leo/.config/v-analyzer/config.toml
[Info  - 7:53:00 PM] Found toolchain candidates:
[Info  - 7:53:00 PM]   /opt/v
[Info  - 7:53:00 PM] Using "/opt/v" as toolchain
[Info  - 7:53:00 PM] Using "/home/leo/.cache/v-analyzer" as cache dir
[Info  - 7:53:00 PM] Using "/home/leo/.vmodules" as vmodules root
[Info  - 7:53:00 PM] Indexing /home/leo/.vmodules
[Info  - 7:53:00 PM] Indexing /opt/v/vlib
[Info  - 7:53:00 PM] Indexing /home/leo/.config/v-analyzer/metadata
[Info  - 7:53:00 PM] Indexing /home/leo/Documents/acr
signal 11: segmentation fault
addr2line: '[0x48fb95]': No such file
[0x48fb95]
addr2line: '[0x47923c]': No such file
[0x47923c]
addr2line: '[0x40f8c3]': No such file
[0x40f8c3]
addr2line: '[0x40fa0b]': No such file
[0x40fa0b]
addr2line: '[0x61359b]': No such file
[0x61359b]
addr2line: '[0x6b59a0]': No such file
[0x6b59a0]
[Info  - 7:53:00 PM] 
true
[Info  - 7:53:00 PM] v-analyzer version: 0.0.3-beta.1, commit: a796f25, OS: linux x64
[Info  - 7:53:00 PM] v-analyzer executable path: /home/leo/.config/v-analyzer/bin/v-analyzer
[Info  - 7:53:00 PM] v-analyzer build with V aef3643
[Info  - 7:53:00 PM] v-analyzer build at 2023-12-13 12:53:18
[Info  - 7:53:00 PM] Client / Editor: Visual Studio Code 1.85.2 (PID: 48637)
[Info  - 7:53:00 PM] Using global config: /home/leo/.config/v-analyzer/config.toml
[Info  - 7:53:00 PM] Found toolchain candidates:
[Info  - 7:53:00 PM]   /opt/v
[Info  - 7:53:00 PM] Using "/opt/v" as toolchain
[Info  - 7:53:00 PM] Using "/home/leo/.cache/v-analyzer" as cache dir
[Info  - 7:53:00 PM] Using "/home/leo/.vmodules" as vmodules root
[Info  - 7:53:00 PM] Indexing /home/leo/.vmodules
[Info  - 7:53:00 PM] Indexing /opt/v/vlib
signal 11: segmentation fault
addr2line: '[0x48fb95]': No such file
[0x48fb95]
addr2line: '[0x47923c]': No such file
[0x47923c]
addr2line: '[0x40f8c3]': No such file
[0x40f8c3]
addr2line: '[0x40fa0b]': No such file
[0x40fa0b]
addr2line: '[0x61359b]': No such file
[0x61359b]
addr2line: '[0x6b59a0]': No such file
[0x6b59a0]
[Error - 7:53:01 PM] Request textDocument/codeAction failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 7:53:01 PM] Request textDocument/documentLink failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 7:53:01 PM] Request textDocument/inlayHint failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Info  - 7:53:01 PM] 
true
[Error - 7:53:01 PM] Request textDocument/semanticTokens/range failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Info  - 7:53:01 PM] v-analyzer version: 0.0.3-beta.1, commit: a796f25, OS: linux x64
[Info  - 7:53:01 PM] v-analyzer executable path: /home/leo/.config/v-analyzer/bin/v-analyzer
[Info  - 7:53:01 PM] v-analyzer build with V aef3643
[Info  - 7:53:01 PM] v-analyzer build at 2023-12-13 12:53:18
[Info  - 7:53:01 PM] Client / Editor: Visual Studio Code 1.85.2 (PID: 48637)
[Info  - 7:53:01 PM] Using global config: /home/leo/.config/v-analyzer/config.toml
[Info  - 7:53:01 PM] Found toolchain candidates:
[Info  - 7:53:01 PM]   /opt/v
[Info  - 7:53:01 PM] Using "/opt/v" as toolchain
[Info  - 7:53:01 PM] Using "/home/leo/.cache/v-analyzer" as cache dir
[Info  - 7:53:01 PM] Using "/home/leo/.vmodules" as vmodules root
[Info  - 7:53:01 PM] Indexing /home/leo/.vmodules
signal 11: segmentation fault
addr2line: '[0x48fb95]': No such file
[0x48fb95]
addr2line: '[0x47923c]': No such file
[0x47923c]
addr2line: '[0x40f8c3]': No such file
[0x40f8c3]
addr2line: '[0x40fa0b]': No such file
[0x40fa0b]
addr2line: '[0x61359b]': No such file
[0x61359b]
addr2line: '[0x6b59a0]': No such file
[0x6b59a0]
[Info  - 7:53:02 PM] 
true
[Error - 7:53:02 PM] Request textDocument/semanticTokens/range failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Info  - 7:53:04 PM] v-analyzer version: 0.0.3-beta.1, commit: a796f25, OS: linux x64
[Info  - 7:53:04 PM] v-analyzer executable path: /home/leo/.config/v-analyzer/bin/v-analyzer
[Info  - 7:53:04 PM] v-analyzer build with V aef3643
[Info  - 7:53:04 PM] v-analyzer build at 2023-12-13 12:53:18
[Info  - 7:53:04 PM] Client / Editor: Visual Studio Code 1.85.2 (PID: 48637)
[Info  - 7:53:04 PM] Using global config: /home/leo/.config/v-analyzer/config.toml
[Info  - 7:53:04 PM] Found toolchain candidates:
[Info  - 7:53:04 PM]   /opt/v
[Info  - 7:53:04 PM] Using "/opt/v" as toolchain
[Info  - 7:53:04 PM] Using "/home/leo/.cache/v-analyzer" as cache dir
[Info  - 7:53:04 PM] Using "/home/leo/.vmodules" as vmodules root
[Error - 7:53:05 PM] Client V Language Server: connection to server is erroring. Shutting down server.
[Error - 7:53:05 PM] Request textDocument/documentLink failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 7:53:05 PM] Request textDocument/inlayHint failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 7:53:05 PM] Stopping server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 7:53:05 PM] Stopping server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
signal 11: segmentation fault
addr2line: '[0x48fb95]': No such file
[0x48fb95]
addr2line: '[0x47923c]': No such file
[0x47923c]
addr2line: '[0x40f8c3]': No such file
[0x40f8c3]
addr2line: '[0x40fa0b]': No such file
[0x40fa0b]
addr2line: '[0x61359b]': No such file
[0x61359b]
addr2line: '[0x6b59a0]': No such file
[0x6b59a0]
[Info  - 7:53:05 PM] Indexing /home/leo/.vmodules
[Info  - 7:53:05 PM] Indexing /opt/v/vlib
[Info  - 7:53:05 PM] Indexing /home/leo/.config/v-analyzer/metadata
[Info  - 7:53:05 PM] Indexing /home/leo/Documents/acr

Le0X8 avatar Feb 01 '24 18:02 Le0X8

Also, the installation script seems to fail at downloading the binaries:

Downloading v-analyzer...
Fetching latest release info from GitHub...
Found v-analyzer binary for your platform: linux-x86_64
> Download from url: https://github.com/v-analyzer/v-analyzer/releases/download/0.0.3-beta.1/v-analyzer-linux-x86_64.zip ...
Downloading v-analyzer archive..Failed to download file: failed to open file "/tmp/v-analyzer/archive/v-analyzer.zip"

✓ Successfully downloaded v-analyzer archive
Extracting v-analyzer archive...
✓ Successfully extracted v-analyzer archive
Path to the binary: /home/leo/.config/v-analyzer/bin/v-analyzer
Add it to your PATH to use it from anywhere or specify the full path to the binary in your editor settings

For example in VS Code settings.json:
{
    "v-analyzer.serverPath": "/home/leo/.config/v-analyzer/bin/v-analyzer"
}

Le0X8 avatar Feb 01 '24 19:02 Le0X8

@i582 @spytheman could someone please work on this? This issue persists for over a month for me now and I really need the analyzer to write V stuff. This is currently the only thing that keeps me away from V development.

Please fix this - thanks ^^

Le0X8 avatar Feb 01 '24 19:02 Le0X8