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

panic: runtime error when running the CLI daemon on my Pi #820

Closed
kittaakos opened this issue Jul 10, 2020 · 1 comment
Closed

panic: runtime error when running the CLI daemon on my Pi #820

kittaakos opened this issue Jul 10, 2020 · 1 comment
Labels
architecture: armv7 Specific to hosts using an ARMv7 core conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Jul 10, 2020

Bug Report

Current behavior

I am trying to use the Arduino CLI daemon on armv7l over gRPC. I had this error in the Pro IDE:

daemon INFO panic: runtime error: invalid memory address or nil pointer dereference
daemon INFO [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x12c28]
daemon INFO goroutine 1 [running]:
daemon INFO github.com/segmentio/stats/v4/prometheus.(*Handler).HandleMeasures(0xec44d8, 0x44dd7270, 0xbfba24fe, 0x1a71c0e, 0x0, 0xec44a0, 0x21f1300, 0x1, 0x1)
daemon INFO 	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/prometheus/handler.go:96 +0x1d8
daemon INFO github.com/segmentio/stats/v4.(*Engine).measure(0x21f11c0, 0x44dd7270, 0xbfba24fe, 0x1a71c0e, 0x0, 0xec44a0, 0x85f175, 0x6, 0x785f10, 0x985a50, ...)
daemon INFO 	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:155 +0x2b4
daemon INFO github.com/segmentio/stats/v4.(*Engine).Add(0x21f11c0, 0x85f175, 0x6, 0x785f10, 0x985a50, 0x2155e80, 0x1, 0x1)
daemon INFO 	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:94 +0x78
daemon INFO github.com/segmentio/stats/v4.(*Engine).Incr(...)
daemon INFO 	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:84
daemon INFO github.com/segmentio/stats/v4.Incr(...)
daemon INFO 	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:251
daemon INFO github.com/arduino/arduino-cli/cli/daemon.runDaemonCommand(0x21f74a0, 0x21ea630, 0x0, 0x5)
daemon INFO 	/__w/arduino-cli/arduino-cli/cli/daemon/daemon.go:65 +0x7e4
daemon INFO github.com/spf13/cobra.(*Command).execute(0x21f74a0, 0x21ea600, 0x5, 0x6, 0x21f74a0, 0x21ea600)
daemon INFO 	/github/home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x1f4
daemon INFO github.com/spf13/cobra.(*Command).ExecuteC(0x20ad760, 0x17, 0x0, 0x20000e0)
daemon INFO 	/github/home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x26c
daemon INFO github.com/spf13/cobra.(*Command).Execute(...)
daemon INFO 	/github/home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
daemon INFO main.main()
daemon INFO 	/__w/arduino-cli/arduino-cli/main.go:31 +0x24
daemon INFO Failed to start the daemon.
daemon ERROR Error: panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x12c28]

goroutine 1 [running]:
github.com/segmentio/stats/v4/prometheus.(*Handler).HandleMeasures(0xec44d8, 0x44dd7270, 0xbfba24fe, 0x1a71c0e, 0x0, 0xec44a0, 0x21f1300, 0x1, 0x1)
	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/prometheus/handler.go:96 +0x1d8
github.com/segmentio/stats/v4.(*Engine).measure(0x21f11c0, 0x44dd7270, 0xbfba24fe, 0x1a71c0e, 0x0, 0xec44a0, 0x85f175, 0x6, 0x785f10, 0x985a50, ...)
	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:155 +0x2b4
github.com/segmentio/stats/v4.(*Engine).Add(0x21f11c0, 0x85f175, 0x6, 0x785f10, 0x985a50, 0x2155e80, 0x1, 0x1)
	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:94 +0x78
github.com/segmentio/stats/v4.(*Engine).Incr(...)
	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:84
github.com/segmentio/stats/v4.Incr(...)
	/github/home/go/pkg/mod/github.com/segmentio/stats/v4@v4.5.3/engine.go:251
github.com/arduino/arduino-cli/cli/daemon.runDaemonCommand(0x21f74a0, 0x21ea630, 0x0, 0x5)
	/__w/arduino-cli/arduino-cli/cli/daemon/daemon.go:65 +0x7e4
github.com/spf13/cobra.(*Command).execute(0x21f74a0, 0x21ea600, 0x5, 0x6, 0x21f74a0, 0x21ea600)
	/github/home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x1f4
github.com/spf13/cobra.(*Command).ExecuteC(0x20ad760, 0x17, 0x0, 0x20000e0)
	/github/home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x26c
github.com/spf13/cobra.(*Command).Execute(...)
	/github/home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
	/__w/arduino-cli/arduino-cli/main.go:31 +0x24

Disabling the telemetry did help:

cat ~/.arduinoProIDE/arduino-cli.yaml 
board_manager:
  additional_urls: []
daemon:
  port: "50051"
directories:
  data: /home/pi/.arduino15
  downloads: /home/pi/.arduino15/staging
  user: /home/pi/Arduino
logging:
  file: ""
  format: text
  level: info
telemetry:
  addr: :9090
  enabled: false

Expected behavior

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.11.0 Commit: 0296f4d
  • OS and platform: Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

Additional context

I used the https://downloads.arduino.cc/arduino-cli/arduino-cli_0.11.0_Linux_ARMv7.tar.gz URL to get the CLI.

Update: I have corrected my original description; disabling the telemetry helped to work around the problem. I can confirm, without the telemetry, the daemon runs on ARM.

@rsora rsora added component/gRPC os: linux Specific to Linux operating system labels Jul 21, 2020
@rsora rsora changed the title [armv7l][grpc] panic: runtime error when running the CLI daemon on my Pi panic: runtime error when running the CLI daemon on my Pi Jul 21, 2020
@umbynos umbynos added the architecture: armv7 Specific to hosts using an ARMv7 core label Jul 21, 2020
@per1234 per1234 reopened this Mar 30, 2021
@rsora rsora added the topic: gRPC Related to the gRPC interface label Sep 22, 2021
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Dec 27, 2021
@ubidefeo
Copy link

I verified this bug on 2 machines

  • Raspberry Pi 4, arduino-cli 0.11: bug not present

  • Raspberry Pi 3B+, arduino-cli 0.11: bug is present

  • Raspberry Pi 4, arduino-cli 0.24: bug not present

  • Raspberry Pi 3B+, arduino-cli 0.23: bug not present

I'll consider this issue resolved and closed

@per1234 per1234 added the conclusion: resolved Issue was resolved label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture: armv7 Specific to hosts using an ARMv7 core conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

6 participants