Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on startup after updating my system: "Panic: runtime error: invalid memory address or nil pointer dereference" #194

Closed
3 tasks done
Invertisment opened this issue Aug 9, 2024 · 1 comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@Invertisment
Copy link

Invertisment commented Aug 9, 2024

Describe the problem

I enter my NVIM and it starts the LSP server.

Almost immediately the LSP server crashes with this message in the editor:

Client 1 quit with exit code 2 and signal 0

Then I get this message in the LSP log:

[ERROR][2024-08-09 15:03:11] .../vim/lsp/rpc.lua:734	"rpc"	"/home/_/go/bin/arduino-language-server"	"stderr"	"15:03:11.573161 \27[96mINIT --- : running: /usr/bin/arduino-cli --config-file /home/_/.arduino15/arduino-cli.yaml config dump --format json\27[0m\n"
[ERROR][2024-08-09 15:03:11] .../vim/lsp/rpc.lua:734	"rpc"	"/home/_/go/bin/arduino-language-server"	"stderr"	"15:03:11.582275 \27[96mINIT --- : Arduino Data Dir -> \27[0m\n"
[ERROR][2024-08-09 15:03:11] .../vim/lsp/rpc.lua:734	"rpc"	"/home/_/go/bin/arduino-language-server"	"stderr"	"15:03:11.582366 Panic: runtime error: invalid memory address or nil pointer dereference\n\ngoroutine 18 [running]:\nruntime/debug.Stack()\n\t/usr/lib/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/arduino/arduino-language-server/streams.CatchAndLogPanic()\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/streams/panics.go:29 +0x7e\npanic({0xaa17c0?, 0x1114170?})\n\t/usr/lib/go/src/runtime/panic.go:770 +0x132\ngithub.com/arduino/go-paths-helper.(*Path).Clone(...)\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/paths.go:81\ngithub.com/arduino/go-paths-helper.(*Path).Canonical(0xc000251c10?)\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/paths.go:536 +0x19\ngithub.com/arduino/arduino-language-server/ls.(*INOLanguageServer).extractDataFolderFromArduinoCLI(0xc000000480, {0xc84d80, 0xc000388000})\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/ls/ls.go:1485 +0x98d\ngithub.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE.func1()\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/ls/ls.go:215 +0x36a\ncreated by github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE in goroutine 8\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/ls/ls.go:189 +0x205\n\n"
[ERROR][2024-08-09 15:03:11] .../vim/lsp/rpc.lua:734	"rpc"	"/home/_/go/bin/arduino-language-server"	"stderr"	"panic: runtime error: invalid memory address or nil pointer dereference [recovered]\n\tpanic: runtime error: invalid memory address or nil pointer dereference\n[signal "
[ERROR][2024-08-09 15:03:11] .../vim/lsp/rpc.lua:734	"rpc"	"/home/_/go/bin/arduino-language-server"	"stderr"	"SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x790c99]\n\ngoroutine 18 [running]:\ngithub.com/arduino/arduino-language-server/streams.CatchAndLogPanic()\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/streams/panics.go:30 +0x194\npanic({0xaa17c0?, 0x1114170?})\n\t/usr/lib/go/src/runtime/panic.go:770 +0x132\ngithub.com/arduino/go-paths-helper.(*Path).Clone(...)\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/paths.go:81\ngithub.com/arduino/go-paths-helper.(*Path).Canonical(0xc000251c10?)\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/paths.go:536 +0x19\ngithub.com/arduino/arduino-language-server/ls.(*INOLanguageServer).extractDataFolderFromArduinoCLI(0xc000000480, {0xc84d80, 0xc000388000})\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/ls/ls.go"
[ERROR][2024-08-09 15:03:11] .../vim/lsp/rpc.lua:734	"rpc"	"/home/_/go/bin/arduino-language-server"	"stderr"	":1485 +0x98d\ngithub.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE.func1()\n\t/home/_/go/pkg/mod/github.com/arduino/[email protected]/ls/ls.go:215 +0x36a\ncreated by github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE in goroutine 8\n\t/home/martin/go/pkg/mod/github.com/arduino/[email protected]/ls/ls.go:189 +0x205\n"

To reproduce

It's enough to start my editor with .ino file.

clangd version 18.1.8

NVIM v0.9.5 (I had to downgrade from 10.1 because of this bug: #186)

Expected behavior

No crash.

Arduino Language Server version

0.7.6

Arduino CLI version

1.0.3-arch Commit: 8b6ad258e88581a9e77b2eede65aeeeeb265008c

Operating system

Linux

Operating system version

6.9.12-1-MANJARO

Additional context

Note: If I upgrade to the @latest unstable version then it doesn't crash (go install github.com/arduino/arduino-language-server@latest)

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@Invertisment Invertisment added the type: imperfection Perceived defect in any part of project label Aug 9, 2024
@alessio-perugini
Copy link
Contributor

@Invertisment 👋 thank you for taking the time to open the issue. The reason is that the latest stable doesn't target the arduino-cli v1.0.0 yet. For this reason, I suggest installing the LSP with the latest tag go install github.com/arduino/arduino-language-server@latest.
This will be needed until we release a new version, that will target the new v1 version of the arduino-cli.

@per1234 per1234 added conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself labels Aug 12, 2024
@per1234 per1234 changed the title Updated my system and arduino-language-server crashes upon startup Crash on startup after updating my system: "Panic: runtime error: invalid memory address or nil pointer dereference" Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants