Skip to content

Calling a command with an FQBN with unexisting package or architecture causes a panic #1531

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
silvanocerza opened this issue Oct 28, 2021 · 0 comments · Fixed by #1645
Closed
Assignees
Labels
conclusion: resolved Issue was resolved topic: CLI Related to the command line interface topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@silvanocerza
Copy link
Contributor

Bug Report

Current behavior

$ arduino-cli compile -b aduino:avr:uno ~/Documents/Arduino/Blink/
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x38 pc=0x10128f424]

goroutine 1 [running]:
github.com/arduino/arduino-cli/arduino/cores.(*Platform).String(...)
	/Users/alien/workspace/arduino-cli/arduino/cores/cores.go:262
github.com/arduino/arduino-cli/commands/compile.Compile(0x1016a14a0, 0x1400003c0c8, 0x140001c5c58, 0x10168e3a8, 0x14000010018, 0x10168e3a8, 0x14000010020, 0x14000412d00, 0x0, 0x0, ...)
	/Users/alien/workspace/arduino-cli/commands/compile/compile.go:127 +0xa44
github.com/arduino/arduino-cli/cli/compile.run(0x140003faf00, 0x140004124e0, 0x1, 0x3)
	/Users/alien/workspace/arduino-cli/cli/compile/compile.go:194 +0x41c
github.com/spf13/cobra.(*Command).execute(0x140003faf00, 0x140004124b0, 0x3, 0x3, 0x140003faf00, 0x140004124b0)
	/Users/alien/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x1d0
github.com/spf13/cobra.(*Command).ExecuteC(0x14000301680, 0x1, 0x1, 0x0)
	/Users/alien/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x264
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/alien/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
main.main()
	/Users/alien/workspace/arduino-cli/main.go:31 +0xd4
$ arduino-cli compile -b arduino:av:uno ~/Documents/Arduino/Blink/
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x38 pc=0x1032df424]

goroutine 1 [running]:
github.com/arduino/arduino-cli/arduino/cores.(*Platform).String(...)
	/Users/alien/workspace/arduino-cli/arduino/cores/cores.go:262
github.com/arduino/arduino-cli/commands/compile.Compile(0x1036f14a0, 0x140001a4008, 0x1400009bc58, 0x1036de3a8, 0x140001b0008, 0x1036de3a8, 0x140001b0010, 0x1400043cd00, 0x0, 0x0, ...)
	/Users/alien/workspace/arduino-cli/commands/compile/compile.go:127 +0xa44
github.com/arduino/arduino-cli/cli/compile.run(0x14000426f00, 0x1400043c4e0, 0x1, 0x3)
	/Users/alien/workspace/arduino-cli/cli/compile/compile.go:194 +0x41c
github.com/spf13/cobra.(*Command).execute(0x14000426f00, 0x1400043c4b0, 0x3, 0x3, 0x14000426f00, 0x1400043c4b0)
	/Users/alien/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x1d0
github.com/spf13/cobra.(*Command).ExecuteC(0x1400032d680, 0x1, 0x1, 0x0)
	/Users/alien/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x264
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/alien/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
main.main()
	/Users/alien/workspace/arduino-cli/main.go:31 +0xd4

Expected behavior

A clear message must tell the user that the package or architecture doesn't exist. A similar error to the one shown when specifying an FQBN with a non existing board ID.

$ arduino-cli compile -b arduino:avr:uo ~/Documents/Arduino/Blink/

Error during build: Error resolving FQBN: board arduino:avr:uo not found

Environment

  • CLI version (output of arduino-cli version): arduino-cli alpha Version: git-snapshot Commit: 4ce87fe7 Date: 2021-10-22T10:26:14Z
  • OS and platform: Doesn't matter

Additional context

None.

@silvanocerza silvanocerza added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: CLI Related to the command line interface labels Oct 28, 2021
@silvanocerza silvanocerza self-assigned this Oct 28, 2021
@per1234 per1234 changed the title Calling a command with an FQBN with unexisting package or architecure causes a panic Calling a command with an FQBN with unexisting package or architecture causes a panic Jan 27, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jan 28, 2022
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: CLI Related to the command line interface topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants