Skip to content

Language Server crashes on Windows after code upload and related board COM port re-assignment #13

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

Closed
rsora opened this issue Feb 12, 2021 · 2 comments · Fixed by #23
Closed
Assignees
Labels
conclusion: resolved Issue was resolved topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project

Comments

@rsora
Copy link
Contributor

rsora commented Feb 12, 2021

Describe the bug
On windows, uploading code on an arduino:samd board like the MKR1010, I see an error popup from the language server after the upload, probably caused by multiple restarts of the LS triggered by a COM port change for the board (please see the entire screencast)

To Reproduce
Steps to reproduce the behavior:

  1. Connect a MKR1010 (or any other SAMD board) and select the board in the board selector drop down
  2. Open a sketch
  3. Press upload
  4. See error after the board changes its COM port

Expected behavior
LS should not crash

Screenshots
screencast

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 2.0.0-beta.1-snapshot.9e35571
  • Date: 2021-02-12T08:28:48.914Z
  • CLI Version: nightly-20210212 alpha [560025a6]

Additional context
@cmaglie could you please double check the LS logs attached to the issue and verify if there could be issues also in the Language Server?
sketch_feb12a.zip

@rsora rsora added the bug label Feb 12, 2021
@rsora
Copy link
Contributor Author

rsora commented Feb 12, 2021

Me and @cmaglie took a look in the LS logs and it seems that the panic you see in the logs in the attachment is not the root cause of the Issue.

2021/02/12 11:37:34 Panic: runtime error: invalid memory address or nil pointer dereference

goroutine 34 [running]:
runtime/debug.Stack(0xad61fe, 0x2, 0xc0002d9630)
	C:/hostedtoolcache/windows/go/1.13.15/x64/src/runtime/debug/stack.go:24 +0xa4
github.com/bcmi-labs/arduino-language-server/streams.CatchAndLogPanic()
	D:/a/arduino-language-server/arduino-language-server/streams/panics.go:14 +0xc6
panic(0xa092e0, 0xfd5f20)
	C:/hostedtoolcache/windows/go/1.13.15/x64/src/runtime/panic.go:679 +0x1c0
github.com/arduino/go-paths-helper.(*Path).String(...)
	C:/Users/runneradmin/go/pkg/mod/github.com/arduino/[email protected]/paths.go:565
github.com/bcmi-labs/arduino-language-server/handler.(*InoHandler).generateBuildEnvironment(0xc00023e140, 0x0, 0x0, 0x0)
	D:/a/arduino-language-server/arduino-language-server/handler/builder.go:121 +0x4dd
github.com/bcmi-labs/arduino-language-server/handler.(*InoHandler).initializeWorkbench(0xc00023e140, 0xbb4ee0, 0xc00001e198, 0xc00028a000, 0x0, 0x0)
	D:/a/arduino-language-server/arduino-language-server/handler/handler.go:537 +0x1bb
github.com/bcmi-labs/arduino-language-server/handler.(*InoHandler).HandleMessageFromIDE.func1(0xc00023e140, 0xbb4ee0, 0xc00001e198, 0xc00028a000)
	D:/a/arduino-language-server/arduino-language-server/handler/handler.go:258 +0x180
created by github.com/bcmi-labs/arduino-language-server/handler.(*InoHandler).HandleMessageFromIDE
	D:/a/arduino-language-server/arduino-language-server/handler/handler.go:249 +0x2fcf

I'm going to assign this to @kittaakos, but please @cmaglie, be available for assistance 😃

@rsora rsora assigned rsora and kittaakos and unassigned rsora Feb 12, 2021
kittaakos pushed a commit that referenced this issue Feb 17, 2021
@kittaakos
Copy link
Contributor

Related: golang/vscode-go@1ad5c33

kittaakos pushed a commit that referenced this issue Feb 18, 2021
From now on, a port change won't trigger LS start.

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 18, 2021
From now on, a port change won't trigger LS start.

Signed-off-by: Akos Kitta <[email protected]>
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234 per1234 added conclusion: resolved Issue was resolved topic: language server Related to the Arduino Language Server labels Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants